A "secret" feature in the original Super Boutuden games, you can cause extra damage to your opponent, by pressing any button the moment your character's projectile makes contact.This is a fairly simple piece of code. All you need is to add this under statedef -2:[State -2, Projectile]type = Projectiletriggerall = ((ProjContactTime(9000) != -1) && (ProjContactTime(9000) < 5))trigger1 = command = (whatever)projid = 9001projanim = -1projhitanim = -1projremanim = -1projcancelanim = -1;(etc...)Simply add in your preferences for your projectile's HitDef attributes. Please note, this example triggers a projectile with an ID of 9000. Change it to suit your character.
Uncommon in most fighting games, but VERY common for the DBZ genre, this ability allows your character to redirect the opponent's projectile back at him/her.This example shows how the "Hajiku" move of the Super Boutuden games is made.Notes:3 Vars are required for this move.Var(0): Opponent's projectile damage valueVar(1): Records the number of taps pressed.Var(2): The number of taps required. (Equation: Opponent damage divided by 30)Var(0) and Var(1) are reset whenever the character goes into his/her recovery state. (After the projectile has been repelled/destroyed.)Var(2) is resetted at the beginning of the projectile repel attempt state.;Hajiku - Stance[Statedef 9000]type? = Smovetype = Iphysics = Sanim = 9000 ;A blocking type animation[State 9000: HitOverride]type = HitOverridetrigger1 = 1slot = 1attr = SCA, APstateno = 9001time = 1[State 9000: ChangeState]type = ChangeStatetrigger1 = (Command != "holdb") || (Command != "holdc")value = 0ctrl = 1;Hajiku - Repel Attempt[Statedef 9001]type = Smovetype = Hphysics = Sanim = 9001 ; A blocking type animationsprpriority = -2[State 9001: HitOverride]type = HitOverridetrigger1 = 1slot = 0attr = SCA, APstateno = 9001time = 1;Used for projectile damage in state 9002. (If successfuly repelled.)[State 9001: VarAdd]type = VarAddtrigger1 = Time = 0v = 0value = Ceil(GetHitVar(Damage)*(-1));Used for "tapping" feature. (3 taps for every 100 points of damage of the opponent's projectile.)[State 9001: VarSet]type = VarSettrigger1 = Time = 1v = 1value = Floor(Var(0)/30)*(-1);Used for number of taps made. (Reset at start)[State 9001: VarSet]type = VarSettrigger1 = Time = 0v = 2value = 0;Used for number of taps made. (Add tap value)[State 9001: VarAdd]type = VarAddtriggerall = Time <= 100trigger1 = (Command = "x") || (Command = "y") || (Command = "z") || (Command = "a") || (Command = "b") || (Command = "c")v = 2value = 1;Get pushed by the opponent's projectile. (Divided by 2.)[State 9001: VelSet]type = VelSettrigger1 = Time = 0x = IfElse(Facing = 1,(GetHitVar(XVel)/2),(GetHitVar(XVel)/2*(-1)))y = 0;Projectile explod animation (On character)[State 9001: Explod]type = Explodtrigger1 = Time = 0anim = (whatever)id = (whatever)pos = (Position of projectile)postype = p1bindtime = -1removetime = -1ontop = 1ownpal = 1removeongethit = 1;Remove projectile explod animation.[State 9001: RemoveExplod]type = RemoveExplodtrigger1 = AnimTime = 0id = (whatever);If projectile was successfully tapped, go to projectile repel state.[State 9001: ChangeState]type = ChangeStatetrigger1 = (AnimTime = 0) && (Var(2) > Var(1))value = 9002;If projectile was not successfully tapped, go to get hit state. (Projectile will explod on character in next state.)[State 9001: ChangeState]type = ChangeStatetrigger1 = (AnimTime = 0) && (Var(2) <= Var(1))value = 9003[/code]Code: ;Hajiku - Proj Cancel Success[Statedef 9002]type = Smovetype = Iphysics = Sanim = 9002 ;Animation to repel projectile, or a blocking type animation.velset = 0,0ctrl = 0;Recovery: Lose no life from the opponent's original projectile.;Note: This equation applies only if the LIFE setting in Mugen is set to default. (100%)[State 9002: LifeAdd]type = LifeAddtrigger1 = Time = 0value = Ceil(Var(0)*(-1));VarSet: Reset the tapping values.[State 9002: VarSet]type = VarSettrigger1 = Time = 0v = 1value = 0;VarSet: Rest the opponent's projectile value. (Must be AFTER the projectile has been released.)[State 9002: VarSet]type = VarSettrigger1 = AnimTime = 0v = 0value = 0[State 9002: Projectile]type = Projectiletrigger1 = (whatever)projid = (whatever)projanim = (whatever)projhitanim = (whatever)projremanim = (whatever)projcancelanim = (whatever)projremove = 1projremovetime = 100velocity = *,*projpriority = 9projsprpriority = 4projedgebound = 1000projstagebound = 1000projheightbound = -1000,1offset = *,* ;Must be the same offset as the projectile explod animation.postype = p1;------------------attr = S, HPhitflag = MAFPguardflag = MAanimtype = Heavypriority = 1, Hitdamage = Ceil(Var(0)*(-1)),(Var(0)*(-1))/2; (etc...)[State 9002: ChangeState]type = ChangeStatetrigger1 = AnimTime = 0value = 0ctrl = 1[code];Hajiku - Proj Cancel Failed[Statedef 9003 ]type = Smovetype = Iphysics = Sanim = 9003 ;Blocking type animation, or get hit animation. ;VarSet: Reset the tapping values.[State 9003: VarSet]type = VarSettrigger1 = Time = 0v = 1value = 0;VarSet: Rest the opponent's projectile value. (Must be AFTER the projectile has been released.)[State 9003: VarSet]type = VarSettrigger1 = AnimTime = 0v = 0value = 0;Projectile explosion animtion.[State 9003: Explod]type = Explodtrigger1 = Time = 0anim = (whatever)id = (whatever)pos = 0,0postype = p1bindtime = 1removetime = -2ontop = 1ownpal = 1If dies, go to custom KOed? state.[State 9003: ChangeState]type = ChangeStatetrigger1 = Life <= 0value = *;Ends the move.[State 9003: ChangeState]type = ChangeStatetrigger1 = AnimTime = 0value = 0ctrl = 1
This code is universal, and can be used on any character, based on his/her basic attacks. This example shows how an 8 hit combo is done.[Statedef 9000];The 1st animtion:[State 9000: ChangeAnim]type = ChangeAnimtrigger1 = (Time = 0) && (HitCount = 0) && (Random <= 999 / 6)value = * ;Weak Punch[State 9000: ChangeAnim]type = ChangeAnimtrigger1 = (Time = 0) && (HitCount = 0) && (Random <= 999 / 6 + 166)value = * ;Medium Punch[State 9000: ChangeAnim]type = ChangeAnimtrigger1 = (Time = 0) && (HitCount = 0) && (Random <= 999 / 6 + 166 * 2)value = * ;Strong Punch[State 9000: ChangeAnim]type = ChangeAnimtrigger1 = (Time = 0) && (HitCount = 0) && (Random <= 999 / 6 + 166 * 3)value = * ;Weak Kick[State 9000: ChangeAnim]type = ChangeAnimtrigger1 = (Time = 0) && (HitCount = 0) && (Random <= 999 / 6 + 166 * 4)value = * ;Medium Kick[State 9000: ChangeAnim]type = ChangeAnimtrigger1 = (Time = 0) && (HitCount = 0) && (Random <= 999 / 6 + 166 * 5)value = * ;Strong Kick;The animations thereafter...[State 9000: ChangeAnim]type = ChangeAnimtrigger1 = (AnimTime = 0) && (HitCount > 0) && (HitCount < 8) && (Random <= 999 / 6)value = * ;Weak Punch[State 9000: ChangeAnim]type = ChangeAnimtrigger1 = (AnimTime = 0) && (HitCount > 0) && (HitCount < 8) && (Random <= 999 / 6 + 166)value = * ;Medium Punch[State 9000: ChangeAnim]type = ChangeAnimtrigger1 = (AnimTime = 0) && (HitCount > 0) && (HitCount < 8) && (Random <= 999 / 6 + 166 * 2)value = * ;Strong Punch[State 9000: ChangeAnim]type = ChangeAnimtrigger1 = (AnimTime = 0) && (HitCount > 0) && (HitCount < 8) && (Random <= 999 / 6 + 166 * 3)value = * ;Weak Kick[State 9000: ChangeAnim]type = ChangeAnimtrigger1 = (AnimTime = 0) && (HitCount > 0) && (HitCount < 8) && (Random <= 999 / 6 + 166 * 4)value = * ;Medium Kick[State 9000: ChangeAnim]type = ChangeAnimtrigger1 = (AnimTime = 0) && (HitCount > 0) && (HitCount < 8) && (Random <= 999 / 6 + 166 * 5)value = * ;Strong KickAs for ending the move, it can be anything, so I'll leave you to finish that.
From the VS games, it is used to get up, and roll toward your opponent, or out of the way. In any case, you will make it more difficult for the opponent to hit you while you are down.To begin, we first put the following code in the CMD:;Recovery - Roll[State -1]type = VarSettrigger1 = (Var(0) = 0) && (MoveType = H) && (command = (whatever))v = 0value = 1[State -1]type = VarSettrigger1 = ((Var(0) = 1) && (MoveType != H)) || (Lose)v = 0value = 0This is used to set the recovery while your character is in a hit state. If your character does not fall, then the variable is reset.Next, the CNS part. Your character is required to use his/her own common1.cns file.In state 5100: (Add and replace states)(replace state 5100, 12)[State 5100, 12]type = ChangeStatetrigger1 = (Var(0) = 0) && (AnimTime = 0)value = 5101(add state 5100, 14)[State 5100, 14]type = ChangeStatetrigger1 = (Var(0) = 1) && (AnimTime = 0)value = 9000 ;Recovery RollAnd in state 5120(replace state 5120, 7)[State 5120, 7]type = ChangeStatetrigger1 = (Var(0) = 0) && (AnimTime = 0)value = 0ctrl = 1(add state 5120, 8)[State 5120, 8]type = ChangeStatetrigger1 = (Var(0) = 1) && (AnimTime = 0)value = 9000 ;Recovery RollFinally, the Recovery Roll! (Modify as you wish); Recovery Roll[Statedef 9000]type = Lmovetype = Iphysics = Sctrl = 0anim = 9000velset = 0,0[State 9000, VelSet]type = VelSettrigger1 = Time >= 0x = 12 [State 9000, PlayerPush]type = PlayerPushtrigger1 = Time >= 0value = 0[State 9000, NotHitBy]type = NotHitBytrigger1 = Time >= 0value = SCA[State 9000, VarSet]type = VarSettrigger1 = Time = 0v = 0value = 0[State 9000, End]type = ChangeStatetrigger1 = (P2Dist X <= -25) || (FrontEdgeBodyDist <= 10)value = 11ctrl = 1
The ability to revive if your character is defeated. Gill from SF3 is one character with such an ability. (Heck, it's his signature move!)This helper keeps the round from ending when you lose the match:[State -3, Helper]type = Helpertrigger1 = (RoundState = 2) && (NumHelper(9000) = 0)helpertype = Playername = "Resurrection Super"id = 9000postype = p1stateno = 9000ignorehitpause = 1pausemovetime = 999999999999999999999size.ground.back = 1size.ground.front = 1size.air.back = 1size.air.front = 1Next, you have to override State 5150. If your character uses its own common states file, then add the two states to State 5150 (the two states are numbered 10 and 11):; HIT_LIEDEAD[Statedef 5150]type? ? = Lmovetype= Hphysics = Nsprpriority = -3[State 5150, 1] ;Normal animtype = ChangeAnimtriggerall = Time = 0triggerall = SelfAnimExist(5140)trigger1 = (anim != [5111,5119]) && (anim != [5171,5179])trigger2 = !SelfAnimExist(5140 + (anim % 10))value = 5140[State 5150, 3] ;Hit up type animtype = ChangeAnimtrigger1 = Time = 0trigger1 = (anim = [5111,5119]) || (anim = [5171,5179])trigger1 = SelfAnimExist(5140 + (anim % 10))value = 5140 + (anim % 10)[State 5150, 4] ;Match over animtype = ChangeAnimpersistent = 0;trigger1 = Time = 0trigger1 = MatchOver = 1trigger1 = Anim = [5140,5149]trigger1 = SelfAnimExist(anim+10)value = anim+10[State 5150, 5] ;Switch to 5110 if liedead anim does not existtype = ChangeAnimtrigger1 = Time = 0trigger1 = Anim != [5140,5159]trigger1 = Anim != [5110,5119]value = 5110[State 5150, 6] ;Frictiontype = VelMultrigger1 = 1x = 0.85[State 5150, 7] ;Frictiontype = VelSettrigger1 = Vel x < .05persistent = 0x = 0[State 5150, 9]type = NotHitBytrigger1 = 1value = SCAtime = 1[State 5150, 10]type = ChangeStatetrigger1 = Life > 0value = 5120[State 5150, 11]type = ChangeStatetrigger1 = (Life <= 0) && (Var(0) = 0) && (NumHelper(9000) > 0) && (Power >= 1000)value = 9000Now, add this to your AIR file. If you change the action number, make sure to change it in the Resurrection super states: ;Used for projectiles...[Begin Action 9010]Clsn2: 1 Clsn2[0] = -23,-640, 19,? 00,-1, 0,0, -1The Resurrection super states:;===================; Resurrection Super;===================[Statedef 9000]type = Smovetype = Ivelset = 0,0anim = 0ctrl = 0poweradd = -1000 sprpriority = 2;This var keeps the Resurrection Super from being used twice in the same round.[State 9000, VarSet]type = VarSettrigger1 = Time = 0v = 0value = 1;This NotHitby allows the player to recover at least 10% of their life. The formula used in the trigger goes like this:;life * 10% / 5 (value used in the lifeadd) * 2 (value that is "modding" the time in the lifeadd)[State 9000, NotHitBy]type = NotHitBytrigger1 = Time <= const(data.life) * 0.10 / 5 * 2;trigger1 = life >= const(data.life) * 0.10? ;An alternate triggervalue = SCA[State 9000, Width]type = Widthtrigger1 = 1player = 45; The reverse vacuum pushes the player away.[State 9000, Reverse Vacuum]type = Helpertrigger1 = (Time%3) = 0name = "Reverse Vacuum"pos = 0, 0postype = p1stateno = 9015helpertype = normalfacing = 1 ;ifelse(random >= 500, 1, -1)ignorehitpause = 1size.ground.back = 1size.ground.front = 1size.air.back = 1size.air.front = 1[State 9000, Reverse Vacuum]type = Helpertrigger1 = (Time%3) = 0name = "Reverse Vacuum"pos = 0, 0postype = p1stateno = 9015helpertype = normalfacing = -1 ;ifelse(random >= 500, 1, -1)ignorehitpause = 1size.ground.back = 1size.ground.front = 1size.air.back = 1size.air.front = 1[State 9000, LifeAdd]type = LifeAddtrigger1 = (Time%2) = 0value = 5; This "invisible" projectile will "slow down" any projectiles. Thanks to [E] for the suggestion.[State 9000, Projectile]type = Projectiletrigger1 = (Time&25) = 0projanim = 9010offset = 0,0velocity = 1, 0 projpriority = 1projremovetime = 25; HitDef part of projectile infoattr = S, HPsparkno = -1guard.sparkno = -1[State 9000, ChangeState]type = ChangeStatetrigger1 = life = const(data.life)value = 0ctrl = 1;===========================; Resurrection Helper States;===========================[Statedef 9010][State 9010, Invisible]type = AssertSpecialtrigger1 = 1flag = invisible[State 9010, PlayerPush]type = PlayerPushtrigger1 = 1value = 0[State 9010, NotHitBy]type = NotHitBytrigger1 = 1value = SCA[State 9010, Bind]type = BindToParenttrigger1 = 1[State 9010, DestroySelf]type = DestroySelftriggerall = parent, life <= 0trigger1 = (parent, power < 1000) || (parent, var(0) = 1);===============; Reverse Vacuum;===============[Statedef 9015];type? ? = Aanim = 9015[State 9015, VarRandom]type = VarRandomtrigger1 = Time = 0v = 8range = 1,5[State 9015, VelSet]type = VelSettrigger1 = Time = 0x = 5 * (3 * var(8)) + 10? ;30 [State 4015, PlayerPush]type = PlayerPushtrigger1 = p2bodydist X >= 1value = 1[State 9015, NotHitBy]type = NotHitBytrigger1 = 1value = SCA[State 9015, DestoySelf]type = DestroySelftrigger1 = Time > 20
This can be used for various purposes, such as Spiral's knives, or Strider's Oroboros.This simply shows the basic equations required to create the rotation effect.[StateDef 9000]; (etc...)1.) This VAR indicates the helper's location relative to its parent. (angle)[State 9000, VarSet]type = VarSettrigger1 = Time = 0 ;Adjust as you wish.fv = 0value = 00 radians in case you are using multiple helpers (eg, Spiral's knives) you can use the following expresion:value = IfElse(p1name="helper1",0,pi)Where "helper1" is the name of the current active helper.You can "nest" more IfElse expresions, for more helpers. Obviously, giving every helper a diferent name on the helper calling state.2.) This VAR is the rotation speed (So, you will be able to accelerate, or decelerate the rotation ratio.)[State 9000, VarSet]type = VarSettrigger1 = Time = 0 ;Adjust as you wish.fv = 1value = .2The value is given on radians. You can increase the speed by using other VarSet or expresions, like:value = (time/60)+1 ;This makes the rotation, accelerate even more as time passes.Or, as used on Yoshi...value = IfElse((Time/180)%2,-.2,.2) ;This makes the direction of the rotation change from clockwise to counterclockwise every 3 seconds.3.) This is the Y stretch of the move,in case you don't want a perfect circle. (Oval shaped effect.)[State 9000, VarSet]type = VarSettrigger1 = 1fv = 2value = 1 ;Can be .5, .2, or even an expresion.;This is the X stretch of the move.[State 9000, VarSet]type = VarSettrigger1 = 1fv = 3value = 1What's the use of vars here? Well, you can make the stretch change over time, or when certain conditions are met. You are not going to change their value, then better use constant numerical values. (eg. 3, .5, etc..)4.) Pos setting routine, and drawing:;This adds the angle to the current one[State 9000, VarAdd]type = VarAddtrigger1 = Time > 0 ;Adjust as you wish.fv = 0value = FVar(1);This sets the helper's position, relative to its parent.[State 9000, BindToParent]type = BindToParenttrigger1 = 1facing = 1time = 1pos = Cos(FVar(0)) *FVar(3), Sin(FVar(0)*FVar(2)The "Pos" equation is the basic concept, but won't look very good. But if we were to use this instead:pos = Cos(FVar(0)) *FVar(3),(-Sin(FVar(0)-(size.mid.pos.y/2))*FVar(3)The helper rotates around half the player's height.;Just in case you want the helper to spin itself as well:[State 9000, AngleSet]type = AngleSettrigger1 = 1Value = FVar(0)*2pi ;Angle must be given on degrees.[State 9000, AngleDraw]type = AngleDrawtrigger1 = 1Use this IF you want the helper to be shown behind, then on front of the parent. In this case, on half of the rotating move, the helper will be on top of the parent, and the other half it will be behind.[State 9000, SprPriority]type = SprPrioritytrigger1 = 1value = IfElse((Fvar(0)/Pi)%2,3,-1);Use this to release the helper, in case you need to..[State 9000, ChangeState]type = Changestatetrigger1 = Parent, Command = "release"value = 9001In state 9001, it can be anything that you make the helper do, so I'll leave you at that.
There are basically 2 types of high jumps: The VS style of Capcom, where the characters jump more vertical rather than horizontal, and the SNK style, which is somewhat the opposite.This code will show how the SNK Style high jump is done.In state 40, add this code in:[State 40, ChangeState]type = ChangeStatetrigger1 = (Command = "High Jump") && (AnimTime = 0)value = 9000State 9000 will be your character's high jump state:[Statedef 9000]type = Amovetype = Iphysics = A[State 9000, VelSet]type = VelSettrigger1 = Time = 0x = * ;Length of high jump (Must be greater than Y)y = * height of high jump (Must be lesser than X)[State 9000, ChangeAnim]type = ChangeAnimtrigger1 = Time = 0value = IfElse((Vel x) = 0, 41, IfElse((Vel X) > 0, 42, 43))[State 9000: ChangeAnim]type = ChangeAnimtrigger1 = Vel Y > -2 && SelfAnimExist(Anim + 3)persistent = 0value = Anim + 3[State 9000, ChangeState]type = ChangeStatetrigger1 = Pos Y >= 1value = 52
Popular in many games, this creates a special effect if the opponent was KO'ed by a special move.This code requires one variable.;Special KO Effect Switch OFF[State -2: VarSet]type = VarSettrigger1 = !WinKOv = 0value = 0ignorehitpause = 1;Special KO Effect Switch ON[State -2: VarSet]type = VarSettrigger1 = (WinKO) && (Var(0) = 0) && (StateNo >= 700) ;Adjust as you wish.v = 0value = 1ignorehitpause = 1;Special KO Effect timer. (To prevent repetiveness)[State -2: VarAdd]type = VarAddtrigger1 = Var(0) > 0v = 0value = 1ignorehitpause = 1This is one example of how a special KO effect can be done. ;Remove life bars during effects.[State -2: AssertSpecial]type = AssertSpecialtrigger1 = (Var(0) = 1) && (StateNo >= 700) ;Adjust as you wish.flag = NoBarDisplayflag2 = NoFGignorehitpause = 1;The effect itself[State -2: Explod]type = Explodtrigger1 = (Var(0) = 2) && (NumExplod(9000) = 0) && (StateNo >= 700) ;Adjust as you wish.id = 9000ignorehitpause = 1; (etc...)
Non-intrusive Dizzy Mode -- you can put opponents into this special state, pound the buttons to get out of it, and it won't overwrite the opponent's variables. Also included is the code that makes the character dizzied by long strings of attacks (A sort of Stun Meter). This is the character's dizzy state.[Statedef 9000]type = Sphysics = Smovetype = Hctrl = 0[State 9000, Change Animation]type = ChangeAnimtrigger1 = Time = 0value = 5300[State 9000, Button Jam]type = ChangeStatetriggerall = Random <= 500trigger1 = (command = "a") || (command = "b") || (command = "c") trigger2 = (command = "x") || (command = "y") || (command = "z")value = 9001[State 9000, Next]type = ChangeStatetrigger1 = Time = 30value = 9001Next dizzy state.[Statedef 9001]type = Sphysics = Smovetype = Hctrl = 0[State 9001, Flash]type = PalFXtrigger1 = Time = 0time = 2add = 50,50,50mul = 300,300,300[State 9001, Button Jam]type = ChangeStatetriggerall = Random <= 500trigger1 = (command = "a") || (command = "b") || (command = "c") trigger2 = (command = "x") || (command = "y") || (command = "z")value = 9002[State 9001, Next]type = ChangeStatetrigger1 = Time = 30value = 9002...and the next.[Statedef 9002]type = Sphysics = Smovetype = Hctrl = 0[State 9002, Flash]type = PalFXtrigger1 = Time = 0time = 2add = 50,50,50mul = 300,300,300[State 9002, Button Jam]type = ChangeStatetriggerall = Random <= 500trigger1 = (command = "a") || (command = "b") || (command = "c") trigger2 = (command = "x") || (command = "y") || (command = "z")value = 9003[State 9002, Next]type = ChangeStatetrigger1 = Time = 30value = 9003This is the last dizzy state, where the character can regain control.You should create more copies of the dizzy states, to further increase the amount of time needed to recover. (Around 5-6 more.)[Statedef 9003]type = Sphysics = Smovetype = Hctrl = 0[State 9003, Flash]type = PalFXtrigger1 = (!Time)time = 2add = 50,50,50mul = 300,300,300[State 9003, Button Jam]type = ChangeStatetriggerall = (Random <= 500)trigger1 = (Command = "a") || (Command = "b") || (Command = "c") trigger2 = (Command = "x") || (Command = "y") || (Command = "z")value = 0[State 9003, Undizzy]type = SelfStatetrigger1 = (Time = 30)value = 0ctrl = 1Being dizzied. (Self only: The following code can all be omitted if you don't want the character to succumb from Stun Dizzies.)[Statedef 9010]type = Smovetype = Hphysics = Nctrl = 0[State 9010: NotHitBy]type = NotHitBytrigger1 = 1value = SCA[State 9010: VarSet]type = VarSettrigger1 = (!Time)v = 10value = 0[State 9010: ChangeState]type = ChangeStatetrigger1 = (HitShakeOver)value = 9011This is the character's state where he/she is being knocked out when the stun meter has reached it's limit.[Statedef 9011]type = Amovetype = Hphysics = Nanim = 9011ctrl = 0velset = -3, -4[State 9011: VelAdd]type = VelAddtrigger1 = (Pos Y < 0)y = 0.35[State 9011: NotHitBy]type = NotHitBytrigger1 = 1value = SCA[State 9011: ChangeState]type = ChangeStatetrigger1 = (Pos Y >= 0) && (Vel Y > 0)value = 9012This is the character's getting up state when being knocked out. He/She will end up dizzy.[Statedef 9012]type = Smovetype = Hphysics = Sanim = 5110ctrl = 0[State 9012: VelSet]type = VelSettrigger1 = (!Time)Y = 0[State 9012: NotHitBy]type = NotHitBytrigger1 = 1value = SCA[State 9012: ChangeAnim]type = ChangeAnimtrigger1 = (Time = 25)value = 5120[State 9012: ChangeState]type = ChangeStatetrigger1 = (AnimTime = 0) && (Anim = 5120)value = 9000Now, the -3 states. This is very important, and is needed for the stun meter itself. You can also add in a graphical stun meter along with this code, which can quite easily be implemented together.These next 3 states are used to add to the stun meter whenever the character is hit; Weak, Medium, and Heavy attacks.[State -3: VarAdd]type = VarAddtriggerall = (Time = 2)trigger1 = ((StateNo = 5001) && (Anim = 5000)) || (StateNo = 5001) && (Anim = 5010)) || ((StateNo = 5011) && (Anim = 5020))persistent = 0ignorehitpause = 1v = 0value = 10[State -3: VarAdd]type = VarAddtriggerall = (Time = 4)trigger1 = ((StateNo = 5001) && (Anim = 5001)) || ((StateNo = 5001) && (Anim = 5011)) || ((StateNo = 5011) && (Anim = 5021))persistent = 0ignorehitpause = 1v = 0value = 40[State -3: VarAdd]type = VarAddtriggerall = (Time = 6)trigger1 = ((StateNo = 5001) && (Anim = 5002)) || ((StateNo = 5001) && (Anim = 5012)) || ((StateNo = 5011) && (Anim = 5022))persistent = 0ignorehitpause = 1v = 0value = 100This is used to recover the stun meter when the character is not hit.[State -3: VarAdd]type = VarAddtrigger1 = (Var(0) > 0)ignorehitpause = 1v = 0value = -1Finally, this is used to go into the dizzy state, when the stun meter has reached it's limit. You can adjust the "Var(0) >= 400", if you want the stun meter to be higher, or lower.Note, that the 9003 of this trigger is the final dizzy state mentioned earlier. Change this, if you plan to add in more.[State -3: ChangeState]type = ChangeStatetrigger1 = (Var(0) >= 400) && (StateNo != [9000,9003])value = 9010ignorehitpause = 1
This is for displaying numbers in mugen. Basically mathematical equations. First of all, we need the individual digits, lets say we have a Var(0) that has the value of 359.[State a, 0]type = VarRangeSettrigger1 = Time = 0value = 0 ; Reset the Vars that we needfirst = 1last = 3[State a, 1]type = VarSettrigger1 = Time = 0 && Var(0) > 99 ; Make sure Var(0) has 3 digitsVar(1) = Floor(Var(0) / 100) ; Take the integer part of the hundredth digit.Var(1) now contains the first digit of our number, 3.[State a, 2]type = VarSettrigger1 = Time = 0 && Var(0) > 9 ; make sure Var(0) has 2 digitsVar(2) = Floor(Var(0) / 10) - (Var(1) * 10) ; Take the first 2 digits and subtract the first.Var(2) now contains the 2nd, 5.[State a, 3]type = VarSettrigger1 = Time = 0Var(3) = Var(0) - (Var(1) * 100) - (Var(2) * 10) ; Subtract the first and 2nd digits.Var(3) now has the last digit, 9.Now that we have all 3 digits, we can display them. First, make sure you have the number sprites in the sff. Second, make sure the AIR group numbers are proportional to the numbers, ie. if the sprite "0" has AIR group number 6000 or 7000 or 8920, then the sprite "8" would be 6008 or 7008 or 8928, respectively. Now:[State a, 4]type = Explodtrigger1 = (whatever)anim = (AIR group number of sprite "0") + Var(1)postype = (whatever)pos = (x), (y) ; Make sure you remember this position[State a, 5]type = Explodtrigger1 = (whatever)anim = (AIR group number of sprite "0") + Var(2)postype = (whatever)pos = (x) + (width of sprite), (y) ; display after the 1st digit[State a, 6]type = Explodtrigger1 = (whatever)anim = (AIR group number of sprite "0") + Var(3)postype = (whatever)pos = (x) + (width of sprite) + (width of sprite), (y) ; last position
I'm not sure what's the "official" name of this feature, but this is VERY common in the Mega Man games.This same feature can be used to "pump up" your character, while your he/she is still able to move.Under statedef -3 (Since the effect should end if your character gets thrown), put this:[State -3]type = VarAddtrigger1 = command = "holdx"var(0) = 1ignorehitpause = 1[State -3]type = VarSettrigger1 = (stateno = [9000,9001]) || (stateno = [9010,9011]) || (movetype = H && command != "holdx")var(0) = 0[State -3]type = ChangeStatetrigger1 = (command != "holdx") && (var(0) = [0,50]) && (ctrl) && (statetype != A)value = 9000 ;On the ground (Weak effect)[State -3]type = ChangeStatetrigger1 = (command != "holdx") && (var(0) > 50) && (ctrl) && (statetype != A)value = 9001 ;On the ground (Strong effect)[State -3]type = ChangeStatetrigger1 = (command != "holdx") && (var(0) = [0,50]) && (ctrl) && (statetype = A)value = 9010 ;In the air (Weak effect)[State -3]type = ChangeStatetrigger1 = (command != "holdx") && (var(0) > 50) && (ctrl) && (statetype = A)value = 9011 ;In the air (Strong effect)Feel free to add in any effects.Next, you create your character's move as the result of releasing the button. Because this can be anything you choose, I'll leave you at that.
The ability to move from one place to another without physical movement.There are two types of teleportation: Teleportation that works at a fixed position, and teleportation that works according to a particular situation (e.g., opponent's position).1.) Fixed TeleportationThis particular code can be controlled with the directional keys.[Statedef 9000][State 9000, PlaySnd]type = PlaySndtrigger1 = (whatever)value = *,*[State 9000, PosSet]type = PosSettrigger1 = Pos Y > 0y = 0[State 9000, PosAddFwd]type = PosAddtriggerall = Time = *** ;Time to teleport.trigger1 = ((command = "holdfwd") || (command != "holdfwd")) && (command != "holdback") && (command != "holdup") && (command != "holddown")x = * ;Must be a positive value.y = 0[State 9000, PosAddBack]type = PosAddtriggerall = Time = *** ;Time to teleport.trigger1 = (command = "holdback") && (command != "holdfwd") && (command != "holdup") && (command != "holddown")x = * ;Must be a negative value.y = 0[State 9000, PosAddUp]type = PosAddtriggerall = Time = *** ;Time to teleport.trigger1 = (command = "holdup") && (command != "holdfwd") && (command != "holdback") && (command != "holddown")x = 0y = * ;Must be a negative value.[State 9000, PosAddDown]type = PosAddtriggerall = Time = *** ;Time to teleport.trigger1 = (command = "holddown") && (command != "holdfwd") && (command != "holdback") && (command != "holdup")x = 0y = * ;Must be a positive value.[State 9000, PosAddFwdUp]type = PosAddtriggerall = Time = *** ;Time to teleport.trigger1 = (command = "holdfwd") && (command = "holdup") && (command != "holdback") && (command != "holddown")x = * ;Must be a positive value.y = * ;Must be a negative value.[State 9000, PosAddFwdDown]type = PosAddtriggerall = Time = *** ;Time to teleport.trigger1 = (command = "holdfwd") && (command = "holddown") && (command != "holdback") && (command != "holdup")x = * ;Must be a positive value.y = * ;Must be a positive value.[State 9000, PosAddBackUp]type = PosAddtriggerall = Time = *** ;Time to teleport.trigger1 = (command = "holdback") && (command = "holdup") && (command = "holdfwd") && (command = "holddown")x = * ;Must be a negative value.y = * ;Must be a negative value.[State 9000, PosAddBackDown]type = PosAddtriggerall = Time = *** ;Time to teleport.trigger1 = (command = "holdback") && (command = "holddown") && (command != "holdfwd") && (command != "holdup")x = * ;Must be a negative value.y = * ;Must be a positive value.[State 9000, End]type = ChangeStatetrigger1 = AnimTime = 0value = 0ctrl = 12.) Non-Fixed Teleportation: Teleportation is determined by the opponent's position (as an example...).[Statedef 9000][State 9000, PlaySnd]type = PlaySndtrigger1 = (whatever)value = *,*[State 9000, PosAdd]type = PosAddtrigger1 = (whatever)x = (P2Dist X) + * y = (P2dist Y) + *[State 9000, End]type = ChangeStatetrigger1 = AnimTime = 0value = 0ctrl = 1The "+ *" is used, so that your character is given some room away from the opponent, rather than teleporting at the exact point of where he/she is.
In some fighting games, slow motion effects are used, like in SF2, when a projectile hits the opponent. The effect itself can be easily accomplished. Triggering it can vary, but I'll leave that to you. With this code, you can have bullet time in Mugen, or you could make Neo for Mugen!In the state that you want to create the effect, add this one piece in: The trigger used should last for a number of ticks, such as "Time = [0,20]"[State ****: Pause]type = Pausetriggerall = (GameTime%3) = 0trigger1 = ;[Insert trigger here.]time = 1movetime = 1ignorehitpause = 1If you want to increase the intensity of the effect, you can change the value of the "GameTime" trigger to 2 or 1. If that's not slow enough, you can increase the value of the "time" and "movetime" parameters until it suits your needs.
A simple effect that can be used to cause a limited effect in the game. Usually done with a transformation, or used to remove a specified effect when the time runs out.[Statedef 9000][State 9000, TimerSet]type = VarSettrigger1 = (whatever)v = 0value = 1000 ; Timer valueNext, the -2 state, for the count down:[State -2, CountDown]type = VarAddtrigger1 = Var(0) > 0var(0) = -1ignorehitpause = 1
Flying: Idainaru Densetsu StyleThe way flying works in Idainaru Densetsu is very simple; Pressing backward or downwards on the directional keys move your character away from the opponent, and forward or up to move towards. Your character will move in a straight path.The startup state.[Statedef ****]type = Amovetype = Iphysics = Nanim = ****[State ****: VarSet]type = VarSettrigger1 = (!Time)var(0) = 1[State ****: VelSet]type = VelSettrigger1 = (Time > 10)y = -6[State ****: VelAdd]type = VelAddtrigger1 = (Time? > 10) && (Time, < 30) && (Vel Y < -1)y = 0.40[State ****: ChangeState]type = ChangeStatetrigger1 = (Time > 30)value = ***1The flying state, when character is idle.[Statedef ***1]type = Amovetype = Iphysics = Nanim = ***1velset = 0,0ctrl = 1[State ***1: Turn]type = Turntrigger1 = (P2Dist X < -1); This NULL is actually used to set a few variables at once, without actually having to use that many VarSets.; (Read Elecbyte's documentation on expressions.); Var(0): The "You're flying" variable. You can use this to call upon when needed, such as for the CMD file.; Var(1) and Var(2): Used for the floating effect.[State ***1: Null]type = Nulltrigger1 = (!Time)trigger1 = (Var(1) := 0) && (Var(0) := 1)trigger2 = (Var(1) = -10) || (Var(1) = 10)trigger2 = (Var(2) := IfElse(Var(1) = -10,0,1))[State ***1: VarAdd]type = VarAddtrigger1 = 1var(1) = IfElse(Var(2) = 0,1,-1)[State ***1: VelAdd]type = VelAddtrigger1 = 1y = IfElse(Var(2) = 1,0.05,-0.05); ***2 is the moving towards state, and ***3 for away.[State ***1: ChangeState]type = ChangeStatetrigger1 = (Command = "holdup") || (Command = "holdfwd")value = ***2[State ***1: ChangeState]type = ChangeStatetrigger1 = (Command = "holddown") || (Command = "holdback")value = ***3[/code]Flying towards state.[code][Statedef ***2]type = Amovetype = Iphysics = Nanim = ***2ctrl = 1; This is used to check the position of the enemy, and sets the appropriate values to; move towards him/her.; FVar(0): X velocity; FVar(1): Y velocity[State ***2: Null]type = Nulltrigger1 = (!Time)trigger1 = (FVar(0) := (P2Dist X * 8) / (Exp(0.5*ln((P2Dist X * P2Dist X) + (P2Dist Y * P2Dist Y)))))trigger1 = (FVar(1) := (P2Dist Y * 8) / (Exp(0.5*ln((P2Dist X * P2Dist X) + (P2Dist Y * P2Dist Y))))); Moves the character, using the variables as reference. You cannot use those expressions; as shown above and put it directly into the VelSet. MUGEN will lock up after this is used; a number of times.[State ***2: VelSet]type = VelSettrigger1 = (Whatever)x = FVar(0)y = FVar(1); Go back to the idle state when commands are released.[State ***2: ChangeState]type = ChangeStatetrigger1 = (Command != "holdfwd") && (Command != "holdup")value = ***1Flying away state.[Statedef ***3]type = Amovetype = Iphysics = Nanim = ***3ctrl = 1; Disables air guarding. If you wish to add in air guarding while flying, you can; remove this, then edit the guarding states accordingly, using Var(0) as reference.[State ***3: AssertSpecial]type = AssertSpecialtrigger1 = 1flag = NoAirGuardignorehitpause = 1[State ***3: Null]type = Nulltrigger1 = (!Time)trigger1 = (FVar(0) := (P2Dist X * 8) / (Exp(0.5*ln((P2Dist X * P2Dist X) + (P2Dist Y * P2Dist Y)))))trigger1 = (FVar(1) := (P2Dist Y * 8) / (Exp(0.5*ln((P2Dist X * P2Dist X) + (P2Dist Y * P2Dist Y)))))[State ***3: VelSet]type = VelSettrigger1? = (Whatever)x = (FVar(0)*(-1))y = (FVar(1)*(-1))[State ***3: ChangeState]type = ChangeStatetrigger1 = (Command != "holdback") && (Command != "holddown")value = ***1
There are basically 2 types of high jumps: The VS style of Capcom, where the characters jump more vertical rather than horizontal, and the SNK style, which is somewhat the opposite.This code will show how the VS Style high jump is done.[Statedef 9000]type? ? = Aphysics = Nvelset = 0,-11ctrl = 0[State 9000, ChangeAnim]type = ChangeAnimtrigger1 = Time = 0value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))[State 9000, PlaySnd]type = PlaySndtrigger1 = Time = 0value = *,*[state 9000, CtrlSet]type = CtrlSettrigger1 = Time >= 1value = 1[state 9000, VelSetFwd]type = VelSettrigger1 = command = "holdfwd"x = 3 [state 9000, VelSetBack]type = VelSettrigger1 = command = "holdback"x = -3[state 9000, VelAdd]type = VelAddtrigger1 = Time > 10x = 0y = .40[state 9000, End]type = ChangeStatetrigger1 = Pos Y >= 1 value = 52ctrl
Method 2 of creating Versus super jumps:Requires a variableIs a bit easier and it makes for more "versus-true" velocities when you hold back or forward.Also, I found a yaccel of .39 to be more fitting for versus characters.1.) In the super jump move:; Super Jump[Statedef 9000]type = Aphysics = Sctrl = 0anim = 40[State 9000, VarSet]type = VarSettrigger1 = Time = 0var(10) = 1[State 9000, VelSet]type = VelSettrigger1 = AnimTime = 0x = 0y = -11[State 9000, PlaySnd]type = PlaySndtrigger1 = AnimTime = 0value = *,*[State 9000, ChangeState]type = ChangeStatetrigger1 = AnimTime = 0value = 50ctrl = 12.) Overridden states:; Jump Up[Statedef 50] type = Aphysics = A[State 50, 1]type = VarSettrigger1 = Time = 0sysvar(1) = 0[State 50, VelAdd]type = VelAddtrigger1 = (Vel X < 3.25) && (Var(0) = 1) && (Command = "holdfwd") && (Command != "holdback")x = .45[State 50, VelAdd]type = VelAddtrigger1 = (Vel X > -3.25) && (Var(0) = 1) && (Command != "holdfwd") && (Command = "holdback")x = -.45;Notice var(0) * 10000. Anims 41-43 are normal jump rise anims. Anims 10041-10043 are super jump rise anims.[State 50, 2]type = ChangeAnimtrigger1 = Time = 0value = ifelse((vel x)=0, ((var(0) * 10000) + 41), ifelse((vel x)>0, ((var(0) * 10000) + 42), ((var(0) * 10000) + 43)))[State 50, 3]type = ChangeAnimtrigger1 = Anim = [41,43]trigger1 = AnimTime = 0;trigger1 = Vel y > -2trigger1 = SelfAnimExist(anim + 3)persistent = 0value = Anim + 3So that you don't retain super jump movement capabilities:; -[ Super Jump Control ]-[State -2]type = VarSettrigger1 = StateType != Avar(0) = 0 Enjoy.
This is a feature in those cross-over games, where you choose 2 characters which alternate during the fight.This code shows how the VS style tag team is done.Important Note: This is incomplete. (Will be updated in the future.) [Uh, right... -DavidGee]1.) First, the tag team call move:[Statedef 9000]type = Amovetype = Aphysics = Nanim = 9000ctrl = 0;Screen will iIgnore your character as the switch is made.[State 9000, ScreenBound]type = ScreenBoundtrigger1 = Time <= 5value = 0;Illusionary effect: Makes your character look like he's jumping away. (He really got moved with the PosSet, see below.)[State 9000, Helper]type = Helpertrigger1 = Time = 0stateno = 9001postype = p1pos = 0,0ownpal = 1;XY Position to put character into, for an illusion effectof jumping in. (Facing to the right.)[State 9000, PosSet]type = PosSettrigger1 = (Facing = 1) && (Time = 1)x = -150y = -75;XY Position to put character into, for an illusion effectof jumping in. (Facing to the left.)[State 9000, PosSet]type = PosSettrigger1 = (Facing = -1) && (Time = 1)x = 150y = -75;Jumping in velocity.[State 9000, VelSet]type = VelSettrigger1 = Time = 1x = 14y = 3.5;Adjust according to your preferences. (This is Sunboy's original values!!)[State 9000, HitDef]type = HitDeftrigger1 = (whatever)attr = A, NAanimtype = Harddamage = 30sparkxy = 0, -24hitflag = MAFDguardflag = MApausetime = 10,10;hitsound = ;guardsound = ground.type = Highground.slidetime = 8ground.hittime = 20ground.velocity = -.5,-8.5air.velocity = -.5,-8.5fall = 1;When you land on the ground, go to your character's taunt state.[State 9000, ChangeState]type = ChangeStatetrigger1 = Time > 2trigger1 = Pos Y >= -10value = 195Finally, the helper created from this action:; Tagging Away[Statedef 9001]type = Amovetype = Iphysics = Nvelset = -14, -3.5anim = 9001ctrl = 0[State 9001, DestroySelf]type = DestroySelftrigger1 = AnimTime = 02.) As for the character animation and attributes changes, you'll need to use a variable to have your character look like the new one. (The tagged character.)Please refer to Omniscience's Morph codes on creating this effect. (As an alternative until this reference is completed.)
Reversals can be implemented in the CMD, under the moves you want your char to "wake up" with, add:trigger(available trigger number) = stateno = 5120 && time = 6 ; SNK styleORtrigger(available trigger number) = stateno = 5120 && time = [4, 9] ; Capcom styleFor SNK style normal throws, in the throw state, changestate to the close attack of that button if you miss, ie. for forward + hard punch throws:[State a, 0]type = ChangeStatetrigger1 = AnimTime = 0value = (close hard punch state)For the other stuff, I suggest you observe any properties of the moves of your character.
Certain characters have this unique ability, to jump off the sides of the screen. Some creators use special states to accomplish this. I just use the regular jump. =PAll you need is 2 things. First, the command to jump off the wall. Insert this in your character's CMD file:[State -1: ChangeState]type = ChangeStatevalue = 40triggerall = (StateType = A) && (Ctrl) && (Pos Y < -30)trigger1 = ((command = "holdup") && (command = "holdfwd") && (Vel X <= 0) && (backedgebodydist <= 10) && (backedgebodydist > -10)) trigger2 = ((command = "holdup") && (command = "holdback") && (Vel X >= 0) && (frontedgebodydist <= 10) && (frontedgebodydist > -10)) persistent = 0The 2nd thing to add is a controller, to tell Mugen that your character is in the air during the jump start, to prevent a float bug if hit.[State -1: StateTypeSet]type = StateTypeSettrigger1 = (StateNo = 40) && (Pos Y < 0)statetype = AIf you want to use a custom anim to jump off the wall, you can add this as well.[State -1: ChangeAnim]type = ChangeAnimtrigger1 = (StateNo = 40) && (Pos Y < 0) && (!Time)value = ****