YesNoOk
avatar

Character won't go into walk animation after landing from special move (Read 849 times)

Started by Count Monte, January 07, 2010, 10:41:17 pm
Share this topic:
Character won't go into walk animation after landing from special move
#1  January 07, 2010, 10:41:17 pm
  • avatar
  • ***
I'm working on a Bruce Lee (Fei-Long edit).  He does all his special moves just fine.  The problem is that when he lands from his flying kick, he doesn't go into the walk animation anymore.  The landing from kick command tells it to ChangeState to 0, so he does go into his stand animation.  But if you push left or right, he moves but his animation still is the stand animation.  This only happens after performing this one flying kick, all his other air moves work fine.

This problem started when I added a toggle using the Enter key, which lets you go into Nunchuk mode, with a whole other move set.  I can fix the issue and get him to walk normally after landing if I remove this line from his walk command:

Var(1)=0

But then his nunchuk walk animation won't work.  And Var (1) = 1 puts him in nunchuk walk fyi.  Any ideas why this is causing a problem?

; Walk
[Statedef 20]
type    = S
physics = S

[State 20, 1]
type = VarSet
trigger1 = Var(1) = 0
v = 2
value = 0



[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
triggerall = var(1) = 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

Re: Character won't go into walk animation after landing from special move
#2  January 07, 2010, 10:43:32 pm
  • ******
Base lesson for EVERYTHING when you want to find out what a problem is : hit ctrl+D, look at the debug text to see what state number and animation it's on. Also add a type = displaytoclipboard in statedef -2 to display the value of var(1) at any time while you're at it.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Character won't go into walk animation after landing from special move
#3  January 07, 2010, 10:47:49 pm
  • avatar
  • ***
When he's walking normally it says ActionId and State is 20
After I do the flying kick and try to walk it says State is 20 but ActionId is 0
Re: Character won't go into walk animation after landing from special move
#4  January 07, 2010, 10:49:36 pm
  • ******
Okay, so where do yo tell it what animation it should play when var(1) = 1, are you expecting it to magically guess what animation it should play ? You never give any changeanim for it, so it keeps the same animation. The stance.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Last Edit: January 07, 2010, 10:56:16 pm by Byakko
Re: Character won't go into walk animation after landing from special move
#5  January 07, 2010, 10:51:09 pm
  • avatar
  • ***
I can't find the list of variables -- how exactly do you find it?
Re: Character won't go into walk animation after landing from special move
#6  January 07, 2010, 10:52:16 pm
  • ******
.... Why do you need that and how does that help you find an answer to the question I asked you, did you even read it or did you not understand it ?
There's no list. You're the one who decide when to set a variable to any value, in your code.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Character won't go into walk animation after landing from special move
#7  January 07, 2010, 10:57:46 pm
  • avatar
  • ***
Sorry, I'll try and explain better.  This is the code for when he lands from the kick:

; Flying Dragon Kick Land
[Statedef 1601]
type = S
movetype = A
physics = S
velset = 0,0
sprpriority = 2
anim = 1601
ctrl = 0

[State 1601, 1]
type = PosAdd
trigger1 = Time = 0
x = -10

;[State 1601, 1]
;type = VarRandom
;trigger1 = Time = 0
;v = 5
;range = 0,100


[State 1601, PosSet]
type = PosSet
trigger1 = 1
trigger1 = Time = 0
y = 0


[State 1601, PlaySnd]
type = PlaySnd
trigger1 = Time <= 0
value = 0, 0



[State 1601, State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
--------------------------------------------------

Now, here is the full list from State 0 and 20:  (note that 25 and 26 are Nunchuk walk animation

; Stand
[Statedef 0]
type = S
physics = S


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

[State 0, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < 2
trigger2 = Time = 4
x = 0

[State 0, 4]
type = ChangeAnim
trigger1 = var(1) = 1
trigger1 = var(2) = 1
value = 20

[State 0, 4]
type = ChangeAnim
trigger1 = var(1) = 1
trigger1 = var(2) = 1
value = 710


[State 0, 1]
type = ChangeAnim
trigger1 = var(1) = 1
trigger1 = var(2) = 2
value = 715

[State 0, 1]
type = ChangeAnim
trigger1 = var(1) = 1
trigger1 = var(2) = 0
value = 001


;---------------------------------------------------------------------------

; Walk
[Statedef 20]
type    = S
physics = S

[State 20, 1]
type = VarSet
trigger1 = Var(1) = 0
v = 2
value = 0


[State 20, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)



[State 20, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)


[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
triggerall = var(1) = 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
triggerall = var(1) = 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

[State 20, 5]
type = ChangeAnim
triggerall = vel x > 0
triggerall = var(1) = 1
trigger1 = Anim != 25 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 25

[State 20, 6]
type = ChangeAnim
triggerall = vel x < 0
triggerall = var(1) = 1
trigger1 = Anim != 26 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 26


So if I remove Var(1)=0 then he walks just fine after landing.  But then it screws up the nunchkuk stuff.
Re: Character won't go into walk animation after landing from special move
#8  January 07, 2010, 10:59:14 pm
  • avatar
  • ***
In case this helps, here's the nunchuk walk code:

;---------------------------------------------------------------------------
; Walk Nunchukus
[Statedef 25]
type    = S
physics = S


[State 20, 1]
type = VarSet
trigger1 = Var(1) = 1
v = 2
value = 0

[State 25, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 25, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 25, PlaySnd]
type = PlaySnd
triggerall = AnimElem = 2
trigger1 = Anim = 25
value = 998, 0
channel = 0


[State 25, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 25

[State 25, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 26
Re: Character won't go into walk animation after landing from special move
#9  January 07, 2010, 11:00:52 pm
  • avatar
  • ***
Finally, here's the code to toggle into nunchuk mode.

;---------------------------------------------------------------------------
; Nunchukus
[Statedef 995]
type = S
ctrl = 0
anim = 995
velset = 0,0
movetype = I
physics = S
sprpriority = 2

[State 995, PlaySnd]
type = PlaySnd
triggerall = AnimElem = 1
trigger1 = Anim = 995
value = 999, 27
channel = 0

[State 995, 1]
type = VarSet
trigger1 = Var(1) = 0
v = 1
value = 1

[State 995, 2]
type = VarSet
trigger1 = ctrl = 0
v = 2
value = 0

[State 995, 3]
type = VarSet
trigger1 = ctrl = 0
v = 3
value = 0

[State 995, 9]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Nunchukus
[Statedef 996]
type = S
ctrl = 0
anim = 996
velset = 0,0
movetype = I
physics = S
sprpriority = 2

[State 996, PlaySnd]
type = PlaySnd
triggerall = AnimElem = 1
trigger1 = Anim = 996
value = 999, 28
channel = 0

[State 996, 1]
type = VarSet
trigger1 = Var(1) = 1
v = 1
value = 0

[State 996, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
Re: Character won't go into walk animation after landing from special move
#10  January 07, 2010, 11:03:49 pm
  • avatar
  • ***
Related to this, my other problem is that it only let's me toggle back and forth from Nunchuk to regular mode if one of the triggers is Power = 3000.  If I remove that line from the command, then Nunckuk mode doesn't work at all.

Here's the command line for that:

;Nunchuku
[State -1, Nunchuku]
type = ChangeState
value = 995
triggerall = command = "start"
trigger1 = statetype != A
trigger1 = ctrl = 1
trigger1 = var(1) = 0
trigger1 =  power = 3000

[State -1, Nunchuku2]
type = ChangeState
value = 996
triggerall = command = "start"
trigger1 = statetype != A
trigger1 = ctrl = 1
trigger1 = var(1) = 1


I'd like to be able to toggle back and forth anytime, not just when the super meter is charged up.
Re: Character won't go into walk animation after landing from special move
#11  January 07, 2010, 11:14:10 pm
  • ******
You know what, since I already gave you the answer of where to look and what to do for the walk, I'll just wait until you actually decide to fucking read. When you do, if you have a question about it, then you can just ask, and only after that we'll see about the rest.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Character won't go into walk animation after landing from special move
#12  January 07, 2010, 11:17:12 pm
  • avatar
  • ***
I did hit Cntrl D, I told you what it said in debug mode (State is 20 but  ActionId stays 0).  And I added the display to clipboard in statedef -2.  But I am confused as to where to look at the clipboard etc.  I have no clue what you meant for me to do past that.
Re: Character won't go into walk animation after landing from special move
#13  January 07, 2010, 11:17:41 pm
  • ******
Okay, so where do yo tell it what animation it should play when var(1) = 1, are you expecting it to magically guess what animation it should play ? You never give any changeanim for it, so it keeps the same animation. The stance.
It's not like I didn't almost litterally told you "use a changeanim triggered by var(1) = 1".
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Character won't go into walk animation after landing from special move
#14  January 07, 2010, 11:18:54 pm
  • avatar
  • ***
But I can tell you that Var (1) = 0 puts him in regular hand-to-hand mode.  Var (1) = 1 puts him in Nunchuk mode.  To toggle between them you hit the "start" key.
Re: Character won't go into walk animation after landing from special move
#15  January 07, 2010, 11:20:12 pm
  • ******
:pwnonk: WHAT THE FUCK DO YOU NOT UNDERSTAND WHEN I SAY "USE A CHANGEANIM TRIGGERED BY VAR(1) = 1"
IF YOU HAVE NO IDEA WHAT YOU'RE DOING AND YOU CAN'T CODE, JUST SAY IT ALREADY
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Character won't go into walk animation after landing from special move
#16  January 07, 2010, 11:21:45 pm
  • avatar
  • ***
But where do I put the ChangeAnim command?  He's only able to perform the flying kick when he's in regular mode (Var 1 = 0).  After he lands and goes to State 0, he's glitched.  Not only does his walk animation not work, but you can't activate nunchuk mode anymore either.
Re: Character won't go into walk animation after landing from special move
#17  January 07, 2010, 11:22:59 pm
  • avatar
  • ***
Sorry dude, I'm a newbie at this, trying to teach myself as best I can. 
Re: Character won't go into walk animation after landing from special move
#18  January 07, 2010, 11:25:44 pm
  • ******
Q : When is it that you're having a problem ? What are the circumstances to get the problem ?
A : When you're trying to walk. That's the walk state. That's statedef 20, the very first one you talked about at the very beginning of this topic.

Q : What happens ? What is the description of the problem ?
A : The problem is that the animation doesn't change when in that state if var(1) = 1.

Q :Why does it not change ? What is the cause of the problem ?
A : Because you never tell that state to change the animation when var(1) = 1.

So...
Where : statedef 20
What : type = changeanim
How : trigger1 = var(1) = 1, just copy the other changeanim (the very first you quoted when you created this topic). Copy it, you need one changeanim that triggers when var(1) is 0 and one changeanim that triggers when var(1) is 1.
this will fix your walk animation problem. Also you do need to have an animation to play when he has the nunchaku.

Everything is right there since the very beginning. If there's something in this that you still don't understand, ask and say what you don't get or what you don't know how to use.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Last Edit: January 07, 2010, 11:33:32 pm by Byakko
Re: Character won't go into walk animation after landing from special move
#19  January 07, 2010, 11:37:20 pm
  • avatar
  • ***
I tried what you said, it didn't work. The problem isn't that he won't go into his walk animation at all, it's working fine for every other move.  It's only after he does this one specific kick that he gets glitched.  But I know it's related to the Var (1) = 0 etc in his walk line because when I remove it then he walks fine.

Here's the walk line as it is now:

[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
triggerall = var(1) = 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20


[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
triggerall = var(1) = 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

[State 20, 5]
type = ChangeAnim
triggerall = vel x > 0
triggerall = var(1) = 1
trigger1 = Anim != 25 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 25

[State 20, 6]
type = ChangeAnim
triggerall = vel x < 0
triggerall = var(1) = 1
trigger1 = Anim != 26 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 26
Re: Character won't go into walk animation after landing from special move
#20  January 07, 2010, 11:41:09 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Here's another solution. Delete all that because it's gibberish that will never work properly.

[mcode][State 0, 4]
type = ChangeAnim
trigger1 = var(1) = 1
trigger1 = var(2) = 1
value = 20

[State 0, 4]
type = ChangeAnim
trigger1 = var(1) = 1
trigger1 = var(2) = 1
value = 710
[/mcode]

Look at these 2. Which anim is it going to use? In addition, it's going to constantly change those madly. Walk, being managed by the system is going into state 20 (you won't be able to say state 25). I'm actually having a bit of trouble understanding everything you've done here.

What you need to do. Go to a state and set a variable. Use displaytoclipboard to make sure it's the value you think it is.

Change the animation on the stance. Nothing else, just get that working. You should use a second changeanim for this and add the triggerall time = 0

When THAT is working move onto walk. I recommend doing the same thing as the stance. Confirm a bit is working before you go further.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Character won't go into walk animation after landing from special move
#21  January 08, 2010, 12:26:16 am
  • avatar
  • ***
Thanks, I finally found what the problem was --- in the command for the flying kick, it was using (var) 1 = 1 for something else, so executing the kick was actually creating the problem, not the landing or standing.  I just changed the variable to something else and now it works.

I'll repost my other problem in a new topic.