• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Random picker doesn't work

Status
Not open for further replies.
Level 5
Joined
Aug 18, 2013
Messages
85
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Random real number between 1.00 and 100.00) Greater than or equal to 90.00
    • Then - Actions
      • Trigger - Run NEWLadyMacbeth 1 Normal <gen> (checking conditions)
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random real number between 1.00 and 100.00) Greater than or equal to 80.00
        • Then - Actions
          • Trigger - Run NEWLadyMacbeth 6 Lightning <gen> (checking conditions)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random real number between 1.00 and 100.00) Greater than or equal to 70.00
            • Then - Actions
              • Trigger - Run NEWLadyMacbeth 3 Lookup <gen> (checking conditions)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random real number between 1.00 and 100.00) Greater than or equal to 60.00
                • Then - Actions
                  • Trigger - Run NEWLadyMacbeth 2 firstperson <gen> (checking conditions)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Random real number between 1.00 and 100.00) Greater than or equal to 50.00
                    • Then - Actions
                      • Trigger - Run NEWLadyMacbeth 4 Lookup
Why does it always play the same one?
 
I don't know what I'm doing T_T

  • Set Real = (Random real number between 1.00 and 10.00)

What do I do next?

I'm so confused I'm stuck

I've only used if conditions so far. I don't know hwo to make the loop work
 
  • Actions
    • Set chance[1] = 50.00
    • Set chance[2] = 60.00
    • Set chance[3] = 70.00
    • Set chance[4] = 80.00
    • Set chance[5] = 90.00
    • Set triggers[1] = trigger 1
    • Set triggers[2] = trigger 2
    • Set triggers[3] = trigger 3
    • Set triggers[4] = trigger 4
    • Set triggers[5] = trigger 5
    • trigger X are the ones you try to run. This is done at initalization
  • Actions
    • Set rng = (Random real number between 1.00 and 100.00)
    • For each (Integer A) from 1 to 5, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • rng Greater than or equal to chance[(Integer A)]
          • Then - Actions
            • Trigger - Run triggers[(Integer A)] (ignoring conditions)
          • Else - Actions
@Iceman and other perfectionists
And NO I will not change away from integer a/b. No need for you to bother Iceman.
 
It is "Real"
  • Actions
    • Set rng = (Random real number between 1.00 and 100.00)
    • For each (Integer A) from 1 to 5, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • rng Greater than or equal to chance[(Integer A)]
          • Then - Actions
            • Trigger - Run triggers[(Integer A)] (ignoring conditions)
            • >>>>> Here should be something like "Skip remaining actions" <<<<<
          • Else - Actions
 
Why does it always play the same one?
It does not. If you are testing it in the editor you forgot to disabled fixed seed.

The mathematics is possibly incorrect. I recommend reading up about probability theory as it may be a lot more complicated than you currently think. Each condition is dependant on the previous condition which greatly alters the probability of one outcome occurring. As such your nice easy numbers you have chosen will result in very strange probabilities of occurrence. Specifically "NEWLadyMacbeth 4 Lookup" has less than a 50% chance of occurring.
 
But it's now playing all the cinematics at once. I did everything you guys said. What do I do?
Check the trigger in this post again. I believe the reason is because you did not do that.

If you do not have the "Skip remaining actions" the trigger will check for EVERY cinematic. If you have it, it will stop if it finds a valid one.
 
Status
Not open for further replies.
Back
Top