Help with Random Number

Status
Not open for further replies.
Level 13
Joined
Oct 28, 2019
Messages
523
Im trying to make randon things in my map, one is the colour of units, other squad. Dont know what error I did but the trigger dont work

  • RandomColour
    • Events
      • Time - Elapsed game time is 0.30 seconds
    • Conditions
    • Actions
      • Set VariableSet RandomColourLight1 = (Random integer number between 1 and 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RandomColourLight1 Equal to 1
        • Then - Actions
          • Game - Display to (All players) the text: 1
          • Unit - Create 1 Warrior for Player 4 (Purple) at (Center of WarriorMiddle1 <gen>) facing 100.00 degrees
          • Unit - Change ownership of (Last created unit) to Player 1 (Red) and Retain color
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RandomColourLight1 Equal to 2
            • Then - Actions
              • Game - Display to (All players) the text: 2
              • Unit - Create 1 Warrior for Player 10 (Light Blue) at (Center of WarriorMiddle1 <gen>) facing 100.00 degrees
              • Unit - Change ownership of (Last created unit) to Player 1 (Red) and Retain color
            • Else - Actions
Same thing with a squad that can "choose" 2 or more areas to go, and only one integer number is drawn
 
Level 19
Joined
Jan 1, 2018
Messages
739
Maybe it doesn't work because you change ownership directly after the unit is created?
Try setting the color like this:
  • Unit - Change color of (Last created unit) to Purple
 
Status
Not open for further replies.
Top