• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Help with Random Number

Status
Not open for further replies.
Level 12
Joined
Oct 28, 2019
Messages
481
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 18
Joined
Jan 1, 2018
Messages
728
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