• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to randomly research an upgrade? {each 10 minutes}

Status
Not open for further replies.
Level 4
Joined
Oct 11, 2008
Messages
90
I have a human Lumber Mill that has 4 upgrades (Iron Forged Sword, Iron Plating, Studded Leather Armor, Black Gunpowder). After 10 minutes of play i want to randomly research one of these upgrades. Is there a way to do that?
 
Level 12
Joined
Aug 18, 2006
Messages
1,193
make a trigger that runs after 600 seconds have gone

then make an Integer variable and set it in the trigger to (Random number between 1 and 4)

lastly, check with "If - Then - Else" actions if, for example, the Integer variable is 1 set the level of Iron Forged Sword for the player to 1(or Level of Iron Forged Sword for the player + 1 if he can research it for himself), until you have one "If - Then - Else" for each of the upgrades
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas

you can try following trigger:

  • Tech
    • Events
      • Time - Elapsed game time is 600.00 seconds
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 4) Equal to 1
        • Then - Actions
          • Unit - Order Lumber Mill 0004 <gen> to research 1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 4) Equal to 2
            • Then - Actions
              • Unit - Order Lumber Mill 0004 <gen> to research 2
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 4) Equal to 3
                • Then - Actions
                  • Unit - Order Lumber Mill 0004 <gen> to research 3
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Random integer number between 1 and 4) Equal to 4
                    • Then - Actions
                      • Unit - Order Lumber Mill 0004 <gen> to research 4
                    • Else - Actions
                      • Do nothing
1 2 3 4 (the research numbers) stands for the upgrades you wanna tech. If you want a tech every 600.00 seconds - then you simply change the Event

== Edit: Ok i'm to late sorry =D )
 
Level 11
Joined
Nov 15, 2007
Messages
781
Actually I did the same thing as you, but I deleted my post in the edit. It was truly a ninja-post Razorbrain made.
 
Status
Not open for further replies.
Top