Entry
How can I make an event occur every X points?
Sep 5th, 2002 05:31
Matt Galanto, http://jove.prohosting.com/~bumcgi/cgi-bin/BumUHSD/display.cgi?game=faq
To make an event occur every X points, you can use the modulus
operator. You'll need an event like this:
Score("Player 1") MOD X points = 0+
Other conditions:
-Commands
Beware that this event will occur until the score changes or until one
of the other conditions becomes false.
Allow me to explain why this works. The MOD operator returns the
remainder of a division, and, if a the remainder of a division is 0,
then the numerator is a multiple of the denominator. Now, by virtue of
the having something occur every X points, we want to check to see if
the score is a multiple of X. If it is, Score("Player 1") MOD X points
will return 0.