YesNoOk
avatar

Problems with AOAO's Testament (Read 391 times)

Started by Trinitronity, March 22, 2013, 02:44:15 pm
Share this topic:
Problems with AOAO's Testament
#1  March 22, 2013, 02:44:15 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
This happens everytime I try to perform a special:
Code:
Error message: State machine stuck in loop (stopped after 2500 loops): 4001 for Testament
Check your states for infinite ChangeState loops.
Ryouchi already said that he could be possibly WinMUGEN only, so the question is:
What could be possible reasons for causing such errors because of MUGEN 1.0? Thanks in advance!
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: Problems with AOAO's Testament
#2  March 22, 2013, 04:07:00 pm
  • *****
  • Mega Klinklang confirmed
    • USA
    • ricepigeon.webs.com
If its working fine in Winmugen but breaking in 1.0, then its not a problem with 1.0 its a problem with both the character and winmugen.

If I recall correctly, Winmugen has a bug in its parser where it will continue to process all state controllers in a state, even after processing a changestate controller. Found this out by accident when Kohaku was updating his characters to 1.0 and he asked me to test his Sanae.

As for the infinite loop, something in state 4001 is forcing it to go back to state 4001. Iirc, avoiding an infinite changestate required a few ticks in between. Most likely its a combination of the above issue regarding state processing thats causing the state to loop back to itself. I cant say at the moment whats causing the issue but my guess is what's happening can probably be illustrated with the following example:

Code:
[Statedef 4000]
....

[State 4001, Blah]
type = varset
...
var(X) = 4001

[State 4001, Blah]
type = Changestate
value = var(X)
Code:
[Statedef 4001]
...

[State 4001, CS]
type = changestate
value = var(X)

[State 4001, Blah]
type = varset
var(X) = 4002

Whats happening here is the following:

In WinMUGEN:

1.) Char enters state 4000
2.) Var(X) is set to 4001
3.) Changestate to var(X) is processed. Changestate to 4001 processed
4.) State 4000 finishes processing
5.) Char enters state 4001
6.) Changestate to var(X) is processed. Changestate to 4001 processed
7.) Var(X) is set to 4002
8.) State 4001 finishes processing
9.) Char enters state 4001 (second time)
10.) Changestate to var(X) is processed. Changestate to 4002 processed
11.) Var(X) is set to 4002
12.) State 4001 finished processing
13.) Char enters state 4002

In 1.0, however:

1.) Char enters state 4000
2.) Var(X) is set to 4001
3.) Changestate to var(X) is processed. Changestate to 4001 processed. State 4000 finishes processing
4.) Char enters state 4001
5.) Changestate to var(X) is processed. Changestate to 4001 processed. STATE 4001 FINISHES PROCESSING
6.) Char enters state 4001
7.) Changestate to var(X) is processed. Changestate to 4001 processed. STATE 4001 FINISHES PROCESSING
8.) Char enters state 4001
9.) Repeat steps 7-8 Ad Infinitum


As you can see, in Winmugen the variable setting occurs before the actual changestate occurs, but in 1.0 the state controller for setting var(X) never occurs.

Of course if you were evil enough to, you could take advantage of this flaw to do stuff like lock characters out of specific mugen versions by adding a lridiculously long pause that shouldnt be there and maybe even a large trollface explod that covers the screen, but nobody would do that, right? ;D

<<-- Updated 09/14/14

You limit yourself so badly when you try to avoid variables. When you get over your fear of the "complexity" of variables, you will find yourself in a better place: A beautiful world where coding is actually fun.
Last Edit: March 22, 2013, 04:29:31 pm by RicePigeon's Alternate Account
Re: Problems with AOAO's Testament
#3  March 22, 2013, 04:25:44 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
Okay, I have found out that AOAO's Testament has got serious flaws such as wrong pallette in the 5000 groups.
Also, here is the state in question:
Code:
; @@@@@@@@@@@@  @@@@@@Ža—³“‘OˆÚ“®
[Statedef 4001]
type    = A
movetype= I
physics = N
juggle  = 0
poweradd= 0
velset = 0,0
;anim = 4001
ctrl = 0

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[State 2, 6];“_–Å
type = PalFX
trigger1 = root,Palno = 8
trigger1 = Var(14) = 2
add = Var(13)-Var(12),Var(13)+Var(12),Var(13)*Var(12)
time = 2
[State 2,0];“_–Å—p
type = Varadd
trigger1 = root,Palno = 8
v = 14
value = 1
[State 2,1];“_–Å—p
type = VarSet
trigger1 = Var(14) = 3
v = 14
value = 0
[State 2, ga]
type = VarRandom
trigger1 = root,Palno = 8
ignorehitpause = 1
v = 13
range = -255,255
[State 2, ga]
type = VarRandom
trigger1 =root,Palno = 8
v = 12
range = -255,255
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

[State 7011, 10]
type = assertspecial
trigger1 = Time>=0
flag = noshadow
supermove = 1

[State 1000, 7]
type = Changeanim
trigger1 = ParentDist y <120
value = 4003

[State 1000, 7]
type = Changeanim
trigger1 = ParentDist y >120
value = 4004

[State 1000, 7]
type = Changeanim
trigger1 = ParentDist y =120
value = 4001

[State 1050, 1]
type = sprpriority
Trigger1 = Time >= 0
value = -2

[State 1050, 1]
type = Posadd
Trigger1 = ParentDist x > 50
Trigger1 = ParentDist x <= 120
x = 0.5

[State 1050, 1]
type = Posadd
Trigger1 = ParentDist x > 120
x = 2

[State 1050, 1]
type = Posadd
Trigger1 = ParentDist y < 120
y = -0.5

[State 1050, 1]
type = Posadd
Trigger1 = ParentDist y > 120
y = 0.5

[State 1000, 7];Ÿ‚¿•‰‚¯ŒãƒeƒŒƒ|[ƒg‚Ö
type = ChangeState
Trigger1 = Lose = 1
Trigger2 = Win  = 1
value = 4997
ctrl = 0

[State 1000, 7];ƒtƒ@ƒ“ƒgƒ€ƒ\ƒEƒ‹HITŒã‰ñ“]‚Ö
type = ChangeState
trigger1 = Root,Var(6) = 1
value = 4010
ctrl = 0

[State 1000, 7];ƒEƒHƒŒƒ“ƒgHITŒãƒeƒŒƒ|[ƒgŠJŽn‚Ö
type = ChangeState
trigger1 = Root,Var(7) = 1
value = 4020
ctrl = 0

[State 1000, 7];ƒiƒCƒgƒƒAƒT[ƒLƒ…ƒ‰[HITŒã‹Ê‚Ö
type = ChangeState
trigger1 = Root,Var(8) = 1
value = 4050
ctrl = 0

[State 1000, 7];—§‚¿‚Ö
type = ChangeState
trigger1 = ParentDist x = 50
trigger1 = ParentDist y =120
value = 4000
ctrl = 0

[State 1000, 7];Œã‚ëˆÚ“®‚Ö
type = ChangeState
trigger1 = ParentDist x <50
value = 4002
ctrl = 0
However, I haven't found something that would change State 4001 into State 4001 again... :S
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: Problems with AOAO's Testament
#4  March 22, 2013, 04:33:29 pm
  • *****
  • Mega Klinklang confirmed
    • USA
    • ricepigeon.webs.com
My guess is its probably looping back and forth between two different states (though I never seen this myself).

Try disabling each changestate one by one until you get it to work without it crashing mugen. The one you comment out most likely has suspect coding thats causing the issue.

<<-- Updated 09/14/14

You limit yourself so badly when you try to avoid variables. When you get over your fear of the "complexity" of variables, you will find yourself in a better place: A beautiful world where coding is actually fun.
Re: Problems with AOAO's Testament
#5  March 22, 2013, 05:01:36 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
You were right, though it was looping between a whooping 3 different states, all detemined by ParentDist.
The char works now after commenting out the changestates. Problem probably solved now.
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns