News:

MFG's Character of the Month: October 2026 Voting

Main Menu

Quick Question

Started by ArmorGon, June 24, 2012, 09:42:10 PM

Previous topic - Next topic

ArmorGon

What does it mean when it says that the "State Machine was stuck in loop." ?
This happened when I was fighting against NHK's Makoto. I use Mugen 1.0 if it helps.




GT

#1
The character is going into a state and then returning to the state where they began, causing an infinite loop. Can you tell us what state the character was in when you received that error message?

ArmorGon

#2
2500

Here is a screenshot(if it's any help):
*On first post*

ArmorGon

I don't know how to bump a topic without double posting, so sorry.

Could anyone help me out?

Rajaa Retired

2500 is not the state you were in, it's the number of loops that happened before the character was declared stuck. You were in state 130, which is a guard state.

If the character has a [statedef 130] in any of its state files, please post that statedef and all of its components here so we can check it out. Otherwise, your common1.cns way have been altered or something of the sort.

ArmorGon

Oops how did I mess that up.  ;P

Here is the state 130. Thanks.


[Statedef 130]
type    = S
physics = S

[State 130, 1]
type = ChangeAnim
trigger1 = Anim != 130
value = 130

[State 130, Hi to Lo]
type = ChangeState
trigger1 = command = "holddown"
trigger1 = var(50) != 1
trigger2 = EnemyNear,StateType != A
trigger2 = var(50)=1
value = 131

[State 130, Stop Guarding]
type = ChangeState
trigger1 = var(50) != 1
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

Rajaa Retired

Now tell me when var(50) is equal to 1 and when it isn't. I also want you to post statedefs 131 and 140.

ArmorGon

#7
If var 50 when equal to 1 is stand guard then wouldn't crouch guard be when var isn't 1. (Sorry just taking a stab here.)

State 131

; CROUCH GUARD (guarding)
[Statedef 131]
type    = C
physics = C

[State 131, 1]
type = ChangeAnim
trigger1 = Anim != 131
value = 131

[State 131, Lo to Hi]
type = ChangeState
trigger1 = command != "holddown"
trigger1 = var(50) != 1
trigger2 = P2StateType = A
trigger2 = var(50)=1
value = 130

[State 131, Stop Guarding]
type = ChangeState
trigger1 = var(50) != 1
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140


State 140

[Statedef 140]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged
ctrl = 1

[State 140, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 140 + (statetype = C) + (statetype = A)*2

[State 140, 2]
type = StateTypeSet
trigger1 = Time = 0 && statetype = S
physics = S

[State 140, 3]
type = StateTypeSet
trigger1 = Time = 0 && statetype = C
physics = C

[State 140, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

[State 140, Hi to Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = command = "holddown"
trigger1 = var(50) != 1
trigger2 = EnemyNear,StateType != A
trigger2 = var(50) = 1
statetype = C
physics = C

[State 140, Lo to Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = command != "holddown"
trigger1 = var(50) != 1
trigger2 = EnemyNear,StateType = A
trigger2 = var(50) = 1
statetype = S
physics = S

Rajaa Retired

#8
Var(50) is for AI? Is it the AI that starts the looping?

Code (mugen) Select
trigger2 = EnemyNear,StateType != A
trigger2 = var(50)=1


trigger2 = P2StateType = A
trigger2 = var(50)=1


That's the loop. It goes back and forth.

If the enemy isn't in then air, crouch guard, and when you go to crouch guard, you go right back because the trigger says go back to 130 when the enemy is in the air.

ArmorGon

Oh I see what you mean. The character goes from high to low and low to high back in forth until I get the error message, correct?

Are you asking me what var(50) is? Because I wouldn't know what it is, haha.

I changed the triggers (you edited the post out) and it seemed to work fine, except I attacked the character will in midair and she remained standing in midair and kept moving until I did a grapple. It only happened once out of 6 matches.

Rajaa Retired

You neglected to answer my question. Does the error only happen with the AI? You need to find out what var(50) actually is if it's not AI. The simple solution is to get rid of those guard states so the character uses common1.cns, but I don't necessarily know what var(50) is or if the rest of the guardstates have some unique codes or not.

And air guarding state is 132, so anything I told you to do wouldn't have affected the air guarding.

ArmorGon

#11
Quote from: Rajaa on July 03, 2012, 04:12:43 AM
Snip
Oh my apologies I didn't understand the question. This happens with the AI. Hopefully I am answering your question this time.

Rajaa Retired

Are you still having this problem? The AI going into the guard state in the air and staying there?

ArmorGon

Quote from: Rajaa on July 04, 2012, 04:38:23 PM
Are you still having this problem? The AI going into the guard state in the air and staying there?
Yes I still am.

Rajaa Retired


ArmorGon


[Statedef 132]
type    = A
physics = N

[State 132, 1]
type = ChangeAnim
trigger1 = Anim != 132
value = 132

[State 132, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 132, 3]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 132, 4]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 132, 5]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 132, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command = "holdback"
trigger1 = inguarddist
value = 130

[State 132, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52

[State 132, Stop Guarding]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140