• 🏆 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!

[Need Info] Random objectives, different each game?

Status
Not open for further replies.
Level 2
Joined
Jan 21, 2015
Messages
14
I'm making a survival map where there are optional objectives to gain your hero extra XP and credits to unlock stuff, but there are multiple secondary objectives, I want like a trigger to randomly choose one or two you can do per game and not the other ones, but the next time you play you could (possibly, if chosen) do the other ones. I also want it so that each one has a random chance, so yes, sometimes you may get one or two of the same objectives as the last time you played it, but maybe a different second optional objective. I feel like this is like really easy and just staring me in the face cause I'm stupid or something, but how would I do this?
 
Level 2
Joined
Feb 2, 2015
Messages
8
Make use of the Random Integer math function.

Something like this should work:
  • Actions
    • Variable - Set Objective[0] = (Random integer between 0 and 4)
    • Variable - Set Objective[1] = ((Objective[0] + (Random integer between 1 and 4)) mod 5)
    • General - For each integer i from 0 to 1 with increment 1, do (Actions)
      • Actions
        • General - Switch (Actions) depending on Objective[i]
          • Cases
            • General - If (0)
              • Actions
                • Initialize Objective 0()
            • General - If (1)
              • Actions
                • Initialize Objective 1()
            • General - If (2)
              • Actions
                • Initialize Objective 2()
            • General - If (3)
              • Actions
                • Initialize Objective 3()
            • General - If (4)
              • Actions
                • Initialize Objective 4()
          • Default
 
Status
Not open for further replies.
Top