In the case where you do not want the trigger to activate every single time the condition is true, you will need to add a persistent parameter. Let us begin with an example:
[State 310, 1]
type = PosAdd
trigger1 = Vel Y > 1
x = 10
This state controller moves P1 forwards by 10 pixels for every tick of game time where P1's y-velocity is greater than 1. That is, the controller is being activated everytime the trigger condition is true. If we want the controller to be activated only once, we will need to add a line:
[State 310, 1]
type = PosAdd
trigger1 = Vel Y > 1
persistent = 0 ;<-- Added this line
x = 10
persistent has a default value of 1, meaning that the controller is activated everytime the trigger is true. Setting persistent to 0 allows the controller to be activated only once during that state. This holds true until P1 leaves that state. If P1 returns to that state later, the controller can be activated once again.
The persistent parameter can also take values other than 0 and 1:
[State 310, 1]
type = PosAdd
trigger1 = Vel Y > 1
persistent = 2 ;<-- Modified this line
x = 10
In this case, setting persistent to 2 means the controller will be activated once of every two times the trigger is true. Setting persistent to 3 activates the controller every 3rd time, and so on.
Additional Notes:
To better illustrate the effects of persistency with values greater than 1, consider the following two statements;
[State 200, PSND]
type = playsnd
trigger1 = time%2 = 0
value = 40,0
[State 200, PSND]
trigger1 = 1
persistent = 2
value = 40,0
The above state controllers are both equivalent to each other. This can be useful for effects that you want to occur in specific intervals after a certain time, but do not want to do unnecessary calculations with the time trigger.
Another practical application for persistency is when you want an effect to trigger the moment a move makes contact with the opponent, without waiting for hitpause to end. Consider the following state controller:
[State 2000, Explod]
type = explod
trigger1 = movehit = 1
...
ignorehitpause = 1
The problem with the above is that with ignorehitpause=1, movehit=1 will return true as long as Player1 is affected by hitpause, causing the explod to appear multiple times, yet setting ignorehitpause to 0 will cause the explod to appear only after Player1's hitpause is over. Adding persistent=0 will ensure that the explod only appears once. This is useful if you wish to use Explods as hitsparks instead of Mugen's default hitspark system.