STANDI NG ATTACKS

Example :Jon Talbain by MoxManiac

Moxmaniac´s Jon Talbain making a Standing Fierve

Ok,let's see how we define a standing move in the CMD and CNS files:

CMD FILE

;-------------------------------------------------------------------------- ;Hard Punch (standing - z) [State -1] type = ChangeState value = 221

triggerall = command = "z"

triggerall = command != "holddown"

trigger1 = statetype != A

trigger1 = ctrl

trigger2 = stateno = 200

trigger2 = movecontact = 1

trigger3 = stateno = 210

trigger3 = movecontact = 1

trigger4 = stateno = 230

trigger4 = movecontact = 1

trigger5 = stateno = 240

trigger5 = movecontact = 1

trigger6 = stateno = 400

trigger6 = movecontact = 1

trigger7 = stateno = 410

trigger7 = movecontact = 1

trigger8 = stateno = 430

trigger8 = movecontact = 1

trigger9 = stateno = 440

trigger9 = movecontact = 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 = 221

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

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

range 200-299 when defining standing attacks. . see Recommended Action Numbers Table

triggerall = command = "z"

This attack will activate when the player presses the "z" key, generally this key is used for Fierce Punch

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

trigger1 = statetype !=A

Here we check if the player is not in the air (statetype!=A) , we don't want the standing Fierce

Punch to activate if the player is crouching or jumping!

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 Fierce Punch will NOT activate, even if he presses the key nothing will happen.

The rest of the triggers (trigger2 and ahead) handle the ability to chain other normal moves into this one, to learn more about implementing chains in your character go here

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

;-------------------------------------------------------------------------- ;Hard Punch (DS3) [Statedef 221] type = S movetype = A

physics = S

juggle = 4

poweradd = 60

ctrl = 0

velset = 0,0,0

anim = 221

[State 221, 1]

type = HitDef

trigger1 = AnimElem = 3

attr = S, NA

animtype = Heavy

damage = 87

guardflag = MA

pausetime = 10,10

sparkxy = -10,-70

hitsound = S2,5

guardsound = S1,0

ground.type = Low

ground.slidetime = 12

ground.hittime = 23

ground.velocity = -5

air.velocity = -2.2,-3.2

[State 221, 3]

type = PlaySnd

trigger1 = animelem = 3

value = 1,2

[State 221, 5]

type = ChangeState

trigger1 = AnimTime = 0

value = 0

ctrl = 1

Let's take a closer look at the above code:

[Statedef 221]

type = S <-------Use "S" for standing moves

movetype = A

physics = S <----- same here

juggle = 4

poweradd = 60 <----60 units added to my super bar when I execute this move

ctrl = 0 <----remove "control",no pressing keys until this animation finishes!

velset = 0,0,0

anim = 221

We are using animation group no. 221 for this move, check it out:

Jon's animation number 221: Standing Fierce

[State 221, 1]

type = HitDef

trigger1 = AnimElem = 3

attr = S, NA

animtype = Heavy

damage = 87

guardflag = MA

pausetime = 10,10

sparkxy = -10,-70

hitsound = S2,5

guardsound = S1,0

ground.type = Low

ground.slidetime = 12

ground.hittime = 23

ground.velocity = -5

air.velocity = -2.2,-3.2

This is the part that tells the engine WHEN our move is gonna hit and HOW is gonna hit.

This move is going to hit on its third frame,hence the line:

trigger1 = AnimElem = 3

Jon's Animelem 3 , the frame that actually hits the opponent

-This is a Standing,Normal Attack (S,NA), this is not a throw , a super or crouching move, so we type:

attr = S, NA

-Because this is a Fierce or Hard Punch,we want the enemy to use the animation where he reels from receiving a Hard hit,so:

animtype = Heavy

-We take 87 points of life away if we hit the opponent with this move:

damage = 87

-The guardflag lets you define how the opponent can block this move,"M" means he can block it high or low,"A" means he can block while in the air.

guardflag = MA

-Amount of time that each player is freezed after performing/receiving the move. This is done in the form TimeforP1,TimeforP2.

pausetime = 10,10

-Position of the "hit spark" in the screen,the little explosion that appears when someone hits his opponent . The position is relative to your char, try some values to find which suits you best.

-

s parkxy = -10,-70

- Sounds to play if this move hit, or was blocked ("guarded")

hitsound = S2,5

guardsound = S1,0

-Standing moves can either look like they hit the opponent in the head or in the chest/stomach. Jon's Standing Fierce hits low in the stomach,so we choose "Low"

ground.type = Low

-These two parameters tell the engine (in game ticks) how long will the opponent be sliding back from receiving our attack (slidetime),and how long will he stay in a "getting hit" state, before recovering (hittime)

ground.slidetime = 12

ground.hittime = 23

-If we hit our opponent with this move,how far will he reel back? We define the velocity that that the opponent takes after receiving the hit, in the form (X,Y). We do this for ground and air.

ground.velocity = -5

air.velocity = -2.2,-3.2

[State 221, 3]

type = PlaySnd

trigger1 = animelem = 3

value = 1,2

We play the sound of this move,when the animation reaches its third frame.

[State 221, 5]

type = ChangeState

trigger1 = AnimTime = 0

value = 0

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 0,the standing state number. We also give control back to the player so he can make more moves (ctrl=1).

State 0 : Jon Talbain's Standing State

SUMMARY

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

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

trigger1 = statetype = S

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

[Statedef 400]

type = S

movetype = A

physics = S

.....

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

attr = S, NA

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

guardflag = MA

E) Put "Low" in the "ground.type" section of the Hitdef if the standing attack looks like it hit the stomach,use "High" if your attack aims to the head of the opponent

ground.type = Low

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

[State 220, 4]

type = ChangeState

trigger1 = AnimTime = 0

value = 0

ctrl = 1

back to Tutorial Index