Jump to content

Charge move spam control(for the AI & you)


Recommended Posts

I've noticed that the majority of mugen characters with charge moves lack a means of preventing the AI from spamming it relentlessly.

in the case of some, this can be a death sentence to whomever is at the receiving end of these moves. Nerfing these moves to pot is not an option, especially if you aren't able to spam them like the AI can.

one of the solutions that I've discovered is implementing a "Spam control" variable for charge moves, one for back charge & one for down charge.

for this explanation, I'll be using LowTierGod's Triggered Tackle for a back charge move. The process is the same for down charge moves, the only difference being the variable number used.

 

Here's the part of the state that's shown as an example

;========================<TRIGGERED TACKLE>=============================

[StateDef 1100]

type = S

physics = N

moveType = A

anim = 1100

ctrl = 0

velSet = 0,0

sprPriority = 1

powerAdd = 30

faceP2 = 1

 

[State 1100, Spam Control]<--------------take a look at this block, as it's one of the things needed for Charge spam control to work

type = varset

trigger1 = Animelem=1<-------------------The spam control variable is set the moment the character enters the first frame of this move's animation

var(27)= 35<------------------------------The value that var(27) will be set. You can use any unused variable number, just make sure that ALL blocks that will be using this variable are the same number

ignorehitpause=1

 

Now we add the following blocks to the cns-2 state. If the character doesn't have a cns or st file with cns-2, add it.

;--------------------------------------------------------------------------

[State -2, Spam Control BC]<------------This block acts a timer for spam control, which activates if the move that set the variable to a value above 0 is used.

type = varadd

trigger1 = var(27)>0

var(27)= -1<-----------------------------For every tick that var(27) has a value above zero, this block will reduce it by one. 1 second is 60 ticks.

ignorehitpause=1

 

[State -2, Spam Control BC]<-----------This block sets variable's value at 0 once the value reaches or exceeds below 0. Effectively ending the timer for the move's Spam control

type = varset

trigger1 = var(27)<=0

var(27)= 0

ignorehitpause=1

 

Lastly, we go to the cmd file. You'll need fighter factory in order do this step. NOTE: I will only be showing the triggerall parts of the move, as the Spam control will be placed in a triggerall line.

;-----------------------------------------------------------------------------

[State -1, Triggered Tackle]

type = ChangeState

value = 1100

triggerAll = AILevel && NumEnemy

triggerAll = RoundState = 2 && StateType != A

triggerAll = power < 1000 & var(27)=0<----------------------Whenever var(27) is at a value beyond 0, the AI cannot use this move.

 

You can also add the variable to the player's command block for the move as well, though it's usually not necessary.

;----------------------------------------------------------------------------

[State -1, Triggered Tackle]

type = ChangeState

value = 1100

triggerAll = !AILevel & var(27)=0<---------------------------Whenever var(27) is at a value beyond 0, the Player cannot use this move.

triggerAll = command = "ChariotTackle" & var(49) > 0

triggerAll = RoundState = 2 && StateType != A

triggerAll = power < 1000

trigger1 = ctrl || StateNo = 40 || StateNo = 52 || Stateno = 106

trigger2 = var(6)

Link to comment
Share on other sites

The sensible thing to do is adjust the charge buffer so that it increments whenever the character could feasibly be holding that direction and resets/decrements when they couldn't be.

 

Of course that requires the character to have a proper charge buffer in the first place, but they really should anyway since MUGEN's default charge handler is completely broken.

 

[State -2, Back Charge Increment]
type = VarAdd
trigger1 = command = "holdback"
trigger2 = !(stateno = 0 && ctrl && time > 0) && !(stateno = 40 && prevstateno = 0) && !(stateno = 100 && time <= 1) && AILevel > 0
trigger3 = !(stateno = 20 && command = "holdfwd") && !(stateno = 40 && sysvar(1) >= 0) && AILevel > 0
var(47) = 1
ignorehitpause = 1

[State -2, Back Charge Reset]
type = VarSet
trigger1 = command != "holdback" && AILevel <= 0
trigger2 = ((stateno = 0 && ctrl && time > 0) || (stateno = 40 && prevstateno = 0) || (stateno = 100 && time <= 1)) && AILevel > 0
trigger3 = ((stateno = 20 && command = "holdfwd") || (stateno = 40 && sysvar(1) >= 0)) && AILevel > 0
trigger4 = stateno = 1100 && var(47)>42 && AILevel > 0
var(47) = 0
ignorehitpause = 1

As seen here, the back charge buffer will not increment for the A.I. if:

  • The character is idle and has ctrl.
  • They're about to jump from idle.
  • They've just initiated a forward dash.
  • They're walking forward.
  • They're about to jump forward.

It also resets under those circumstances, as well as when they've successfully activated the move associated with the back charge. Naturally this form of buffer sets another variable once it has reached a certain value; other types may instead decrement the buffer under the same circumstances.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...