ChangeAnim and ChangeAnim2 (SCTRL) (Read 2154 times)

Started by Ricepigeon, October 20, 2015, 04:35:15 pm
Share this topic:
ChangeAnim and ChangeAnim2 (SCTRL)
New #1  October 20, 2015, 04:35:15 pm
  • *****
  • Gaps? Where we're going, we don't need gaps...
    • USA
ChangeAnim changes the action number of the player's animation to the animation number in the player's AIR file. ChangeAnim2 is like ChangeAnim, except this controller should be used if you have placed P2 in a custom state via a hit and wish to change P2's animation to one specified in P1's air file. For example, when making throws, use this to change P2 to a being-thrown animation.

Required parameters:

    value = anim_no (int)
        anim_no is the action number to change to.

Optional parameters:

    elem = elem_no (int)
        elem_no is the element number within the specified action to start from.

Additional Notes:
If you have Player2 in a custom state, and wish to use ChangeAnim in order to change them to an animation located in their own AIR file, it is typically good practice to use the SelfAnimExist trigger, with a ChangeAnim2 as a failsafe in case SelfAnimExist returns false. For example, assuming that Player2 is in a custom state with the following code;

[State 2050, CA]
type = changeanim
trigger1 = time = 0
trigger1 = selfanimexist(5060)
value = 5060

[State 2050, CA2]
type = changeanim2
trigger1 = time = 0
trigger1 = !selfanimexist(5060)
value = 2050

The above code will change Player2 to his own animation number 5060 if animation 5060 exists in Player2's AIR file, otherwise it will change Player2 to Player1's animation 2050 if animation 5060 does not exist in Player2's AIR file. Examples of where you may wish to use such code include Throw Escapes, Guard Crushes, Demitri's Midnight Bliss, Cheese KOs, and Dizzy states.
Last Edit: March 24, 2018, 07:57:05 pm by Odb718
Re: ChangeAnim and ChangeAnim2 (SCTRL)
#2  September 29, 2016, 07:22:21 pm
  • *****
  • Gaps? Where we're going, we don't need gaps...
    • USA
After some research, I should note that attempting to change to a specific animation element using Changeanim will only put you at the first possible tick of the animation element (assuming that the animelem has a duration of longer than 1 tick). Thus, if you attempt to use changeanim with animelemno(0) to "lock" the player's animation, such as during an armor state, note that you will be resetting that animation element back to the beginning of its duration.

See this thread for more information.