Jump to content

[CNS Introduction] State 170 - State 195


Ryon

Recommended Posts

THE FOLLOWING IS THE BASIC CNS CODING FROM KUNG FU MAN.

IF YOU ARE USING KUNG FU MAN AS A BASE FOR YOUR CHARACTERS THIS MAY PROVE USEFUL.

I WILL GET TO OTHER STATES LATER, DO NOT REQUEST ANYTHING. THIS IS STRICTLY FOR EDUCATIONAL PURPOSES.

PLEASE NOTE THE COLORED NOTES.

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

; Lose by Time Over

; CNS difficulty: basic

[statedef 170] ; By default state 170 is the Lose by Time Over state.

type = S ; This means the character is in a standing form. other options are C for crouch and A for air, however use only S for a win/lose state.

ctrl = 0 ; 1 = allows player to control character, 0 = can not control character. no other numbers.

anim = 170 ; animation 170 is assigned as the basic Lose by Time Over animation.

velset = 0,0 ; velset is set to 0,0 to prevent the character from moving during a loss.

[state 170, 1]

type = NotHitBy ; The NotHitBy coding is used so even if the player has a Blue CLSN box, he can not be hit by anything in the "value" setting of this sctrl.

trigger1 = 1 ; trigger1 means it is triggering at ALL times, infinitely.

value = SCA ; Value = Standing, Crouching,Air , this means the player will NOT get HIT BY (S)tanding, ©rouching, (A)ir attacks.

time = 1 ; How long the NotHitBy will last. sorta irrelevent since trigger is 1.

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

; Win state decider

; CNS difficulty: basic

[statedef 180]

type = S

;There is nothing else here because this state loads up the win pose, however if you have other changestate's with other triggers you can get different win poses more precisely.

[state 180, 1]

type = ChangeState ; This code will change the state from 180 to whatever is in the value below.

trigger1 = Time = 0 ; this will make the code work right away, its more effecient than using time = 1. cause its literally 1 tick faster. it does make a difference.

value = 181 ; This is the new state that the character is changing into.

;THIS IS A CODE I MADE UP FOR THE TUTORIAL.

[state 180, 1]

type = ChangeState

trigger1 = life = 1000 && P2life = 0 ; This will change to this win pose if the character gets a perfect on player 2. the double ampersand means AND so this trigger translate "Player 1 Life = 1000 AND Player 2 Life = 0" to go to perfect win pose.

value = 182 ;A made up winpose state where the character celebrates victory differently. because he wont a perfect.

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

; Win pose 1 - Bow

; CNS difficulty: basic

[statedef 181] ; This is just like above. You dont want someone hitting your character during a win pose. Its strange if they can get hit.

type = S

ctrl = 0

anim = 181

velset = 0,0

[state 181, 1]

type = NotHitBy

trigger1 = 1

value = SCA

time = 1

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

; Introduction

; CNS difficulty: basic

[statedef 191]

type = S

ctrl = 0

anim = 190

velset = 0,0

[state 191, 1] ;Freeze animation until PreIntro is over

type = ChangeAnim

trigger1 = RoundState = 0 ; CAN READ ABOUT THIS IN THE DOCS "trigger" FILE.

value = 190 ; Changes to animation 190 once the screen fades in.

[state 191, 2] ;Assert this until you want "round 1, fight" to begin

type = AssertSpecial ; there are various assertspecials, they range from simple things such as taking off the lifebars during a intro or super, stoping the music, not displaying the shadows, and various others. also in the doc's sctrl file.

trigger1 = 1 ; Like i mentioned before this means this sctrl is activated always as long as the character is in this state.

flag = Intro ; flag intro means that you are state THIS is the characters into and your telling mugen to WAIT until the intro is finished.

[state 191, 3] ;Change to stand state when done

type = ChangeState

trigger1 = AnimTime = 0 ; Animation Time = 0 is the same as saying when the animation is FINISHED playing. There are alternative codes but this is the most simpliest.

value = 0 ; Once the animation is complete you set the character to go to there stance animation which is ALWAYS 0. This also works as a marker to tell mugen that the INTRO (flag) is finished. so your Assertspecial finishes.

; You can delete the following two controllers if you're building your own

; character using KFM. These are the wood pieces that KFM kicks.

[state 191, Wood 1]

type = Explod ; Explod, another term used in mugen for special effects. Explods are not attacks, there not anything that can hurt anyone, there merely effects.

trigger1 = RoundState != 0 ; by having the ! exclaimation mark BEFORE the = sign is basically saying " Not Equal" so RoundState !=0 means, "To Appear when the round is not fading into the intro", or "To appear after the fading into the intro is over".

persistent = 0

anim = 191 ; This plays animation 191 from the characters SFF to show the animation.

postype = p1 ; This explod's positioning is based off player1 (p1)'s position, there is also p2, left, right, front back. More will be explained another time.

pos = 260, -90 ; This is the original start position of the wood, which is off screen.

velocity = -4.2, -7 ; these velocity codes here move the wood on screen in a angle.

accel = 0, .32 ; these accel code basically allow the explod to wane and curve so it appears as if the wood is falling or being thrown.

removetime = 48 ; after 48 in game ticks the wood will disappear.

[state 191, Wood 2]

type = Explod

trigger1 = AnimElemTime(7) = 1 ; This is a bit more advanced but its used to make a tiny bit of interaction between the 2. This would make another explod (wood breaking) when it hits KFM's foot. AnimElemTime(frame) = (tick on the frame) so for this to appear, KFM has to be on his 1st tick on the 7th frame of animation, Then it will appear.

anim = 192

postype = p1

pos = 60, -70

velocity = 2, -4

accel = 0, .32

removetime = 35

; You can delete the following two controllers if you're building your own

; character using KFM. These play back the sounds of the wood block being

; broken.

[state 191, Snd 1]

type = PlaySnd

trigger1 = AnimElem = 7 ; This sound will activate when KFM kicks the piece of wood, linked to the explod above.

value = F5,2 ; value is the sound, based on the sound file. using F will use the basic sound from the common.snd file. other wise you just enter the values from your characters SND file.

volume = -40 ; Volume 100 is default, 255 is max. -40? is.... lolwut?

[state 191, Snd 2] ; This state is just like the above one except more precise to what looks like another part of the wood breaking.

type = PlaySnd

trigger1 = AnimElemTime(7) = 3

value = F5,3

volume = -80

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

; Taunt

; CNS difficulty: easy

[statedef 195] ; Every character needs a taunt.

type = S

ctrl = 0

anim = 195

velset = 0,0

movetype = I ; movetype = I, the I stands for IDLE, in which the player is neither (A)ttacking, or Getting (H)it.

physics = S ; The physics tells mugen how to handle the character if there hit. This is usually the cause for a character walking in the air.

sprpriority = 2

[state 195, 1]

type = CtrlSet ; CtrlSet this code is used to give the player back control of the character after they have entered the state.

trigger1 = Time = 40 ; It looks like in this case after 40 in game ticks the player will have control agian.

value = 1 ; this works like a boolean. 1 = true (yes), 0 = false (no)

[state 195, 2]

type = ChangeState

trigger1 = AnimTime = 0

value = 0

ctrl = 1

Next up! Basic attacks!

[CNS Introduction] State 200 - State 640

Link to comment
Share on other sites

Thanks a bunch!Now I need to get accurate X,Y axis'.Ironic since I'm one of the top math students at my school...

Accurate X,Y axis? It is all depending on looking at how you position your sprites in the sprite section and the animation section. Use the offset viewer to help axis relocation a bit better =o

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...