YesNoOk
avatar

KOF Supercancel with Max mode Power restrictions (CMD) (Read 418 times)

Started by luis2345, December 28, 2013, 02:03:22 pm
Share this topic:
KOF Supercancel with Max mode Power restrictions (CMD)
#1  December 28, 2013, 02:03:22 pm
  • **
I need help figuring this out.
This is a 1 Bar super and a supercancel uses 1 extra bar for it's use

The restrictions are as follows:

-Should have 2000 of power to supercancel while max mode is off
-Should have 1000 of power to supercancel while Max mode is on.
-Should have 1000 of power while it's not a supercancel while Max mode is off
-Should have 0 of power while it's not a supercancel while Max mode is on.

I tried with this (2 states of the same command) but for some reason i can't do the super unless max mode is activated but i can still do it while i supercancel it having 0 bars (while having max mode on)

[State -1]
type = ChangeState
value = 3000
triggerall = !var(59) ; AI variable
triggerall = var(55) ;  Max mode variable
triggerall = Command = "Super" && power >= ifelse((prevstateno=[1000,2000]),1000,0)  ; <---- This is the part where i need help
trigger1 = statetype != A && (ctrl || (stateno = 100 && time >= 5))

[State -1]
type = ChangeState
value = 3000
triggerall = !var(59) ; AI variable
triggerall = !var(55) ;  Max mode variable
triggerall = Command = "Super" && power >= ifelse((prevstateno=[1000,2000]),2000,1000)  ; <---- This is the other part where i need help
trigger1 = statetype != A && (ctrl || (stateno = 100 && time >= 5))





http://www.mugen-infantry.net/forum/index.php?topic=64575
By Matrimelee
Luis2345 Video thread
AI\'s : Cassandra,Fliz,Angel,Kung fu Man,Ai,Yuri,Adon
Re: KOF Supercancel with Max mode Power restrictions (CMD)
#2  December 29, 2013, 06:10:06 am
  • *
  • Thunder Frog
The first thing that leaps out at me is the use of prevstateno, which is probably why you can do 0 power super cancels while max mode is on. If you're in state, say, 1050 and then input the super command, prevstateno should return whatever state you were in before you entered 1050.

As for why you can't use it outside of max mode at all, I'm not sure. I don't see anything in particular that should prevent it from working. But, perhaps setting the power requirement up as a math formula that takes advantage of Mugen's boolean return values would work better?

Code:
triggerall = power >= 1000 + ((stateno = [1000,2000]) * 1000) - (var(55) * 1000)

That should give a base of 1000 power required to activate, an additional 1000 required if you're super-canceling, and will subtract 1000 power from the requirement if the max mode flag is turned on.  That should also remove the need to use a second state control to handle whether or not max mode is on.
Re: KOF Supercancel with Max mode Power restrictions (CMD)
#3  December 29, 2013, 07:25:08 am
  • ****
  • The Legend Will Never Die
    • Mexico
Assuming you have a way to detect if max mode is on:

triggerall = (power >= 1000) || var(x)  ;Where var(x) is your MAX mode variable.

Power subtraction should be handled in the first state of every super.

In the statedef definition,

poweradd = ifelse(var(51),0,-1000) ;Subtracts nothing if done in MAX mode, subtracts 1000 if done without.

After that you can code poweradd penalties separately, as an example:

[State 1000, VarAdd]
type = PowerAdd
triggerall = !time
triggerall = var(33) && !var(51)  ;KOF2002 system, max mode was off.
trigger1 = prevstateno = [1000,1999] ;Was a super cancel
value = -1000
persistent = 0
ignorehitpause = 1

It could all be simplified to single instance in the statedef definition, but in my case I felt it was cleaner to have them separate.
Twitter: @vans1belmont
1.1 AZRAEL #GDLK
amazon, pls
Re: KOF Supercancel with Max mode Power restrictions (CMD)
#4  December 29, 2013, 10:55:18 am
  • **
Assuming you have a way to detect if max mode is on:

triggerall = (power >= 1000) || var(x)  ;Where var(x) is your MAX mode variable.

Power subtraction should be handled in the first state of every super.

In the statedef definition,

poweradd = ifelse(var(51),0,-1000) ;Subtracts nothing if done in MAX mode, subtracts 1000 if done without.

After that you can code poweradd penalties separately, as an example:

[State 1000, VarAdd]
type = PowerAdd
triggerall = !time
triggerall = var(33) && !var(51)  ;KOF2002 system, max mode was off.
trigger1 = prevstateno = [1000,1999] ;Was a super cancel
value = -1000
persistent = 0
ignorehitpause = 1

It could all be simplified to single instance in the statedef definition, but in my case I felt it was cleaner to have them separate.


Yes , i do have a way to detect when max mode is on, in this case i use var(55)
The power subtraction code is already implemented in my character and it works fine (with supercancels and everything).
The only problem is "when" you are able to do it, i mean, i can do it when i am not supposed to do it.

The code you posted worked but i can still perform a supercancel while having not enough bars to do it (I have 0 bars while max mode is activated, that shouldn't allow me to perform the super because the super depletes the max mode bar while the supercancel depletes one extra bar)

I am not sure how it works in KOF 2002 UM but in the original KOF 2002 it's like that. (Just double checked with an emulator)
http://www.mugen-infantry.net/forum/index.php?topic=64575
By Matrimelee
Luis2345 Video thread
AI\'s : Cassandra,Fliz,Angel,Kung fu Man,Ai,Yuri,Adon
Re: KOF Supercancel with Max mode Power restrictions (CMD)
#5  December 29, 2013, 11:12:36 am
  • ****
  • The Legend Will Never Die
    • Mexico
Ah correct, my bad, I forgot to post one of the super cancel lines.

trigger11 = stateno = 1000 && movecontact && movetype = A
trigger11 = (power >= 2000 && var(33)) || (var(33) && var(51))

Holds two bars or holds one bar and max mode is active.
Twitter: @vans1belmont
1.1 AZRAEL #GDLK
amazon, pls
Re: KOF Supercancel with Max mode Power restrictions (CMD)
#6  December 29, 2013, 12:53:26 pm
  • **
Ah correct, my bad, I forgot to post one of the super cancel lines.

trigger11 = stateno = 1000 && movecontact && movetype = A
trigger11 = (power >= 2000 && var(33)) || (var(33) && var(51))

Holds two bars or holds one bar and max mode is active.

Thanks so much it's working percectly right now.

I have one last question to ask, how does it work in KOF2002 UM ?
I have seen your Iori and he can supercancel while being in max mode and having 0 bars.
http://www.mugen-infantry.net/forum/index.php?topic=64575
By Matrimelee
Luis2345 Video thread
AI\'s : Cassandra,Fliz,Angel,Kung fu Man,Ai,Yuri,Adon
Re: KOF Supercancel with Max mode Power restrictions (CMD)
#7  December 29, 2013, 03:59:25 pm
  • ****
  • The Legend Will Never Die
    • Mexico
Correct. The rules are different in KOF02UM.

- Raw supers cost 1 bar.
- DM cost 1 power bar or 1 max bar.
- SDM cost 1 power bar and 1 max bar.
- SDM have a penalty of 1 power bar for being used without max mode on. Which means they cost 3 bars raw (1 for power, 1 for max mode, 1 for penalty).
- Super cancels are free during MAX mode.
- MAX2 have the same power requirements as SDM with the additional restriction of needing less than a quarter of your life.

My system allows MAX2 outside of that last requirement with penalties.
Twitter: @vans1belmont
1.1 AZRAEL #GDLK
amazon, pls