Chance and multiple options.

Gensui Bas

New Member
Reaction score
5
Hello! :D

I've found some comments about % chance, but all these options seem to deal with only two 2 variables (true and false).

Code:
If-Condition: 
(Random integer number between 1 and X) equals Y:
-Then-Action:
(do something)
Else-Action:
(do something)

I tried to expend the code, but that didn't seem to work (not to mention that it uses different Random Integer numbers, instead of the same):

Code:
If-Condition: 
(Random integer number between 1 and X) equals Y than:
-Then-Action:
(do something)
Else-Action:
If(All Conditions are True)then do(Then Actions)else do(Else Actions)
If-Condition: 
(Random integer number between 1 and X) equals Y:
-etc

The thing I want to do is the following:
-When X happens:
25% Reaction 1
25% Reaction 2
30% Reaction 3
20% Reaction 4

Thanks!

B

(+rep)
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, you first need to store the random number in a variable, because otherwise it won't be correctly utilized...

Then, there random number should be between 1 and 100, and then you make the "If"s, so somethng like this ;)

Trigger:
  • Actions
    • Set TempInt = (Random integer number between 1 and 100)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • TempInt Greater than or equal to 1
        • TempInt Less than or equal to 25
      • Then - Actions
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • TempInt Greater than or equal to 26
        • TempInt Less than or equal to 50
      • Then - Actions
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • TempInt Greater than or equal to 51
        • TempInt Less than or equal to 80
      • Then - Actions
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • TempInt Greater than or equal to 81
        • TempInt Less than or equal to 100
      • Then - Actions
      • Else - Actions
 

Gensui Bas

New Member
Reaction score
5
Yeah, I am quite new to serious triggering (second day), so still much to learn... :cool:

Many thanks for this example! The item works now and I am sure that this will proove very useful in the futher for other spells/abilities/things! :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top