; Constants and state file. ; There are comments scattered through this file, so you may like to ; take a look if would like to learn more about the cns. [Data] life = 1000 ;Amount of life to start with attack = 100 ;attack power (more is stronger) defence = 100 ;defensive power (more is stronger) fall.defence_up = 50 ;Percentage to increase defense everytime player is knocked down liedown.time = 60 ;Time which player lies down for, before getting up airjuggle = 15 ;Number of points for juggling sparkno = 2 ;Default hit spark number for HitDefs guard.sparkno = 40 ;Default guard spark number KO.echo = 0 ;1 to enable echo on KO volume = 0 ;Volume offset (negative for softer) IntPersistIndex = 58 ;Variables with this index and above will not have their values FloatPersistIndex = 40 ;reset to 0 between rounds or matches. There are 60 int variables, ;indexed from 0 to 59, and 40 float variables, indexed from 0 to 39. ;If omitted, then it defaults to 60 and 40 for integer and float ;variables repectively, meaning that none are persistent, i.e. all ;are reset. If you want your variables to persist between matches, ;you need to override state 5900 from common1.cns. [Size] xscale = 1 ;Horizontal scaling factor. yscale = 1 ;Vertical scaling factor. ground.back = 15 ;Player width (back, ground) ground.front = 16 ;Player width (front, ground) air.back = 12 ;Player width (back, air) air.front = 12 ;Player width (front, air) height = 60 ;Height of player (for opponent to jump over) attack.dist = 160 ;Default attack distance proj.attack.dist = 90 ;Default attack distance for projectiles proj.doscale = 0 ;Set to 1 to scale projectiles too head.pos = -5, -90 ;Approximate position of head mid.pos = -5, -60 ;Approximate position of midsection shadowoffset = 0 ;Number of pixels to vertically offset the shadow draw.offset = 0,0 ;Player drawing offset in pixels (x, y) [Velocity] walk.fwd = 2.4 ;Walk forward walk.back = -2.2 ;Walk backward run.fwd = 4.6, 0 ;Run forward (x, y) run.back = -4.5,-3.8 ;Hop backward (x, y) jump.neu = 0,-8.4 ;Neutral jumping velocity (x, y) jump.back = -2.55 ;Jump back Speed (x, y) jump.fwd = 2.5 ;Jump forward Speed (x, y) runjump.back = -2.55,-8.1;Running jump speeds (opt) runjump.fwd = 4,-8.1 ;. airjump.neu = 0,-8.1 ;. airjump.back = -2.55 ;Air jump speeds (opt) airjump.fwd = 2.5 ;. [Movement] airjump.num = 1 ;Number of air jumps allowed (opt) airjump.height = 35 ;Minimum distance from ground before you can air jump (opt) yaccel = .44 ;Vertical acceleration stand.friction = .85 ;Friction coefficient when standing crouch.friction = .82 ;Friction coefficient when crouching ;--------------------------------------------------------------------------- ; Format: ; [Statedef STATENO] ; type = ? S/C/A/L stand/crouch/air/liedown ; movetype = ? I/A/H idle/attack/gethit ; physics = ? S/C/A/N stand/crouch/air/none ; juggle = ? air juggle points move requires ; ; [State STATENO, ?] ? - any number you choose ; type = ? ; ... ;--------------------------------------------------------------------------- ; Lose by Time Over ; CNS difficulty: basic [Statedef 170] type = S ctrl = 0 anim = 170 velset = 0,0 [State 170, 1] type = NotHitBy trigger1 = 1 value = SCA time = 1 ;--------------------------------------------------------------------------- ; Win state decider ; CNS difficulty: basic [Statedef 180] type = S [State 180, 1] type = ChangeState trigger1 = Time = 0 value = 181 ;--------------------------------------------------------------------------- ; Win pose 1 ; CNS difficulty: basic [Statedef 181] type = S ctrl = 0 anim = 180 velset = 0,0 [State 181, 1] type = NotHitBy trigger1 = 1 value = SCA time = 1 ;--------------------------------------------------------------------------- ; Introduction ; CNS difficulty: basic [Statedef 190] type = S ctrl = 0 anim = 190 velset = 0,0 [State 190, 1] ;Freeze animation until PreIntro is over type = ChangeAnim trigger1 = RoundState = 0 value = 190 [State 190, 2] ;Assert this until you want "round 1, fight" to begin type = AssertSpecial trigger1 = 1 flag = Intro [State 190, 4] ;Change to stand state type = ChangeState trigger1 = AnimTime = 0 value = 0 ;--------------------------------------------------------------------------- ; Taunt ; CNS difficulty: easy [Statedef 195] type = S ctrl = 0 anim = 195 velset = 0,0 movetype = I physics = S sprpriority = 2 [State 195, 2] type = ChangeState trigger1 = AnimTime = 0 value = 0 ctrl = 1 ;--------------------------------------------------------------------------- ; Standing Light Punch ; CNS difficulty: easy [Statedef 200] type = S ;State-type: S-stand, C-crouch, A-air, L-liedown movetype= A ;Move-type: A-attack, I-idle, H-gethit physics = S ;Physics: S-stand, C-crouch, A-air juggle = 1 ;Number of air juggle points move takes ;Commonly-used controllers: velset = 0,0 ;Set velocity (x,y) (Def: no change) ctrl = 0 ;Set ctrl (Def: no change) anim = 200 ;Change animation (Def: no change) poweradd = 20 ;Power to add (Def: 0) sprpriority = 2 ;Set layering priority to 2 (in front) [State 200, 1] type = HitDef trigger1 = Time = 0 attr = S, NA ;Attribute: Standing, Normal Attack damage = 23, 0 ;Damage that move inflicts, guard damage animtype = Light ;Animation type: Light, Medium, Heavy, Back (def: Light) guardflag = MA ;Flags on how move is to be guarded against hitflag = MAF ;Flags of conditions that move can hit priority = 3, Hit ;Attack priority: 0 (least) to 7 (most), 4 default ;Hit/Miss/Dodge type (Def: Hit) pausetime = 8, 8 ;Time attacker pauses, time opponent shakes sparkno = 0 ;Spark anim no (Def: set above) sparkxy = -10, -76 ;X-offset for the "hit spark" rel. to p2, ;Y-offset for the spark rel. to p1 hitsound = 5, 0 ;Sound to play on hit guardsound = 6, 0 ;Sound to play on guard ground.type = High ;Type: High, Low, Trip (def: Normal) ground.slidetime = 5 ;Time that the opponent slides back ground.hittime = 12 ;Time opponent is in hit state ground.velocity = -4 ;Velocity at which opponent is pushed airguard.velocity = -1.9,-.8 ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2)) air.type = High ;Type: High, Low, Trip (def: same as ground.type) air.velocity = -1.4,-3 ;X-velocity at which opponent is pushed, ;Y-velocity at which opponent is pushed air.hittime = 12 ;Time before opponent regains control in air [State 200, 5] type = ChangeState trigger1 = AnimTime = 0 value = 0 ctrl = 1 ;--------------------------------------------------------------------------- ; Standing Medium Punch ; CNS difficulty: easy [Statedef 210] type = S movetype= A physics = S juggle = 4 poweradd= 65 ctrl = 0 velset = 0,0 anim = 210 [State 210, 5] type = ChangeState trigger1 = AnimTime = 0 value = 0 ctrl = 1 ;--------------------------------------------------------------------------- ; Standing Strong Punch ; CNS difficulty: easy [Statedef 220] type = S movetype= A physics = S juggle = 4 poweradd= 65 ctrl = 0 velset = 0,0 anim = 220 [State 220, 5] type = ChangeState trigger1 = AnimTime = 0 value = 0 ctrl = 1 ;--------------------------------------------------------------------------- ; Standing Light Kick ; CNS difficulty: easy [Statedef 230] type = S movetype= A physics = S juggle = 4 poweradd= 22 ctrl = 0 velset = 0,0 anim = 230 [State 230, 5] type = ChangeState trigger1 = AnimTime = 0 value = 0 ctrl = 1 ;--------------------------------------------------------------------------- ; Standing Medium Kick ; CNS difficulty: easy [Statedef 240] type = S movetype= A physics = S juggle = 5 poweradd= 65 ctrl = 0 velset = 0,0 anim = 240 [State 240, 5] type = ChangeState trigger1 = AnimTime = 0 value = 0 ctrl = 1 ;--------------------------------------------------------------------------- ; Standing Strong Kick ; CNS difficulty: easy [Statedef 250] type = S movetype= A physics = S juggle = 5 poweradd= 65 ctrl = 0 velset = 0,0 anim = 250 [State 250, 5] type = ChangeState trigger1 = AnimTime = 0 value = 0 ctrl = 1 ;--------------------------------------------------------------------------- ; Crouching Light Punch ; CNS difficulty: easy ; Description: Simple crouching attack. The HitDef's guardflag parameter ; is set to "L", meaning that the move can only be guarded low ; (crouching), and not by standing or jumping opponents. ; Like for all light attacks, it's a good idea to keep the slidetime ; and hittime parameters at a smaller number, so the opponent isn't ; stunned for too long. For all crouching attacks you have to ; remember to set the attr parameter to indicate that it is crouching ; attack. In this case, "C, NA" stands for "crouching, normal attack". ; The HitDef's priority is set at 3, instead of the default of 4, ; so this attack has a lower priority than most others, meaning the ; player will get hit instead of trading hits with the opponent if ; their attack collision boxes (Clsn1) intersect each other's Clsn2 ; boxes at the same time. [Statedef 400] type = C movetype= A physics = C juggle = 5 poweradd= 15 ctrl = 0 anim = 400 [State 400, 5] type = ChangeState trigger1 = AnimTime = 0 value = 11 ctrl = 1 ;--------------------------------------------------------------------------- ; Crouching Medium Punch [Statedef 410] type = C movetype= A physics = C juggle = 6 poweradd= 50 ctrl = 0 anim = 410 [State 410, 5] type = ChangeState trigger1 = AnimTime = 0 value = 11 ctrl = 1 ;--------------------------------------------------------------------------- ; Crouching Strong Punch [Statedef 420] type = C movetype= A physics = C juggle = 6 poweradd= 50 ctrl = 0 anim = 420 [State 420, 5] type = ChangeState trigger1 = AnimTime = 0 value = 11 ctrl = 1 ;--------------------------------------------------------------------------- ; Crouching Light Kick ; CNS difficulty: easy [Statedef 430] type = C movetype= A physics = C juggle = 5 poweradd= 22 ctrl = 0 anim = 430 [State 430, 5] type = ChangeState trigger1 = AnimTime = 0 value = 11 ctrl = 1 ;--------------------------------------------------------------------------- ; Crouching Medium Kick ; CNS difficulty: easy [Statedef 440] type = C movetype= A physics = C juggle = 5 poweradd= 22 ctrl = 0 anim = 440 [State 440, 5] type = ChangeState trigger1 = AnimTime = 0 value = 11 ctrl = 1 ;--------------------------------------------------------------------------- ; Crouch Strong Kick ; CNS difficulty: easy ; Description: This move uses "Trip" for the "ground.type" parameter in ; its HitDef. It's a special type that puts the opponent in a tripped ; animation as he falls. Also, the hitflag parameter in the HitDef ; is set to "MAFD". The "D" indicates that a downed opponent can be ; hit by the attack. [Statedef 450] type = C movetype= A physics = C juggle = 7 poweradd= 70 ctrl = 0 anim = 450 [State 450, 5] type = ChangeState trigger1 = AnimTime = 0 value = 11 ctrl = 1 ;--------------------------------------------------------------------------- ; Jump Light Punch ; CNS difficulty: easy [Statedef 600] type = A movetype= A physics = A juggle = 2 poweradd= 11 ctrl = 0 anim = 600 [State 600, 5] type = CtrlSet trigger1 = Time = 20 value = 1 ;--------------------------------------------------------------------------- ; Jump Medium Punch ; CNS difficulty: easy [Statedef 610] type = A movetype= A physics = A juggle = 4 poweradd= 65 ctrl = 0 anim = 610 [State 610, 5] type = CtrlSet trigger1 = Time = 20 value = 1 ;--------------------------------------------------------------------------- ; Jump Strong Punch ; CNS difficulty: easy [Statedef 620] type = A movetype= A physics = A juggle = 4 poweradd= 70 ctrl = 0 anim = 620 [State 620, 5] type = CtrlSet trigger1 = Time = 20 value = 1 ;--------------------------------------------------------------------------- ; Jump Light Kick ; CNS difficulty: easy [Statedef 630] type = A movetype= A physics = A juggle = 3 poweradd= 20 ctrl = 0 anim = 630 [State 630, 5] type = CtrlSet trigger1 = Time = 20 value = 1 ;--------------------------------------------------------------------------- ; Jump Medium Kick ; CNS difficulty: easy [Statedef 640] type = A movetype= A physics = A juggle = 4 poweradd= 65 ctrl = 0 anim = 640 [State 640, 5] type = CtrlSet trigger1 = Time = 20 value = 1 ;--------------------------------------------------------------------------- ; Jump Strong Kick ; CNS difficulty: easy [Statedef 650] type = A movetype= A physics = A juggle = 4 poweradd= 70 ctrl = 0 anim = 650 [State 650, 5] type = CtrlSet trigger1 = Time = 20 value = 1 ;--------------------------------------------------------------------------- ; Throw - Attempt ; CNS difficulty: medium-advanced ; Description: Throws are not difficult to make, although then can be ; tedious at times. Throw attempt states have a HitDef of a ; special format. The key parameters in a throw are p1stateno ; and p2stateno. If the HitDef successfully connects, then ; the attacker will change to the state number specified by ; p1stateno, and the opponent will be change to the state ; number assigned to p2stateno. The special thing about p2stateno ; is that the opponent will be temporarily brought into the ; attacker's state file. In this case, no matter who the ; opponent is, he will be taken to state 820 of this file (kfm.cns) ; and remain here until the end of the throw (look at his debug ; information when he is being thrown; the text changes to yellow ; to mean that he is in another player's state file). [Statedef 800] type = S movetype= A physics = S juggle = 0 velset = 0,0 ctrl = 0 anim = 800 ; Notes: The '-' symbol in the hitflag field means that it only affects ; players who are not in a hit state. This prevents the player from combo-ing ; into the throw. The priority should be set to a low number, such as ; 1 or 2, so that the throw does not take precedence over normal attacks. ; The type of priority must always be set to "Miss" or "Dodge" for throws, ; otherwise strange behavior can result. [State 800, 1] type = HitDef Trigger1 = Time = 0 attr = S, NT ;Attributes: Standing, Normal Throw hitflag = M- ;Affect only ground people who are not being hit priority = 1, Miss ;Throw has low priority, must be miss or dodge type. sparkno = -1 ;No spark sprpriority = 1 ;Draw in front of p2 p1facing = ifelse (command = "holdfwd", -1, 1) ;Turn if holding forwards p2facing = 1 ;Force p2 to face player p1stateno = 810 ;On success, player changes to state 810 p2stateno = 820 ;If hit, p2 changes to state 820 in player's cns fall = 1 ;Force p2 into falling down [State 800, 2] type = ChangeState Trigger1 = AnimTime = 0 value = 0 ctrl = 1 ;--------------------------------------------------------------------------- ; Throwing the opponent ; Description: In this state, the player throws the opponent by binding him to ; various offsets based on his current frame of animation. For ; example, [State 810, Bind 1] binds the opponent to an offset of ; 28 pixels in front of the player. That puts him around where the hand ; is at. Is is important to keep the opponent bound using a ; TargetBind controller at all times, until you let him go. This ; is especially important if your player has a Clsn2 box that ; allows him to get hit while throwing someone. Each time a player ; gets hit, all his bound targets will be set to a fall state. If ; the opponent is not bound, then he might get stuck in his thrown ; state when his attacker is knocked out of the throw halfway. ; Notes: There is a TargetLifeAdd controller to decrease the opponent's ; life, and a TargetState controller to change his state to a ; falling state when KFM lets go of him. [Statedef 810] type = S movetype= A physics = N anim = 810 poweradd = 60 [State 810, Bind 1] type = TargetBind trigger1 = AnimElemTime(2) < 0 pos = 28, 0 [State 810, Width 2-11] type = Width trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(12) < 0 edge = 60,0 [State 810, Bind 2-4] type = TargetBind trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(5) < 0 pos = 58, 0 [State 810, Bind 5] type = TargetBind trigger1 = AnimElemTime(5) >= 0 && AnimElemTime(6) < 0 pos = 47, 0 [State 810, Bind 6] type = TargetBind trigger1 = AnimElemTime(6) >= 0 && AnimElemTime(7) < 0 pos = 41, -60 [State 810, Bind 7] type = TargetBind trigger1 = AnimElemTime(7) >= 0 && AnimElemTime(8) < 0 pos = 25, -75 [State 810, Bind 8] type = TargetBind trigger1 = AnimElemTime(8) >= 0 && AnimElemTime(9) < 0 pos = 15, -90 [State 810, Bind 9] type = TargetBind trigger1 = AnimElemTime(9) >= 0 && AnimElemTime(10) < 0 pos = -5, -96 [State 810, Bind 10] type = TargetBind trigger1 = AnimElemTime(10) >= 0 && AnimElemTime(11) < 0 pos = -14, -90 [State 810, Bind 11] type = TargetBind trigger1 = AnimElem = 11 pos = -50, -50 [State 810, Hurt 11] type = TargetLifeAdd trigger1 = AnimElem = 11 value = -78 [State 810, Throw 11] type = TargetState trigger1 = AnimElem = 11 value = 821 [State 810, Turn 12] type = Turn trigger1 = AnimElem = 12 [State 810, Pos 15] type = PosAdd trigger1 = AnimElem = 15 x = -10 [State 810, State End] type = ChangeState trigger1 = AnimTime = 0 value = 0 ctrl = 1 ;--------------------------------------------------------------------------- ; Opponent Thrown ; (a custom gethit state) ; Description: This is the state that the opponent changes to after being ; hit by the throw HitDef. The important thing here is to use a ; ChangeAnim2 controller. The difference between ChangeAnim2 and ; ChangeAnim is that ChangeAnim2 changes the player's animation to ; an action in the AIR file of the attacker (in this case, kfm.air), ; whereas ChangeAnim always changes the player to an action in his ; own AIR file. Look at Action 820 in kfm.air for some extra ; comments. [Statedef 820] type = A movetype= H physics = N velset = 0,0 [State 820, 1] type = ChangeAnim2 Trigger1 = Time = 0 value = 820 ;--------------------------------------------------------------------------- ; Opponent thrown into the air ; (a custom gethit state) ; Description: This state has the opponent flying through the air and ; falling down onto the ground. The SelfState controller sets the ; opponent back using to his own state file when he his the ground. ; Controllers 821,2 and 821,3 allow the opponent to recover by ; hitting his recovery command when he is falling. [Statedef 821] type = A movetype= H physics = N velset = 2.8,-7 poweradd = 40 [State 821, 1] ;Gravity type = VelAdd Trigger1 = 1 y = .4 [State 821, 2] ; Recover near ground (use ChangeState) type = ChangeState triggerall = Vel Y > 0 triggerall = Pos Y >= -20 triggerall = alive triggerall = CanRecover trigger1 = Command = "recovery" value = 5200 ;HITFALL_RECOVER [State 821, 3] ; Recover in mid air (use SelfState) type = SelfState triggerall = Vel Y > 0 triggerall = alive triggerall = CanRecover trigger1 = Command = "recovery" value = 5210 ;HITFALL_AIRRECOVER [State 821, 4] ;Hit ground type = SelfState trigger1 = Vel Y > 0 trigger1 = Pos Y >= 0 value = 5100 ;Hit ground ;================================================================================== ;======| RELACIONADO À AI - AI RELATED |=========================================== ;================================================================================== ; (Credit to ANMC, Bagaliao, and FlowaGirl for the basic helper method concept.) ; ;------------------ ; AI Activation Helper State - Primary Version ; (Credit to YongMing for the basic HitPause bugfix concept.) ; ; var(1) - First tick button activation prevention. ; var(2) - Used for pause/superpause and custom state check, basically. ; var(3) - (Super/)Pause & custom state-triggered dir detection disabler. ; var(4) - Persistent direction command detection enabler (due to 2002.04.14). ; var(9) - AutoTurn bug fixer. ; parent's var(57) - Parent's GameTime var, for pause and custom state check. ; parent's var(59) - Parent's primary AI variable. ; ; The code in this state is mostly simply copy/pasteable. ; But if you're using different indices for the parent's variables, ; or if you change your character's basic commands' names, you'll ; of course need to change the code in this state accordingly. [StateDef 9741] type = S movetype = I physics = N anim = 9741 ctrl = 0 [State 9741, Safety]; Just in case your opponent is very poorly coded. type = SelfState trigger1 = !IsHelper value = 0 [State 9741, PauseCheck] type = VarSet trigger1 = (GameTime>(Parent,var(57))) trigger2 = !(Parent,Alive) trigger3 = (RoundState != 2) trigger4 = Parent,var(59) trigger5 = (var(3):=0) var(2) = (var(3):=1)+(var(4):=0) [State 9741, Facing] type = Turn trigger1 = (var(9):=(Facing != Parent,Facing)) [State 9741, DirTurnOnAI] type = ParentVarSet triggerall = !var(3) triggerall = !var(9) trigger1 = (Parent,command = "holdfwd") trigger2 = (Parent,command = "holdback") trigger3 = (Parent,command = "holdup") trigger4 = (Parent,command = "holddown") trigger5 = !(var(4):=1) var(59) = var(4) [State 9741, DirTurnOffAI] type = ParentVarSet triggerall = !var(3) triggerall = Parent,var(59) trigger1 = (command = "holdfwd") trigger1 = (Parent,command = "holdfwd") trigger2 = (command = "holdback") trigger2 = (Parent,command = "holdback") trigger3 = (command = "holdup") trigger3 = (Parent,command = "holdup") trigger4 = (command = "holddown") trigger4 = (Parent,command = "holddown") var(59) = (var(4):=0) [State 9741, ButtonTurnOnAI] type = ParentVarSet triggerall = var(1) triggerall = !var(2) trigger1 = (Parent,command = "a") trigger2 = (Parent,command = "b") trigger3 = (Parent,command = "c") trigger4 = (Parent,command = "x") trigger5 = (Parent,command = "y") trigger6 = (Parent,command = "z") trigger7 = (Parent,command = "start") var(59) = 1 [State 9741, ButtonTurnOffAI] type = ParentVarSet triggerall = !var(2) trigger1 = (command = "a") trigger1 = (Parent,command = "a") trigger2 = (command = "b") trigger2 = (Parent,command = "b") trigger3 = (command = "c") trigger3 = (Parent,command = "c") trigger4 = (command = "x") trigger4 = (Parent,command = "x") trigger5 = (command = "y") trigger5 = (Parent,command = "y") trigger6 = (command = "z") trigger6 = (Parent,command = "z") trigger7 = (command = "start") trigger7 = (Parent,command = "start") var(59) = -1 [State 9741, UnPauseCheck] type = VarSet triggerall = var(2) trigger1 = (Parent,command = "a") trigger2 = (Parent,command = "b") trigger3 = (Parent,command = "c") trigger4 = (Parent,command = "x") trigger5 = (Parent,command = "y") trigger6 = (Parent,command = "z") trigger7 = (Parent,command = "start") trigger8 = (var(2) = 2) trigger8 = (var(2):=0) var(2) = 2 [State 9741, Goodbye] type = DestroySelf triggerall = (var(1):=1) trigger1 = Parent,var(59) trigger2 = !(Parent,Alive) trigger3 = (RoundState != 2) ;------------------ ; AI Activation Helper State - Compatibly Partnered Version ; ; var(1) - First tick dir activation prevention ; var(2) - Used for pause/superpause and custom state check, basically. ; var(3) - (Super/)Pause & custom state-triggered dir detection disabler. ; var(4) - Hitpause check. ; var(5) - No button on previous tick. ; var(6) - Any dir on this tick. ; var(7) - Any button on this tick. ; var(8) - Matching partner button detected. ; var(9) - AutoTurn bug fixer. ; parent's var(57) - Parent's GameTime var, for pause and custom state check. ; parent's var(59) - Parent's primary AI variable. ; ; The code in this state is mostly simply copy/pasteable. ; But if you're using different indices for the parent's variables, ; or if you change your character's basic commands' names, you'll ; of course need to change the code in this state accordingly. [StateDef 9742] type = S movetype = I physics = N anim = 9741 ctrl = 0 [State 9742, Safety]; Just in case your opponent is very poorly coded. type = SelfState trigger1 = !IsHelper value = 0 [State 9742, PauseCheck] type = VarSet trigger1 = (GameTime>Parent,var(57)) trigger2 = !(Parent,Alive) trigger3 = (RoundState != 2) trigger4 = Parent,var(59) trigger5 = (var(3):=0) var(2) = (var(3):=1) [State 9742, Facing] type = Turn trigger1 = (var(9):=(Facing != Parent,Facing)) [State 9742, ParentDirCheck] type = VarSet trigger1 = (Parent,command = "holdfwd") trigger2 = (Parent,command = "holdback") trigger3 = (Parent,command = "holdup") trigger4 = (Parent,command = "holddown") trigger5 = (var(6):=0) var(6) = 1 [State 9742, ParentButtonCheck] type = VarSet trigger1 = (Parent,command = "a") trigger2 = (Parent,command = "b") trigger3 = (Parent,command = "c") trigger4 = (Parent,command = "x") trigger5 = (Parent,command = "y") trigger6 = (Parent,command = "z") trigger7 = (Parent,command = "start") trigger8 = (var(7):=0) var(7) = 1 [State 9742, SameButtonCheck] type = VarSet triggerall = var(7) triggerall = !var(2) triggerall = NumPartner trigger1 = (Parent,command = "a") trigger1 = (Partner,command = "a") trigger2 = (Parent,command = "b") trigger2 = (Partner,command = "b") trigger3 = (Parent,command = "c") trigger3 = (Partner,command = "c") trigger4 = (Parent,command = "x") trigger4 = (Partner,command = "x") trigger5 = (Parent,command = "y") trigger5 = (Partner,command = "y") trigger6 = (Parent,command = "z") trigger6 = (Partner,command = "z") trigger7 = (Parent,command = "start") trigger7 = (Partner,command = "start") trigger8 = (var(8):=0) var(8) = 1 [State 9742, DirTurnOnAI] type = ParentVarSet trigger1 = var(1) trigger1 = var(6) trigger1 = !var(3) trigger1 = !var(4) trigger1 = !var(9) var(59) = 1 [State 9742, DirTurnOffAI] type = ParentVarSet triggerall = var(6) triggerall = !var(3) triggerall = Parent,var(59) trigger1 = (command = "holdfwd") trigger1 = (Parent,command = "holdfwd") trigger2 = (command = "holdback") trigger2 = (Parent,command = "holdback") trigger3 = (command = "holdup") trigger3 = (Parent,command = "holdup") trigger4 = (command = "holddown") trigger4 = (Parent,command = "holddown") var(59) = 0 [State 9742, ButtonTurnOnAI] type = ParentVarSet trigger1 = var(5) trigger1 = var(7) trigger1 = !var(2) trigger1 = !var(8) var(59) = 1 [State 9742, ButtonTurnOffAI] type = ParentVarSet triggerall = var(7) triggerall = !var(2) triggerall = !var(8) trigger1 = (command = "a") trigger1 = (Parent,command = "a") trigger2 = (command = "b") trigger2 = (Parent,command = "b") trigger3 = (command = "c") trigger3 = (Parent,command = "c") trigger4 = (command = "x") trigger4 = (Parent,command = "x") trigger5 = (command = "y") trigger5 = (Parent,command = "y") trigger6 = (command = "z") trigger6 = (Parent,command = "z") trigger7 = (command = "start") trigger7 = (Parent,command = "start") var(59) = -1 [State 9742, UnPauseCheck] type = VarSet triggerall = var(2) triggerall = !var(4) trigger1 = var(7) trigger2 = (var(2) = 2) trigger2 = (var(2):=0) var(2) = 2 [State 9742, Goodbye] type = DestroySelf trigger1 = Parent,var(59) trigger2 = !(Parent,Alive) trigger3 = (RoundState != 2) [State 9742, HitPauseCheck] type = VarSet trigger1 = var(6) trigger2 = var(7) trigger3 = !(Parent,HitPauseTime) var(4) = Parent,HitPauseTime [State 9742, Delay] type = VarSet trigger1 = (var(1):=1) var(5) = !var(7) ;------------------ ; XOR Method's HitPauseTime Helper State [StateDef 9743] type = S movetype = I physics = N anim = 9741 ctrl = 0 [State 9743, Safety]; Just in case your opponent is very poorly coded. type = SelfState trigger1 = !IsHelper value = 0 [State 9743, HitPauseTime] type = VarSet trigger1 = !(Parent,HitPauseTime) trigger2 = (GameTime>Parent,var(57)) var(1) = Parent,HitPauseTime [State 9742, Goodbye] type = DestroySelf trigger1 = (Parent,var(59) = 1) trigger2 = !(Parent,Alive) trigger3 = (RoundState != 2) ;================================================================================== ;================================================================================== ;================================================================================== ;--------------------------------------------------------------------------- ; Override common states (use same number to override) : ;--------------------------------------------------------------------------- ;--------------------------------------------------------------------------- ; States that are always executed (use statedef -2) ;--------------------------------------------------------------------------- [StateDef -2] ;================================================================================== ;======| RELACIONADO À AI - AI RELATED |=========================================== ;================================================================================== ; Within StateDef -2, none of your own AI-related code should be placed ; above these next two controllers. [State -2, StopAI] type = VarSet triggerall = (var(59) > 0) trigger1 = (RoundState != 2) trigger2 = !Alive var(59) = -2 IgnoreHitPause = 1 ; This controller is optional. It allows you treat the AI flag as a boolean ; value rather than an integer value, letting you trigger your AI directives ; with "var(0)" instead of "var(59)>0", and letting you make moves usable only ; by humans by using "!var(0)" instead of "var(59)<1", thus slightly improving ; the size and efficiency of your code. ; Another benefit is that it makes it much easier for users to disable your AI, ; if they so choose. [State -2, Simplifier] type = VarSet trigger1 = (var(59) = 1) trigger2 = (var(0):=0) var(0) = 1 ; Another option is to replace 1 with something like MatchNo, if ; you want to design your AI to have varying levels of difficulty. IgnoreHitPause = 1 ;================================================================================== ;================================================================================== ;================================================================================== ;--------------------------------------------------------------------------- ; States that are executed when in self's state file (use statedef -3) ;--------------------------------------------------------------------------- [Statedef -3] ;================================================================================== ;======| RELACIONADO À AI - AI RELATED |=========================================== ;================================================================================== ; Kamek and Luchini appear to have been the first ones to use the IsHomeTeam AI activation concept. ; Feel free to move this controller to your character's intro state for slightly better efficiency. [State -3, SetAI] type = VarSet triggerall = !RoundState triggerall = IsHomeTeam trigger1 = (TeamSide = 2) trigger2 = (MatchNo > 1) var(59) = 1 ; Feel free to move this controller to your character's intro state for slightly better efficiency. ; Note that it may give P2 a slight unfair advantage in simul team vs mode, so you ; may want to disable it. But then, since when has Mugen been about fairness? =P [State -3, Unfair]; Is this reliable? type = VarSet trigger1 = !RoundState trigger1 = (var(59) != 1) trigger1 = NumPartner trigger1 = (ID > Partner,ID) trigger1 = (TeamSide = 2) var(59) = 1 [State -3, AI Helper (Compatibly Partnered Version)] type = Helper trigger1 = !var(59) trigger1 = !NumHelper(9742) trigger1 = (RoundState = 2) trigger1 = Alive trigger1 = NumPartner trigger1 = Partner,SelfAnimExist(9741) HelperType = normal name = "AI Helper (Simul Version)" ID = 9742 pos = 9999999,99999 StateNo = 9742 KeyCtrl = 1 PauseMoveTime = 999999999 SuperMoveTime = 999999999 ; If you want to use the Guard mode, Dummy mode, Distance, or Button jam dummy control ; options in Training mode without activating the dummy's AI while working on your ; character, then all you need to do is temporarily disable this controller. ; Or, if you want to permanently disable this controller in Training mode, ; then you could use the Training mode detection code available on my site ; ( http://www.shinmugen.net/winane/ ), and then just add a "(var(59)&63)>30" ; triggerall to this controller. [State -3, AI Helper] type = Helper triggerall = !var(59) triggerall = !NumHelper(9741) triggerall = (RoundState = 2) triggerall = Alive trigger1 = !NumPartner trigger2 = !(Partner,SelfAnimExist(9741)) HelperType = normal name = "AI Helper" ID = 9741 pos = 9999999,99999 StateNo = 9741 KeyCtrl = 1 PauseMoveTime = 999999999 SuperMoveTime = 999999999 [State -3, TurnBackOnAI] type = VarSet trigger1 = (var(59) = -2) trigger1 = (RoundState = 2) trigger1 = Alive var(59) = 1 [State -3, HitPauseTime Helper] type = Helper triggerall = var(59)!=1 triggerall = !NumHelper(9743) triggerall = (RoundState = 2) triggerall = Alive trigger1 = (MatchNo = 1) trigger2 = NumPartner trigger2 = (ID > Partner,ID) HelperType = normal name = "HitPauseTime" ID = 9743 pos = 9999999,99999 StateNo = 9743 PauseMoveTime = 999999999 SuperMoveTime = 999999999 ; According to Roque, this method works in Linux Mugen version 2002.04.14, ; whereas the old humanly-impossible commands method does not. ; It is very important that this controller NOT be moved to State -2. ; Note that this part won't work if AI.Cheat is turned off in mugen.cfg. [State -3, XOR] type = VarSet triggerall = var(59)!=1 triggerall = (var(57) = GameTime-1) triggerall = NumHelper(9743) triggerall = !(Helper(9743),var(1)) trigger1 = (command = "a") ^^ (command = "a2") trigger2 = (command = "b") ^^ (command = "b2") trigger3 = (command = "c") ^^ (command = "c2") trigger4 = (command = "x") ^^ (command = "x2") trigger5 = (command = "y") ^^ (command = "y2") trigger6 = (command = "z") ^^ (command = "z2") trigger7 = (command = "start") ^^ (command = "start2") trigger8 = (command = "holda") ^^ (command = "holda2") trigger9 = (command = "holdb") ^^ (command = "holdb2") trigger10 = (command = "holdc") ^^ (command = "holdc2") trigger11 = (command = "holdx") ^^ (command = "holdx2") trigger12 = (command = "holdy") ^^ (command = "holdy2") trigger13 = (command = "holdz") ^^ (command = "holdz2") trigger14 = (command = "holdstart") ^^ (command = "holdstart2") trigger15 = (command = "holdfwd") ^^ (command = "holdfwd2") trigger16 = (command = "holdback") ^^ (command = "holdback2") trigger17 = (command = "holdup") ^^ (command = "holdup2") trigger18 = (command = "holddown") ^^ (command = "holddown2") trigger19 = (command = "recovery") ^^ (command = "recovery2") ;Add more as desired. (See my notes in the CMD.) var(59) = 1 ; It is very important that this controller NOT be moved to State -2, as putting ; it there would defeat the entire purpose of the controller, allowing the ; helper method or the XOR method to erroneously set the AI variable. ; And within State -3, don't put any ChangeState controllers before this ; controller, lest you unnecessarily delay your character's AI activation. [State -3, GameTimeVar] type = VarSet trigger1 = 1 var(57) = GameTime IgnoreHitPause = 1 ; Within StateDef -3, none of your own AI-related code should come after the code ; provided here (and putting it before the code is also generally a bad idea). ; It's better to use State -1 (or, in special circumstances, State -2) instead. ;================================================================================== ;================================================================================== ;================================================================================== ;This controller plays a sound everytime the player lands from a jump, or ;from a back-dash. [State -3, Landing Sound] type = PlaySnd triggerall = Time = 1 trigger1 = stateno = 52 ;Jump land trigger2 = stateno = 106 ;Run-back land value = 40, 0