HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Randomization

11-23-2003, 08:11 PM#1
Pipe Bag
I want to make it so tht if you attack say a peasant, there will be a one in 10 chace of it succeeding and making him oh, lets say turn blue...How would i make this "random" occurance of 1in10 chance of happening? Somone please tell me!
11-23-2003, 08:28 PM#2
BlackLotus
create a integer var (name it s.th. like "random")
and then get
unit - is attack
other - then your unit with the ability
Set Random to Random between 1 and 10
If Random=1 then do 1
If Random=2 then do 2
If Random=3 then do 3
...
...

MfG
B~L~
11-23-2003, 08:57 PM#3
SpectreReturns
Accually itd just be:

Set Random to Random between 1 and 10
If Random=1 then do (Animation - Color (UNIT) to (0, 0, 100, 0) else (Do Nothing).
11-24-2003, 03:58 PM#4
Pipe Bag
Hmm, spectre..That was just an example :D Thanks anyway (i knew i should have checked the variables:bgrun: )