# Custom Gethit States detect (Read 12131 times)

Started by O Ilusionista, February 12, 2011, 06:19:20 pm

#### O Ilusionista

##### Custom Gethit States detect
#1  February 12, 2011, 06:19:20 pm
• The Old Dog
• 15 years of MFG, geez...
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.
Last Edit: April 26, 2014, 05:09:20 pm by O Ilusionista

#### Cyanide

##### Re: Custom States detect
#2  February 12, 2011, 09:38:35 pm
• Legendary XIII
• I am the eye of the storm to come!
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.

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.

#### O Ilusionista

##### Re: Custom States detect
#3  February 13, 2011, 07:21:02 pm
• The Old Dog
• 15 years of MFG, geez...
Quote
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.

Quote

Are you sure? AFAIK, the order is -1,-2 and -3

#### Bea

##### Re: Custom States detect
#4  February 13, 2011, 08:57:41 pm
• MUGEN Grandma
-3 happens before -2, and -2 happens before -1.

Also, -2 doesn't happen during custom states.
Princess Adora: "My friend saw She-Ra take her dress off in the shower. She said she has an 8 pack. She said She-Ra is shredded."

SF2NES is dead. Long live SF2NES.

#### O Ilusionista

##### Re: Custom States detect
#5  February 13, 2011, 09:03:48 pm
• The Old Dog
• 15 years of MFG, geez...
Quote
Also, -2 doesn't happen during custom states.

Really? I heard the oposite during all those years.

#### Bea

##### Re: Custom States detect
#6  February 14, 2011, 12:20:15 am
• MUGEN Grandma
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.
Princess Adora: "My friend saw She-Ra take her dress off in the shower. She said she has an 8 pack. She said She-Ra is shredded."

SF2NES is dead. Long live SF2NES.

#### Cyanide

##### Re: Custom States detect
#7  February 14, 2011, 06:33:10 am
• Legendary XIII
• I am the eye of the storm to come!
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.

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.

#### O Ilusionista

##### Re: Custom States detect
#8  February 14, 2011, 01:51:48 pm
• The Old Dog
• 15 years of MFG, geez...
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.

Quote
He does not need to be in a hitstate.

For me, yes. Because to go on a custom state, he needed to be hitted.

#### Cyanide

##### Re: Custom States detect
#9  February 15, 2011, 07:32:32 am
• Legendary XIII
• I am the eye of the storm to come!
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.

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.

#### O Ilusionista

##### Re: Custom States detect
#10  February 24, 2011, 03:37:57 am
• The Old Dog
• 15 years of MFG, geez...
Quote
A more correct term there is Custom Hit State

Yes, that is what I mean.

#### 2OS

##### Re: Custom States detect
#11  October 07, 2011, 02:56:52 am
• 608 Wannabe
• Ich schicke dich zur HOELLE!! STIRB DU FEIGLING!!
-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
Last Edit: January 22, 2013, 10:21:19 pm by 2OS

#### Ichisennen

##### Re: Custom States detect
#12  October 07, 2011, 12:08:23 pm
• That guy who did that thing back then just because
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.

#### 2OS

##### Re: Custom States detect
#13  October 07, 2011, 04:48:38 pm
• 608 Wannabe
• Ich schicke dich zur HOELLE!! STIRB DU FEIGLING!!
It doesn't get any more concrete than what I posted. It is absolutely fail proof.

Trust me.

#### Ichisennen

##### Re: Custom States detect
#14  October 09, 2011, 01:19:49 pm
• That guy who did that thing back then just because
Alrighty then, I'll take your word for it.

. . . But seriously though, nothing else other than this?

#### 2OS

##### Re: Custom States detect
#15  October 10, 2011, 04:37:00 am
• 608 Wannabe
• Ich schicke dich zur HOELLE!! STIRB DU FEIGLING!!
Every other way has a flaw, let's just leave it at that.

#### XGargoyle

##### Re: Custom Gethit States detect
#16  June 29, 2017, 10:19:10 pm
• Hedgehog Whisperer
`[Statedef -2]; ------- Custom State Check --------[State -2, VarAdd] ;this increases every tick even while in custom statetype = VarAddtrigger1 = 1var(58) = 1[Statedef -3][State -3, VarSet] ;custom state check resettype = VarSettrigger1 =  var(58)-var(59)!=0var(59) = var(58)ignorehitpause = 1[State -3, VarSet] ;this won't increase during custom statestype = VarAddtrigger1 = 1var(59) = 1`