YesNoOk
avatar

Custom Gethit States detect (Read 10902 times)

Started by O Ilusionista, February 12, 2011, 06:19:20 pm
Share this topic:
Custom Gethit States detect
#1  February 12, 2011, 06:19:20 pm
  • ******
  • The Old Dog
  • 14 years of MFG and counting :)
    • Brazil
    • www.brazilmugenteam.com
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
Re: Custom States detect
#2  February 12, 2011, 09:38:35 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
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.
Re: Custom States detect
#3  February 13, 2011, 07:21:02 pm
  • ******
  • The Old Dog
  • 14 years of MFG and counting :)
    • Brazil
    • www.brazilmugenteam.com
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
-3 is read before -2

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
    • Brazil
    • www.smeenet.org
-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.
Re: Custom States detect
#5  February 13, 2011, 09:03:48 pm
  • ******
  • The Old Dog
  • 14 years of MFG and counting :)
    • Brazil
    • www.brazilmugenteam.com
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
    • Brazil
    • www.smeenet.org
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.
Re: Custom States detect
#7  February 14, 2011, 06:33:10 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
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.
Re: Custom States detect
#8  February 14, 2011, 01:51:48 pm
  • ******
  • The Old Dog
  • 14 years of MFG and counting :)
    • Brazil
    • www.brazilmugenteam.com
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.
Re: Custom States detect
#9  February 15, 2011, 07:32:32 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
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.
Re: Custom States detect
#10  February 24, 2011, 03:37:57 am
  • ******
  • The Old Dog
  • 14 years of MFG and counting :)
    • Brazil
    • www.brazilmugenteam.com
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 ! ¡ ! ¡
    • Egypt
    • deuceovspadez.webs.com/
-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
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.  :sugoi:

2OS

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

Trust me.
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? ;P

2OS

Re: Custom States detect
#15  October 10, 2011, 04:37:00 am
  • ****
  • 608 Wannabe
  • Ich schicke dich zur HOELLE ! ¡ ! ¡
    • Egypt
    • deuceovspadez.webs.com/
Every other way has a flaw, let's just leave it at that.
Re: Custom Gethit States detect
#16  June 29, 2017, 10:19:10 pm
  • *****
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
An alternate way to detect a custom state is with this code:

Code:
[Statedef -2]
; ------- Custom State Check --------
[State -2, VarAdd] ;this increases every tick even while in custom state
type = VarAdd
trigger1 = 1
var(58) = 1

[Statedef -3]
[State -3, VarSet] ;custom state check reset
type = VarSet
trigger1 =  var(58)-var(59)!=0
var(59) = var(58)
ignorehitpause = 1

[State -3, VarSet] ;this won't increase during custom states
type = VarAdd
trigger1 = 1
var(59) = 1

With this code, you can create thresholds such as knowing how much time you've spent in a custom state. It's main use is for example if you want to trigger an effect that happens after 10 ticks of being put in a custom state:
trigger1 = var(58)-var(59)>=10

With 2OS method, you only know if you're in a custom state or not, but you can't detect how much time you've spent on it.
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!