CROUCHING ATTACKS

Now let's look at how to make crouching attacks,we will use Neogouki's NeoKyo as example:

Kyo doing a crouching Light Punch on Captain America

Let's see how we define a crouching move in the CMD and CNS files

CMD FILE

; Crouching light punch [State -1] type = ChangeState value = 400 triggerall = command = "x"

trigger1 = statetype = C

trigger1 = ctrl = 1

Now let's examine each line:

[State -1]

This line is always the same when you are defining a move in the CMD file.

type = ChangeState

We are changing the state of the player, from the state it is now to state ......

value = 400

....number 400. We will refer to this number when we wanna check if this attack hit the opponent or not

, etc... We chose 400 as the action number because it's recommended that you use numbers in the

range 400-499 when defining crouching attacks. Crouching Light Punches, or Low Jabs in the

Capcom notation,usually are given statenumber 400. see Recommended Action Numbers Table

triggerall = command =" x"

This attack will activate when the player presses the "x" key, generally this key is used for light punch

attacks. 'Triggerall' means that this condition must be true without exception. see more about triggers

trigger1 = statetype = C

Here we check if the player is indeed crouching (statetype=C) , we don't want the crouching Light

Punch to activate if the player is standing!

trigger1 = ctrl = 1

'Ctrl' is the trigger that checks if the player has 'control'. Player usually has control when he's not reeling from a hit, falling in the air ,making another move,etc. When the player is not in those situations, he can make moves,so we say that he has 'control'(ctrl=1) ,and that's what we check here: if he can't make moves the Light Punch will NOT activate, even if he presses the key nothing will happen.

Now let's look at the CNS part of this move:

; Crouching light punch [Statedef 400] <------------400 is the same number we used in the CMD file,check it here type = C We use the letter "C" in the type to indicate that this is a crouching move movetype = A physics = C We are using the crouching physics of the engine

anim = 400 We are gonna use group 400 from the Kyo SFF file. Check the animation frames of this group

poweradd = 50

velset = 0

ctrl = 0

[State 400, 1]

type = PlaySnd

trigger1 = Time = 0

value = 200,2

[State 400, 2]

type = PlaySnd

trigger1 = Time = 0

trigger1 = Random < 500

value = 200,1

[State 400, 3]

type = HitDef

trigger1 = AnimElem = 2 Kyo will hit his opponent when he is in frame 2 of this animation group

attr = C, NA We define this move as a Crouching,Normal Attack. (C,NA) This

is Normal because its not a Super or Special Move,and its an

Attack (C,NA), because this is not a throw or a fireball.

animtype = Light

damage = 15

guardflag = L By putting "L" in the guardflag, we indicate that the enemy

can only block this attack Low. If the

enemy blocks this attack while standing, he will get hit by it.

pausetime = 9,9

sparkno = 0,3

sparkxy = -10,-50

hitsound = S200,0

guardsound = S200,3

ground.type = Low We use "Low" in ground.type for moves that hit the opponent in

their midsection,like crouching moves.

ground.slidetime = 9

ground.hittime = 9

ground.velocity = -4

air.velocity = -1.2,-3

[State 400, 4]

type = ChangeState

trigger1 = AnimTime = 0

value = 11

ctrl = 1

We end this move definition by changing the player state back to the position he was before making the move,that is crouching.

We do this by using the ChangeState controller (type=ChangeState) and giving it the value 11,the crouching state number. We also give control back to the player so he can make more moves (ctrl=1).

State 11 : Kyo in Crouching State

SUMMARY

That's it. We defined a crouching attack. Always remember this when defining this type of attacks:

a) Always check in the CMD file if the player is crouching

trigger1 = statetype = C

b) Remember to put the letter C in the Type and Physics section of the Statedef

[Statedef 400]

type = C

movetype = A

physics = C

.....

C) In the "atrr" section of the Hitdef remember to put a C as the first letter

attr = C, NA

D) Put "L" in the "guardflag" section of the Hitdef,so that the enemy can block this low.

guardflag = L

E) Put "Low" in the "ground.type" section of the Hitdef.

ground.type = Low

F) Always remember to return your character to the crouching state (state 11) after the move ends.Like in this code:

[State 400, 4]

type = ChangeState

trigger1 = AnimTime = 0

value = 11

ctrl = 1

back to Tutorial Index