[Trigger] Random Integer

Status
Not open for further replies.
Level 2
Joined
Sep 2, 2008
Messages
13
So what I am trying to do is make 12 units, 1 of each, and give them to a random player between 1 and 4, and I limit them to 3 each.
Basically I want all 12 to randomly be distributed to the 4 players, but everytime I test the map, everyone gets the same units and nothing different. Does anyone know how I can keep this from happening?
 
Level 2
Joined
Sep 2, 2008
Messages
13
I made my trigger run after elapsed game time. I changed it from 3 to a random number between 1-10, which gave me different units, but after that one change they stayed the same. So then I tried to make the trigger run after X seconds, where X would be defined after the players do a few things, and that didn't work at all either. :\
 
Level 15
Joined
Mar 31, 2009
Messages
1,397
  • Actions
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Set RandomUnit[(Integer A)] = SetUnits[(Random integer number between 1 and 12)]
    • For each (Integer A) from 1 to 4, do (Actions)
      • Loop - Actions
        • For each (Integer B) from 1 to 3, do (Actions)
          • Loop - Actions
            • Unit - Create 1 RandomUnit[(Random integer number between 1 and 12)] for (Player((Integer A))) at UnitSpawnPoint[(Integer A)] facing Default building facing degrees
            • Custom script: call RemoveLocation(udg_UnitSpawnPoint[GetForLoopIndexA()])

Double Random of Doom
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
Status
Not open for further replies.
Top