Warcraft III resources & community, 2003–2006 · archived

Triggers- Random %'s using integers...

9 posts
#1

Triggers- Random %'s using integers...

someone said you can use integers for a % chance to do something... i see the part that says for each integer "1-10" do actions, but how do i have it choose the integer between ... say 1-30?
#2
i dont know, but that would be cool, because then i could make a monopoly map!
#3
lol that would be cool... like dice !

i did have another way to make random chances like that, make however regions to equal the %chance u need (25% would be 4) make them same size and space them apart fairly large, order a unit to patrol from the middle of one to the middle of the one on the other edge, use conditions like unit in region equal to true. spacing is critical along the units speed. also make the unit unselectable. :D
#4
On the For action, you can click on the 1 and the 10 and change them to any integers that you want.
#5
so does it automatically pick a number when u use those than? cause thats what i needed :(
#6
um, for X to Y is a loop, which means it uses each and every number

you're looking for the function
random integer between X and Y
or
random real between X.x and Y.y

to make a bi-random statement u use an if statement
if (random integer between 1 and 3) < 2 then
"you got low 66%"
else
"you got high 33%"

as for multiple choices you need to store the random number in a variable first and then do the same checks to the variable

o, and theres also the option of using the function
random percent
which gives u a number between 0.00 and 1.00
#7
hehe can you say that again in english plz? im not to good at % chances variables etc so i got NO idea what your talking about :lol:
#8
im not good at much... ive only been making maps for 2 months and i rarely worked on them in that time.
#9
RaD-hehe can you say that again in english plz? im not to good at % chances variables etc so i got NO idea what your talking about :lol:


ok, look for the function called Math - Random Integer or something like that, it looks like
(Random integer number between 1 and 10)
once u use it

what this function does is return a random integer between 1 and 10

so,
set varX = random integer number between 1 and 3
if varX == 1 then "YOU GOT ONE"
if varX == 2 then "YOU GOT TWO"
if varX == 3 then "YOU GOT THREE"

alternatively, theres
(Random percentage)

which gives u a number between 0.00 and 100.00