YesNoOk
avatar

TimeMod(*,**,***) (Triggers) (Read 4229 times)

Started by Ricepigeon, 9 years ago
Share this topic:
TimeMod(*,**,***) (Triggers)
#1  9 years ago
  • *****
  • Thanks and God bless
    • USA
    • ricepigeon.neocities.org
Returns the remainder when the state-time of the player is divided by the specified value.

The % operator subsumes the functionality of TimeMod, so it is recommended that you use % instead.

Format:
    TimeMod [oper] divisor, value1
Arguments:

    [oper]
        =, !=, <, >, <=, >=
    divisor (int)
        Positive number to use as a divisor.
    value1 (int)
        Value to compare remainder against.

Return type:
    boolean int (1 or 0)
Error conditions:
    Returns bottom if the divisor is 0.

Example:
Code:
  1. trigger1 = TimeMod = 4, 3
  2.   Triggers when the state-time is 3, 7, 11, 15, ...

Additional Notes:
Due to the implementation of the % operator, this Trigger can be considered deprecated. All instances of the TimeMod trigger can be rewritten using the Time trigger in conjunction with the % operator in the following manner:

Code:
  1. TimeMod = X,Y --> Time%X=Y

thus.. in our above example, TimeMod=4,3 can be rewritten as Time%4=3
Re: TimeMod(*,**,***) (Triggers)
#2  9 years ago
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
And alternatively again you have

trigger1 = time >= 3
persistent = 4

In addition, i have had issues with timemod when the delay between activations is smaller than the starting time, or something like that

timemod = 5,2 has worked while timemod = 2,5 has not. Or something along those lines. The % option is more reliable and more readable


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.