• 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.

Help with random integers.

Status
Not open for further replies.
Level 2
Joined
Jun 8, 2005
Messages
7
I don't understand how the action Random Integer 1 to 100 is 20 or something works, would that mean it has a 20% chance of happening or something. And how would i put it in an action like have that before the action i want to have randomly happen? Please help! :shock:
 
Level 6
Joined
Apr 4, 2005
Messages
299
It generates random number and (in ideal state) if you put If (random integer from 1 to 100) >= 50) (do something) else (do something else) it is "theoreticaly" (!!!) 50% chance for each of this events. You can use integer from 1 to 10 and test it for 5 as well.
You can also put another "if" to "else" part of previous one to test another condition etc.

(I hope you can understand, my description) :?
 
Status
Not open for further replies.
Top