Random Unit Help

Husky

Local Lurker
Reaction score
120
Hi,
How do I make it so that one out of five units is randomly a different unit.

Like in a tag map, one person is the tagger and the rest are the hiders.

All help will be appreciated,
-Husky
 

w/e

Boaroceraptorasaurus-Rex
Reaction score
275
i belive that there is a unit called random unit. it appears as a question mark in the unit palette.
 
S

ShaiTan-Enk

Guest
If you mean that you want it to randomly choose one of the 5 to be a different unit, then you can do it this way - add them all to a unit array of length 5. Then write a statement that says change UnitArray[Math - random number(1,5)] to a different unit. =D
 

Husky

Local Lurker
Reaction score
120
ShaiTan-Enk said:
If you mean that you want it to randomly choose one of the 5 to be a different unit, then you can do it this way - add them all to a unit array of length 5. Then write a statement that says change UnitArray[Math - random number(1,5)] to a different unit. =D

I had already done that, but it still doesn't work. I've tried Unit Array and Player Group Array, and it still aint working.
Code:
Unit - Create 1 Seeker for RandomTagger[(Random integer number between 1 and 5)] at (Center of RandomRegion[(Random integer number between 1 and 7)]) facing Default building facing degrees

That's what it looks like but it still aint working.
Any ideas?
-Husky
 
S

ShaiTan-Enk

Guest
Have the variables set before the statment. For example,
Code:
Action - Set randPlayer = random number(1,5)
Code:
Action - Set randRegion = random number (1,7)
And then have
Code:
Unit - Create 1 Seeker for RandomTagger[randPlayer] at (Center of RandomRegion[randRegion]) facing Default building facing degrees

See if that works :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top