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

[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?
 
Level 5
Joined
Aug 18, 2013
Messages
85
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
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
  • 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.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
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
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
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.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
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.
Top