Random%

Started by GPEZ (Mugen League Host), October 19, 2015, 04:14:50 PM

Previous topic - Next topic

GPEZ (Mugen League Host)

i see some of the controller, the info is label as follow, eg.

Eg.
anim = 4000 + random%2

what is that mean?
Host of the team, Mugen League, which drive to promote member's quality work.

AlexSin

It means anim 4000 or 4001 will play (at random).

If it was
anim = 4000 + (random%3)
the anims that could randomly be used would be 4000 or 4001 or 4002.

Another example.
anim = 4000 + (random%4)
a random anim between 4000 and 4003 could be played, so one of these: 4000, 4001, 4002, 4003.

vgma2

To elaborate:
"Random" generates a random integer from 0 to 999.

"Modulo" (a%b) Divides the number "a" by "b" and returns the remainder.

GPEZ (Mugen League Host)

thank both of your explanation :)
Host of the team, Mugen League, which drive to promote member's quality work.