The Mugen Fighters Guild

Help => M.U.G.E.N Development Help => MUGEN Class => Topic started by: Ricepigeon on October 13, 2015, 07:33:29 pm

Title: StateType & P2StateType (Trigger)
Post by: Ricepigeon on October 13, 2015, 07:33:29 pm
StateType gives the player's state-type. Refer to the section on StateDef in the CNS documentation (http://mugenguild.com/forum/topics/details-statedef-cns-169454.0.html) for more details on StateType. Useful for "move interrupts" in the CMD file. P2StateType is the same as StateType, except that this returns the opponent's state type.

Format:
    1.) StateType [oper] state_type
    2.) P2StateType [oper] state_type
Arguments:

    [oper]
        =, != (other operators not valid)
    state_type (char)

        S, C, A, L
            Stand, Crouch, Air, Lie Down state-types.

Return type:
    boolean int (1 or 0)
Error conditions:
    StateType: none
    P2StateType: Returns bottom if p2 does not exist. (For instance, if the round has been won.)

Examples:
Code:
trigger1 = StateType != A
  Triggers if the player is not in an air-type state.

Related Triggers:
MoveType(*,***) & P2MoveType (Triggers) (http://mugenguild.com/forum/topics/movetype-triggers-169092.0.html)

Related SCTRL:
StateTypeSet (SCTRL) (http://mugenguild.com/forum/topics/statetypeset-sctrl-170182.0.html)


Additional Notes:
Often times, when a new coder is defining their Changestate controllers in the character's CMD file, they often make the mistake of using StateType=S or StateType=C as conditions for these attacks. Consider the following Changestate;

Code:
[State -1, Hadouken]
type = changestate
trigger1 = ctrl
trigger1 = command = "QCF_X"
trigger1 = StateType = S
value = 1000

The problem with the above is that the QCF_X command requires you to begin the input with D, which if held long enough will put the character into a crouching state. Because of this, if the player inputs the command too fast, the character will still be in a Crouching state, and thus will not go into state 1000. In these cases it is often better to simply use StateType!=A as a trigger instead.
Title: Re: StateType & P2StateType (Trigger)
Post by: Loves Pachirisu on November 21, 2015, 02:23:51 pm
In case if people do not know, this is used as one of the most mandatory and non buggy command  in order to trigger a state(AKA attack). So far as I know, there can be 2 ways to trigger a usual command.


(I dozed off and talked about changestates for some reason in the original edit)