YesNoOk
avatar

StateDef - 2 and StateDef - 3 (Read 8572 times)

Started by JustNoPoint, June 15, 2016, 03:03:39 pm
Share this topic:
StateDef - 2 and StateDef - 3
New #1  June 15, 2016, 03:03:39 pm
  • ******
    • www.justnopoint.com/
In the CNS file there are two special statedefs, Statedef -2, and Statedef -3.
Statedef -1 is in the CMD file.

Mugen constantly monitors these Statedefs without the character having to be in them.
 States that are always executed (use statedef -2)
 States that are executed when in self's state file (use statedef -3)

Electbyte's example,
Code:
[Statedef -3]
;This controller plays a sound everytime KFM lands from a jump, or
;from his back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = 40, 0
Would work best in Statedef -3 because if P2 throws you and uses stateno 106 the sound would play. Obviously this is something the other creator wouldnt want to happen.

DO NOT FORGET YOUR [Statedef -2] and [Statedef -3]
Be sure these are located before all -2 and -3 state coding.

Where do you place or find [Statedef -2] and [Statedef -3]?

They are a part of the CNS. Some authors will make a CNS file just for their -2 and -3
Others will place them at the bottom of one of their CNS files. When adding be sure the [Statedef -2] line is located below all other coding. Then place your -2 coding below it.

-3 is the same. Except you would place [Statedef -3] below all the -2 coding. If you need to find someone's -2 0r -3 just search their CNS for [Statedef -2] or [Statedef -3] and place the code you need under the appropriate statedef.

If you still cannot find -2 or -3 in a character and your character is in a full game you may wish to see if the -2/-3 is in the common1.cns inside the data folder before you add any -2/-3 yourself.
Last Edit: March 12, 2018, 09:36:08 am by Odb718
Re: StateDef - 2 and StateDef - 3
#2  June 15, 2016, 06:11:53 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
States -2 and -3 are always read from the character's folder. It's not possible to place them on mugen's common.cns and have all characters in a full game access to them.

Edit: It seems I was wrong on the above statement
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!
Last Edit: June 15, 2016, 11:04:46 pm by XGargoyle
Re: StateDef - 2 and StateDef - 3
#3  June 15, 2016, 06:15:49 pm
  • ******
    • www.justnopoint.com/
Corrected. I'd seen that as an answer to someone but didn't look into it.
Re: StateDef - 2 and StateDef - 3
#4  June 15, 2016, 10:49:21 pm
  • ******
    • www.justnopoint.com/
Update
http://mugenguild.com/forum/msg.2257549
Are you sure it's not just the -3 that can't be used outside of the character's folders?

Because this issue was solved by locating -2 in a common.cns outside of a character for a full game. The -3 was within the character files however.
Re: StateDef - 2 and StateDef - 3
#5  June 15, 2016, 11:04:14 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
Yeah, it seems that both -2 and -3 states will run perfectly in common1.cns, provided the characters don't have their own -2,-3 states, which will take priority over the common file.

For some reason, when I did these tests some years ago, I reached the conclusion that it was not possible to run negative states from common1.cns

In any case, their usefulness is greatly limited, because all characters in the full game will have the same negative states and it won't be possible to perform character-specific or unique coding
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!