Solved Return to Idle Animation

Question that is answered or resolved.

Aerisetta

Active member
Hi, I'm looking for an example of this type of animation implementation

I have a sword sheathing animation that I want to play every time the player attacks (does a sword swing) and returns to idle. (see video below)


Currently I am using this code. The problem is that I would like all attacks in the combo string 1 2 3 4 5 to lead into the sheath animation whenever the player stops the combo. However my current code forces the player into sheathing animation instead of return to idle animation. Is the an example of how to implement this?

Also, I would like to make the sheathing animation cancellable by anyhing, so if the player decides to attack, jump, walk etc, during sheathing, it will just immediately cancel, any suggestion how to do this?

The ATTACK
Code:
anim    attack1
@script
  if(frame==5){
    void self = getlocalvar("self");

    changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW10"));
  }
@end_script
    cancel    0     999     0  A2 freespecial45        #
    fastattack    1
    jugglecost    1
    delay    3
    offset    800 650
    bbox 749 300 100 350
    jumpframe 1 0 1
    sound    data/sounds/punch_.wav
    hitfx    data/sounds/katana1.wav   
    offset    800 650
    bbox 749 300 100 350
    attack1 0 0 0 0 0 0 0 0 0 0
    frame    data/chars/Yukari/attack101.png
    sound    data/sounds/A_Attack1.wav
    attack1 770 400 350 200 1 0 0 0 10 50
    forcedirection -1
    frame    data/chars/Yukari/attack102.png
    attack    0
    forcedirection -1
    frame    data/chars/Yukari/attack101.png
    attack    0
    frame    data/chars/Yukari/attack101.png
    delay    3
    frame    data/chars/Yukari/attack101.png
    frame    data/chars/Yukari/attack101.png

The SHEATHING
Code:
anim    follow10
    delay    8
    offset    800 650
    bbox 749 300 100 350
    jumpframe 0 0 0
    @cmd    spawner "trail" 0 0 0
    frame    data/chars/Yukari/Sheath101.png
    frame    data/chars/Yukari/Sheath102.png
    frame    data/chars/Yukari/Sheath103.png
    frame    data/chars/Yukari/Sheath104.png
    frame    data/chars/Yukari/Sheath105.png
    frame    data/chars/Yukari/Sheath106.png
    delay    20
    sound    data/sounds/sheath.wav
    frame    data/chars/Yukari/Sheath107.png
    frame    data/chars/Yukari/Sheath108.png
    frame    data/chars/Yukari/Sheath109.png
    delay    30
    frame    data/chars/Yukari/Sheath110.png
 
Solution
Hi, I'm looking for an example of this type of animation implementation

I have a sword sheathing animation that I want to play every time the player attacks (does a sword swing) and returns to idle. (see video below)


Currently I am using this code. The problem is that I would like all attacks in the combo string 1 2 3 4 5 to lead into the sheath animation whenever the player stops the combo. However my current code forces the player into sheathing animation instead of return to idle animation. Is the an example of how to implement this?

Also, I would like to make the sheathing animation cancellable by anyhing, so if the player decides to attack, jump, walk etc, during sheathing, it will just immediately cancel...
Hi, I'm looking for an example of this type of animation implementation

I have a sword sheathing animation that I want to play every time the player attacks (does a sword swing) and returns to idle. (see video below)


Currently I am using this code. The problem is that I would like all attacks in the combo string 1 2 3 4 5 to lead into the sheath animation whenever the player stops the combo. However my current code forces the player into sheathing animation instead of return to idle animation. Is the an example of how to implement this?

Also, I would like to make the sheathing animation cancellable by anyhing, so if the player decides to attack, jump, walk etc, during sheathing, it will just immediately cancel, any suggestion how to do this?

The ATTACK
Code:
anim    attack1
@script
  if(frame==5){
    void self = getlocalvar("self");

    changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW10"));
  }
@end_script
    cancel    0     999     0  A2 freespecial45        #
    fastattack    1
    jugglecost    1
    delay    3
    offset    800 650
    bbox 749 300 100 350
    jumpframe 1 0 1
    sound    data/sounds/punch_.wav
    hitfx    data/sounds/katana1.wav  
    offset    800 650
    bbox 749 300 100 350
    attack1 0 0 0 0 0 0 0 0 0 0
    frame    data/chars/Yukari/attack101.png
    sound    data/sounds/A_Attack1.wav
    attack1 770 400 350 200 1 0 0 0 10 50
    forcedirection -1
    frame    data/chars/Yukari/attack102.png
    attack    0
    forcedirection -1
    frame    data/chars/Yukari/attack101.png
    attack    0
    frame    data/chars/Yukari/attack101.png
    delay    3
    frame    data/chars/Yukari/attack101.png
    frame    data/chars/Yukari/attack101.png

The SHEATHING
Code:
anim    follow10
    delay    8
    offset    800 650
    bbox 749 300 100 350
    jumpframe 0 0 0
    @cmd    spawner "trail" 0 0 0
    frame    data/chars/Yukari/Sheath101.png
    frame    data/chars/Yukari/Sheath102.png
    frame    data/chars/Yukari/Sheath103.png
    frame    data/chars/Yukari/Sheath104.png
    frame    data/chars/Yukari/Sheath105.png
    frame    data/chars/Yukari/Sheath106.png
    delay    20
    sound    data/sounds/sheath.wav
    frame    data/chars/Yukari/Sheath107.png
    frame    data/chars/Yukari/Sheath108.png
    frame    data/chars/Yukari/Sheath109.png
    delay    30
    frame    data/chars/Yukari/Sheath110.png

Use idle 1 in the sheathing animation. It's a frame command that sets the idle state for remainder of that animation.

DC
 
Solution
Back
Top Bottom