YesNoOk
avatar

Statedef -2 vs Statedef -3 (Read 603 times)

Started by DeathScythe, October 11, 2019, 12:04:19 am
Share this topic:
Statedef -2 vs Statedef -3
#1  October 11, 2019, 12:04:19 am
  • ***
    • deathscythemugen.neocities.org
Hey people. Not sure if this is the right section as is more of a discussion, but I have some doubts, and is about coding characters, so... I thought on posting it here.

I have a brief knowledge of how states -2 and -3 works, but I want to make sure that I'm using them correctly.
Basically, -2 are executed all the time and constantly, while -3 are executed when in a specific state of your choice, right? Examples:

If you want a certain explod to appear on some special moves (say, states 1000, 1100 and 1200), it would be better coded at -3, using triggerall = !NumExplod(x) and trigger1 = StateNo = 1000, trigger2 = StateNo = 1100, trigger3 = StateNo = 1200, instead of  coding it individually on these states.

Now if you want a pal fx, or an afterimage, anything like this that you want your character to use all the time, even when being hit or in custom states, these would be better coded at -2, using trigger1 = 1.

Are these correct? Am I missing something? Are there any better examples for the usage of these 2 states?
I'm asking because sometimes I don't know where would be better to use a specific code, as it could be done in any of the 2.
Re: Statedef -2 vs Statedef -3
#2  October 11, 2019, 12:19:41 am
  • ***
  • CPU Purple Heart
    • USA
    • www.dailymotion.com/2a8130871d2742d2f4da3b069
 The first thing that comes into mind is that custom states deny you from using statedef -3 since you're in P2's state now, therefore, you can only access statedef -2 since those don't care which state that you're in.

 So, if you want an explod to appear while you're in hitstun, don't use statedef -3 since there is a chance that the hitstate you may be in could be p2's custom state and the explod will never appear as a result.

 My main use for statedef -3 is to prevent any clutter in statedef -2 since my characters usually have enormous sections of coding in the latter, so, I can reduce that by putting them in statedef -3 to make my coding easier to read if they only occur in my own characters' states.
Re: Statedef -2 vs Statedef -3
#3  October 11, 2019, 09:50:41 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
This is in the docs but

Statedef -3 read first. Doesn't get read in custom states
Statedef -2 read second on every tick
Statedef -1 read third.
Normal states
Helper states

Note that helpers have no access to state -3 or -2 unless you stupidly use helpertype = player. They only get access to -1 if keyctrl = 1 when helpertype is normal.


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: Statedef -2 vs Statedef -3
#4  October 11, 2019, 10:52:52 am
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
Dude, no offence, but for a CotM winner I expected you would at least know the difference on -2 and -3 states and how/when to use them
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!
Re: Statedef -2 vs Statedef -3
#5  October 11, 2019, 11:12:39 am
  • ***
  • The Illusionary Wanderer
  • I have a dream
    • Vietnam

  • Online
Dude, no offence, but for a CotM winner I expected you would at least know the difference on -2 and -3 states and how/when to use them

No offence to anyone but for someone who has been here this long, you should have known that CoTM is just a popularity contest, not "who has the fanciest code" right? You probably want to lower your bar for CotM winners though as we have a lot of more questionable winners before.
Also, while this is in the docs, the question can't be searched easily on any search engines so it doesn't really hurt to have someone to ask it.
Re: Statedef -2 vs Statedef -3
#6  October 11, 2019, 11:49:19 pm
  • ***
    • deathscythemugen.neocities.org
Dude, no offence, but for a CotM winner I expected you would at least know the difference on -2 and -3 states and how/when to use them

No offence, but did you even read my post? I already know how it works, I'm just asking for more information about them, I've read the docs a hundred times, but there is no in depth information about them, there is just a plain explanation, someone with more experience could know a few more things that I don't know.

And I've seen CotM winners asking dumber questions, those that you can learn by reading KFM's codes. And? The CotM makes no difference to anyone.
Re: Statedef -2 vs Statedef -3
#7  October 12, 2019, 08:56:20 am
  • avatar
  • **
Dude, no offence, but for a CotM winner I expected you would at least know the difference on -2 and -3 states and how/when to use them

you have always been a butthurt individial, mr mugen beta

2OS

Re: Statedef -2 vs Statedef -3
#8  October 13, 2019, 01:01:29 am
  • ****
  • 608 Wannabe
  • Ich schicke dich zur HOELLE!! STIRB DU FEIGLING!!
    • Egypt
    • deuceovspadez.webs.com/
This is in the docs but

Statedef -3 read first. Doesn't get read in custom states
Statedef -2 read second on every tick
Statedef -1 read third.
Normal states
Helper states

Note that helpers have no access to state -3 or -2 unless you stupidly use helpertype = player. They only get access to -1 if keyctrl = 1 when helpertype is normal.

the only additional info outside of ^ this is that -1 is a required statedef. -2 and -3 are not required.


as an example if you wanted to break out of a custom state you would set a selfstate in -2. -1 and -3 will do nothing in this regard.


i personally didn't learn the differences between them through the docs and it took me quite some time to decipher them.
Re: Statedef -2 vs Statedef -3
#9  October 13, 2019, 11:03:18 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Thank you for that. I knew there was an extra reason for -1 but couldn't for the life of me remember what it was.


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: Statedef -2 vs Statedef -3
#10  October 14, 2019, 11:31:32 am
  • ***
    • deathscythemugen.neocities.org
Thanks everyone for the replies. If anyone wants to add more feel free to do so, any info will be welcome.