So, I'm trying to randomize where a unit is created without setting up a series of switch patterns and locations.
So what I did:
This is for
Players 1-8 checked off.
Conditions:-Elapsed scenario time is at most 10 game seconds. (Just a precaution)
-Current player commands exactly 0
Ghost. (That is the unit)
-Current player has suffered exactly 0 deaths of
Ghost.
Actions:-Create 1
Ghost at "Anywhere" for Current Player.
-Wait 1000 milliseconds.
-Preserve trigger
So I've tested it, and every time, the unit ends up in the middle of the map. Now, the middle of the map is hardly random. So does anyone know why spawning units at "Anywhere" spawns them in the middle of the map?
Map is 64x64.
Thanks.
None.
Because Create Units creates the unit as close as it can to the center of the location.
Your best bet is to create a Scourge and the center of the map and order it to Junk Yard Dog (Use the Set Unit Order to Junk Yard Dog AI script), which will make it move in a random direction, and after a random amount of time, center a location on the Scourge and create the Ghost there. There is a chance that the Scourge will be somewhere where the Ghost can't spawn, which you'll have to take into consideration.
None.

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
Well Anywhere is just a location like any other. SC always creates units at the center of locations. That's all there is to it.
If you want them to be created at random spots you'll have to set up a bunch of locations and look up the wiki for randomizations.
If you're low on locations you could also cycle one location through a bunch of burrowed units. (Give random number of those burrowed units to another player center location on burrowed unit at anywhere (it will choose the leftmost that hasnt been given) create the units, give the burrowed units back)
Alright. My friend told me to do that, but I was just looking for a logical reason. Thanks xD.
None.