The Mugen Fighters Guild
Help => M.U.G.E.N Development Help => Code Library => Topic started by: O Ilusionista on February 12, 2011, 06:19:20 pm
-
There is a way to detect if you are on a custom state.
(Updated to avoid conflit with some non-standard custom states)
If you use a helper (like Captain America's shield) on your char, you could use this:
[1000, bla bla bla]
Type = VarSet
trigger1 = Stateno !=[5000,5210] && Stateno != [130,152] && MoveType = H
v = XX
Value = XX
Then the helper check it this is true and goes to the ground. You can make it without the var:
[1000, bla bla bla]
Type = ChangeState
TriggerAll = IsHelper(XXXX); <--- your helper ID
trigger1 = Stateno !=[5000,5210] && Stateno != [130,152] && MoveType = H
Value = XX
The logic is simple:
If the root is on a Hit state, the helper drops itself to the ground.
5000-5210 are hit states, 130-152 are block states (which are hit states) and moves with custom states SHOULD PUT P2 ON A "H" Movetype state.
But if the creator is lazy (like doesn't setting the movetype to H on the custom state) it will fail.
-
Sometimes you won't though. You might use I, or if you want to be really smartass and actually have p2 throw some sort of attack that can backfire, A.
The reliable method is by using state -3 and state -2 at the same time, -3 is read before -2 and cannot read custom states.
State -3 sets a variable to stateno. State -2 checks that variable against stateno, if it's different, you're in a custom state.
-
Sometimes you won't though. You might use I, or if you want to be really smartass and actually have p2 throw some sort of attack that can backfire, A.
This has no sense to me. If the char was hit and it is on a custom state, it should be H. If there is a backfire attack, then you should make it go to another state, where the type is A.
-3 is read before -2
Are you sure? AFAIK, the order is -1,-2 and -3
-
-3 happens before -2, and -2 happens before -1.
Also, -2 doesn't happen during custom states.
-
Also, -2 doesn't happen during custom states.
Really? I heard the oposite during all those years.
-
Ah, yes.
It has been a while. -3 doesn't execute at custom states, but -3 executes before -2, which executes before -1, which executes before the current state.
Something that I have never checked, though, is what happens when you declare a state as -4, for instance, since mugen executes the states in an ascending order.
-
I think state -4 would be treated in the same way as state 1, it's read as if it's a normal state. Nothing special at all.
Custom state means nothing more than telling P2 to use a specific animation or even action. He does not need to be in a hitstate.
-
Ah, yes.
It has been a while. -3 doesn't execute at custom states, but -3 executes before -2, which executes before -1, which executes before the current state.
Something that I have never checked, though, is what happens when you declare a state as -4, for instance, since mugen executes the states in an ascending order.
Thanx for the info, bia.
He does not need to be in a hitstate.
For me, yes. Because to go on a custom state, he needed to be hitted.
-
That doesn't mean he needs to be in a hitstate afterwards. A more correct term there is Custom Hit State. If he is in a custom state you are simply managing him yourself rather than allowing mugen to do so. He does NOT need to be movetype = H and that's the point. It's not laziness it may occasionally be necessary giving your check the possibility to fail.
-
A more correct term there is Custom Hit State
Yes, that is what I mean.
-
-3 doesn't execute at custom states, but -3 executes before -2, which executes before -1, which executes before the current state.
[Statedef -3]
[State 2OS]
type=varset
trigger1=1
var(2)=gametime*2
ignorehitpause=1
persistent=1
[Statedef -2]
[State 2OS]
type=varset
trigger1=1
var(1)=(var(2)!=gametime*2)
ignorehitpause=1
persistent=1
[State 2OS]
type=displaytoclipboard
trigger1=1
text="Custom Stated = %d"
params=var(1)
ignorehitpause=1
persistent=1
-
Any other more concrete means to detect if you're in a custom state?
If only it weren't for that statetype loophole, this would've been perfect for something. Still useful though. :sugoi:
-
It doesn't get any more concrete than what I posted. It is absolutely fail proof.
Trust me.
-
Alrighty then, I'll take your word for it.
. . . But seriously though, nothing else other than this? ;P
-
Every other way has a flaw, let's just leave it at that.