YesNoOk
avatar

Idle/Waiting Animation change (Read 3315 times)

Started by SithAngel, January 24, 2024, 07:30:31 pm
Share this topic:
Idle/Waiting Animation change
#1  January 24, 2024, 07:30:31 pm
  • *
I'm sure this has been asked before, I've tried searching but I can't seem to find something that works right for me.
Basically, I was wondering if anyone knew of the best way to change the standing animation over time to a different one?
Very similar to Reuben Kee or Evil Ryu &/or Ken.

I've thought about doing it via the sprites and having the change be in the animation itself.
But I kind of want it to trigger differently every time when the character is standing still.
Then for the character to stay in that 'idle' stance until I make him move or he's hit by the opponent.

Right now my animation file is like:
0 is the normal stance.
1 is the idle stance.


Any Idea's?
Re: Idle/Waiting Animation change
#2  January 24, 2024, 07:58:07 pm
  • ****
    • crepa.neocities.org
So you want to do it via code? And since you said 'trigger differently every time', what exactly are the triggers?
A very simple code for that would be:

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 1 && Time >= 300
value = 1

This will change to animation 1 after being idle for more or less 6 seconds.
Re: Idle/Waiting Animation change
#3  January 24, 2024, 08:12:51 pm
  • *
Doesn't really seem to work for me. Maybe I should of said I already have a 'ChangeAnim' in the code. For when the characters life gets low.
I don't know if the code you posted is conflicting with anything else.

But yeah, I want it to happen randomly. so 6 seconds then 8 seconds then maybe 15 seconds..

This is the code I'm using:
Code:
; Stand
[Statedef 0]
type = S
physics = S
sprpriority = 0
velset = 0,0

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

[State 0, Health Stance Change]
type = ChangeAnim
trigger1 = life <= 350
value = 2

[State 0]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 2
trigger2 = Anim = 2 && AnimTime = 0
value = 0

[State 0]
type = ChangeAnim
triggerall = life > lifemax /3
trigger1 = Anim != 0 && Anim != 2
trigger2 = Anim = 2 && AnimTime = 0
value = 0

[State 0]
type = ChangeAnim
triggerall = life <= lifemax /3
trigger1 = Anim != 0 && Anim != 2
trigger2 = Anim = 2 && AnimTime = 0
value = 2

[State 0, 2]
type = ChangeState
trigger1 = !Alive
value = 5050
Re: Idle/Waiting Animation change
#4  January 24, 2024, 08:42:09 pm
  • ******
    • Portugal
    • network.mugenguild.com/pots/
You need to make sure the ChangeAnims don't override each other. For instance the first one:

Code:
[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

Trigger1 will make the char unable to stay in anims 1 or 2 because 1 and 2 are different from 0 and 5.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.
Re: Idle/Waiting Animation change
#5  January 25, 2024, 12:03:59 am
  • *
You need to make sure the ChangeAnims don't override each other. For instance the first one:

Code:
[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

Trigger1 will make the char unable to stay in anims 1 or 2 because 1 and 2 are different from 0 and 5.

okay, how would I do that? lol
I've tried to remove that bit of code. But now the animation freezes at the end of the standing animation.
Last Edit: January 26, 2024, 01:26:34 pm by SithAngel
Re: Idle/Waiting Animation change
#6  January 26, 2024, 03:29:46 pm
  • ****
    • crepa.neocities.org
add "trigger1 = Anim != 1 && Anim != 2" to that first ChangeAnim.

Code:
[State 0]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 2
trigger2 = Anim = 2 && AnimTime = 0
value = 0

^ This one is also preventing the change to anim 1, I don't know why this is there, I'd just remove it.
Re: Idle/Waiting Animation change
#7  January 27, 2024, 04:59:26 am
  • *****
  • Shame on you!
    • USA
If you want the timing to change you can set a variable at time = 0 that's random.
Then if you don't want that specific timing after the animation changes, you can trigger a changestate back to state 0.
You'd use
[State 0, 5] 
type = ChangeState
trigger1 = Anim = 1 && AnimTime = 0
value = 0
So that the time would reset.

[State 0, Health Stance Change]
type = ChangeAnim
triggerall = Anim != 2   ;add this so the animation doesn't pop on the changestate
trigger1 = life <= 350
value = 2
 
vVv Ryuko718 Updated 10/31/22 vVv
Last Edit: January 27, 2024, 05:02:33 am by Odb718