All states must have at least one state controller, otherwise it will cause an error. State controller groups have the following format:
[State state_number, some_number]The state_number must be the same number of the state from the StateDef. some_number can be any number you choose; it is the number that is reported when an error is found, so you know which controller needs to be fixed.
type = controller_type
trigger1 = condition_exp
<universal optional parameters>
<additional parameters depending on controller>
The universal (applicable to all state controllers) optional parameters are the ignorehitpause and persistency parameters. If ignorehitpause is set to 1, MUGEN will check this state controller even if the character is paused by a hit. Otherwise, this state controller will not be checked during a hit pause. The default is 0, which is recommended for all but exceptional situations. For an explanation of the persistency parameter, see Trigger Persistency.
controller_type is the name of the controller you are using. Each type of controller has a different effect, and requires different parameters. See sctrls.txt for a full list of state controllers.
The order of the controllers is significant. Controllers listed first are the ones checked and, if necessary, activated first.
Here is an example of a controller that gives P1 control at the start of the state (the same effect as putting ctrl = 1 as a parameter in the StateDef):
[State 300, 1] ;State 300. 1 is just an arbitrary number.In this example, the CtrlSet type lets you change the control flag of P1. The line that reads trigger1 = Time = 0 means that this controller is activated when the state-time is 0, i.e., at the start of that state. The line value = 1 says that we want to set the value of the control flag to 1, which means true. If we want to make P1 start the state with no control, then we just need to change the last line to value = 0.
type = CtrlSet ;Changes the control flag.
trigger1 = Time = 0
value = 1
Let's look another example. This controller moves P1 forwards by 10 pixels twice: on the second and third element of his current Animation Action. Don't worry if you don't know what parameters go with which controller types. You can learn more about them from the state controller documentation (sctrls).
[State 300, 2]As you see above, each controller must have at least one trigger. A trigger is a condition that causes the controller to be activated. This example has two triggers, and the controller is activated when either one is true.
type = PosAdd ;Adds to P1's position
trigger1 = AnimElem = 2 ;Trigger on 2nd element.
trigger2 = AnimElem = 3 ;Trigger on 3rd element.
x = 10