Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Making P9 units move randomly
Making P9 units move randomly
Aug 11 2010, 4:06 am
By: Aristocrat  

Aug 11 2010, 4:06 am Aristocrat Post #1



Say I have a bunch of p9 observers that are followed by 1x1 locations; I want them to basically move around the map in a junk yard dog fashion; is this possible to do without resorting to location grids?



None.

Aug 11 2010, 5:23 am rockz Post #2

ᴄʜᴇᴇsᴇ ɪᴛ!

burrowed units with randomized orders. it's pretty ridiculous that you can't get one slot free to use for this.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Aug 11 2010, 12:25 pm NudeRaider Post #3

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

I see another problem: You need to prevent the locations from swapping to another observer when they fly over each other.
I guess you're trying to make a collision check with whatever comes near the observers, so it might be better to have them followed by a location that checks for observers.




Aug 11 2010, 12:48 pm Aristocrat Post #4



Quote from rockz
burrowed units with randomized orders. it's pretty ridiculous that you can't get one slot free to use for this.

I'm making a 8-player map with four teams, so I'd rather not resign to using computers. What do you mean by "burrowed units with randomized orders"? Preplace a static grid and give a random number of them to player 10?

Quote from NudeRaider
I see another problem: You need to prevent the locations from swapping to another observer when they fly over each other.
I guess you're trying to make a collision check with whatever comes near the observers, so it might be better to have them followed by a location that checks for observers.

I set up something similar to that (a 1x1 location checking for collision and killing the other observer, and the respawn trigger should pick up the 1x1 location and put the observer somewhere), but it occasionally doesn't work. I guess I will post the map when I get back on my computer.



None.

Aug 11 2010, 1:58 pm NudeRaider Post #5

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

What he means is you preplace a couple of burrowed P9 units around your map and then order the observers to a location centered on a random burrowed unit.




Aug 11 2010, 3:16 pm rockz Post #6

ᴄʜᴇᴇsᴇ ɪᴛ!

place ~32/64 zerglings at random in the area you want them to be in. There's no function to do this, just sort of scatter them around.

Give 0 zerglings owned by player 9 at location to player 10.
Center location 0 on zergling owned by player 9 at location.
Give all zergling owned by player 10 at location to player 9.
Generate your random 5 bit number. //optional. You can also just randomize switch, give units 5 times via binary countoffs.
Give random 5 bit number zerglings owned by player 9 at location to player 10. //you'll need binary countoffs here
Center location 1 on zergling owned by player 9 at location.
Give all zergling owned by player 10 at location to player 9.
Order all protoss observer at location 0 move to location 1.


Repeat this trigger set 32 times, with the starting value increasing by 1 every time, ie:

Give 1 zerglings owned by player 9 at location to player 10.
Center location 0 on zergling owned by player 9 at location.
Give all zergling owned by player 10 at location to player 9.
Generate your random 5 bit number.
Give random 5 bit number zerglings owned by player 9 at location to player 10.
Center location 1 on zergling owned by player 9 at location.
Give all zergling owned by player 10 at location to player 9.
Order all protoss observer at location 0 move to location 1.


Place the trigger under "All Players" but put a death count condition in each of the steps, so that they only happen once (this is why computer players are so useful). I'm a bit lost on how exactly to do this easily. On the first trigger run, if all players have exactly 0 DC, set DC to 1 for current player (don't preserve it). Have another trigger detect when a player has left, then set that player's DC to 0. The only way I know to detect when a person leaves is via a unique unit or detecting when a trigger doesn't run.

So the pre-triggers should looks like this:
All players have suffered exactly 0 deaths of DC
Set DC to 1 for current player

Player 1 command exactly 0 unit
Set DC to 0 for Player 1.

Player 2 command exactly 0 unit
Set DC to 0 for Player 2.
etc... up to player 5


Preserve isn't necessary on these 6 triggers, since they'll only fire when a person leaves or at the start of the game. Player 1 will never actually run any of the triggers except the first one at the start of the game, so you can theoretically check all players for the first trigger, then player 2-8 for the second, then 3-8 for the 3rd, etc... I only included 5 players because if only players 6,7,8 are left, and player 6 leaves, the game is over.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:57 am]
NudeRaider -- https://staredit.net/381600/ You have 5 minutes, then you can only edit your posts.
[2026-4-17. : 4:05 pm]
NudeRaider -- DarkenedFantasies
DarkenedFantasies shouted: you eat lots of beans
:lol:
[2026-4-17. : 11:30 am]
NudeRaider -- I would like 3000 minerals, please
[2026-4-16. : 7:32 pm]
Zoan -- I got $2000 bonus. I would like 2000 minerals, please
[2026-4-16. : 4:15 am]
DarkenedFantasies -- you eat lots of beans
[2026-4-16. : 3:46 am]
IskatuMesk -- how do i get gas
[2026-4-15. : 11:43 pm]
Moose -- you don't
[2026-4-15. : 10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
Please log in to shout.


Members Online: Prankenstein, Roy, JohnnyTheWolf