YesNoOk
avatar

Code Snippet Archive (Read 125302 times)

Started by Bronko, May 28, 2005, 01:48:59 am
Share this topic:
Projectile Critical
#21  May 29, 2005, 05:45:26 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 = Projectile
triggerall = ((ProjContactTime(9000) != -1) && (ProjContactTime(9000) < 5))
trigger1 = command = (whatever)
projid = 9001
projanim = -1
projhitanim = -1
projremanim = -1
projcancelanim = -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.
Last Edit: November 07, 2007, 11:47:52 pm by DavidGee
Projectile Repel
#22  May 29, 2005, 05:51:10 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 value
  • Var(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? = S
movetype = I
physics = S
anim = 9000 ;A blocking type animation

[State 9000: HitOverride]
type = HitOverride
trigger1 = 1
slot = 1
attr = SCA, AP
stateno = 9001
time = 1

[State 9000: ChangeState]
type = ChangeState
trigger1 = (Command != "holdb") || (Command != "holdc")
value = 0
ctrl = 1

;Hajiku - Repel Attempt
[Statedef 9001]
type = S
movetype = H
physics = S
anim = 9001 ; A blocking type animation
sprpriority = -2

[State 9001: HitOverride]
type = HitOverride
trigger1 = 1
slot = 0
attr = SCA, AP
stateno = 9001
time = 1

;Used for projectile damage in state 9002. (If successfuly repelled.)
[State 9001: VarAdd]
type = VarAdd
trigger1 = Time = 0
v = 0
value = 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 = VarSet
trigger1 = Time = 1
v = 1
value = Floor(Var(0)/30)*(-1)

;Used for number of taps made. (Reset at start)
[State 9001: VarSet]
type = VarSet
trigger1 = Time = 0
v = 2
value = 0

;Used for number of taps made. (Add tap value)
[State 9001: VarAdd]
type = VarAdd
triggerall = Time <= 100
trigger1 = (Command = "x") || (Command = "y") || (Command = "z") || (Command = "a") || (Command = "b") || (Command = "c")
v = 2
value = 1

;Get pushed by the opponent's projectile. (Divided by 2.)
[State 9001: VelSet]
type = VelSet
trigger1 = Time = 0
x = IfElse(Facing = 1,(GetHitVar(XVel)/2),(GetHitVar(XVel)/2*(-1)))
y = 0

;Projectile explod animation (On character)
[State 9001: Explod]
type = Explod
trigger1 = Time = 0
anim = (whatever)
id = (whatever)
pos = (Position of projectile)
postype = p1
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
removeongethit = 1

;Remove projectile explod animation.
[State 9001: RemoveExplod]
type = RemoveExplod
trigger1 = AnimTime = 0
id = (whatever)

;If projectile was successfully tapped, go to projectile repel state.
[State 9001: ChangeState]
type = ChangeState
trigger1 = (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 = ChangeState
trigger1 = (AnimTime = 0) && (Var(2) <= Var(1))
value = 9003[/code]

Code:
;Hajiku - Proj Cancel Success
[Statedef 9002]
type = S
movetype = I
physics = S
anim = 9002 ;Animation to repel projectile, or a blocking type animation.
velset = 0,0
ctrl = 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 = LifeAdd
trigger1 = Time = 0
value = Ceil(Var(0)*(-1))

;VarSet: Reset the tapping values.
[State 9002: VarSet]
type = VarSet
trigger1 = Time = 0
v = 1
value = 0

;VarSet: Rest the opponent's projectile value. (Must be AFTER the projectile has been released.)
[State 9002: VarSet]
type = VarSet
trigger1 = AnimTime = 0
v = 0
value = 0

[State 9002: Projectile]
type = Projectile
trigger1 = (whatever)
projid = (whatever)
projanim = (whatever)
projhitanim = (whatever)
projremanim = (whatever)
projcancelanim = (whatever)
projremove = 1
projremovetime = 100
velocity = *,*
projpriority = 9
projsprpriority = 4
projedgebound = 1000
projstagebound = 1000
projheightbound = -1000,1
offset = *,* ;Must be the same offset as the projectile explod animation.
postype = p1
;------------------
attr = S, HP
hitflag = MAFP
guardflag = MA
animtype = Heavy
priority = 1, Hit
damage = Ceil(Var(0)*(-1)),(Var(0)*(-1))/2
; (etc...)

[State 9002: ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[code];Hajiku - Proj Cancel Failed
[Statedef 9003 ]
type = S
movetype = I
physics = S
anim = 9003 ;Blocking type animation, or get hit animation.

;VarSet: Reset the tapping values.
[State 9003: VarSet]
type = VarSet
trigger1 = Time = 0
v = 1
value = 0

;VarSet: Rest the opponent's projectile value. (Must be AFTER the projectile has been released.)
[State 9003: VarSet]
type = VarSet
trigger1 = AnimTime = 0
v = 0
value = 0

;Projectile explosion animtion.
[State 9003: Explod]
type = Explod
trigger1 = Time = 0
anim = (whatever)
id = (whatever)
pos = 0,0
postype = p1
bindtime = 1
removetime = -2
ontop = 1
ownpal = 1

If dies, go to custom KOed? state.
[State 9003: ChangeState]
type = ChangeState
trigger1 = Life <= 0
value = *

;Ends the move.
[State 9003: ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
Last Edit: November 07, 2007, 11:48:50 pm by DavidGee
Random Combos
#23  May 29, 2005, 05:52:59 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 = ChangeAnim
trigger1 = (Time = 0) && (HitCount = 0) && (Random <= 999 / 6)
value = * ;Weak Punch

[State 9000: ChangeAnim]
type = ChangeAnim
trigger1 = (Time = 0) && (HitCount = 0) && (Random <= 999 / 6 + 166)
value = * ;Medium Punch

[State 9000: ChangeAnim]
type = ChangeAnim
trigger1 = (Time = 0) && (HitCount = 0) && (Random <= 999 / 6 + 166 * 2)
value = * ;Strong Punch

[State 9000: ChangeAnim]
type = ChangeAnim
trigger1 = (Time = 0) && (HitCount = 0) && (Random <= 999 / 6 + 166 * 3)
value = * ;Weak Kick

[State 9000: ChangeAnim]
type = ChangeAnim
trigger1 = (Time = 0) && (HitCount = 0) && (Random <= 999 / 6 + 166 * 4)
value = * ;Medium Kick

[State 9000: ChangeAnim]
type = ChangeAnim
trigger1 = (Time = 0) && (HitCount = 0) && (Random <= 999 / 6 + 166 * 5)
value = * ;Strong Kick

;The animations thereafter...

[State 9000: ChangeAnim]
type = ChangeAnim
trigger1 = (AnimTime = 0) && (HitCount > 0) && (HitCount < 8) && (Random <= 999 / 6)
value = * ;Weak Punch

[State 9000: ChangeAnim]
type = ChangeAnim
trigger1 = (AnimTime = 0) && (HitCount > 0) && (HitCount < 8) && (Random <= 999 / 6 + 166)
value = * ;Medium Punch

[State 9000: ChangeAnim]
type = ChangeAnim
trigger1 = (AnimTime = 0) && (HitCount > 0) && (HitCount < 8) && (Random <= 999 / 6 + 166 * 2)
value = * ;Strong Punch

[State 9000: ChangeAnim]
type = ChangeAnim
trigger1 = (AnimTime = 0) && (HitCount > 0) && (HitCount < 8) && (Random <= 999 / 6 + 166 * 3)
value = * ;Weak Kick

[State 9000: ChangeAnim]
type = ChangeAnim
trigger1 = (AnimTime = 0) && (HitCount > 0) && (HitCount < 8) && (Random <= 999 / 6 + 166 * 4)
value = * ;Medium Kick

[State 9000: ChangeAnim]
type = ChangeAnim
trigger1 = (AnimTime = 0) && (HitCount > 0) && (HitCount < 8) && (Random <= 999 / 6 + 166 * 5)
value = * ;Strong Kick

As for ending the move, it can be anything, so I'll leave you to finish that. =)
Last Edit: November 07, 2007, 11:49:49 pm by DavidGee
Recovery Roll
#24  May 29, 2005, 05:55:22 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 = VarSet
trigger1 = (Var(0) = 0) && (MoveType = H) && (command = (whatever))
v = 0
value = 1

[State -1]
type = VarSet
trigger1 = ((Var(0) = 1) && (MoveType != H)) || (Lose)
v = 0
value = 0

This 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 = ChangeState
trigger1 = (Var(0) = 0) && (AnimTime = 0)
value = 5101

(add state 5100, 14)

[State 5100, 14]
type = ChangeState
trigger1 = (Var(0) = 1) && (AnimTime = 0)
value = 9000 ;Recovery Roll

And in state 5120

(replace state 5120, 7)

[State 5120, 7]
type = ChangeState
trigger1 = (Var(0) = 0) && (AnimTime = 0)
value = 0
ctrl = 1

(add state 5120, 8)

[State 5120, 8]
type = ChangeState
trigger1 = (Var(0) = 1) && (AnimTime = 0)
value = 9000 ;Recovery Roll

Finally, the Recovery Roll! (Modify as you wish)

; Recovery Roll
[Statedef 9000]
type = L
movetype = I
physics = S
ctrl = 0
anim = 9000
velset = 0,0

[State 9000, VelSet]
type = VelSet
trigger1 = Time >= 0
x = 12

[State 9000, PlayerPush]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 9000, NotHitBy]
type = NotHitBy
trigger1 = Time >= 0
value = SCA

[State 9000, VarSet]
type = VarSet
trigger1 = Time = 0
v = 0
value = 0

[State 9000, End]
type = ChangeState
trigger1 = (P2Dist X <= -25) || (FrontEdgeBodyDist <= 10)
value = 11
ctrl = 1
Last Edit: November 07, 2007, 11:50:38 pm by DavidGee
Resurrection
#25  May 29, 2005, 06:00:05 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 = Helper
trigger1 = (RoundState = 2) && (NumHelper(9000) = 0)
helpertype = Player
name = "Resurrection Super"
id = 9000
postype = p1
stateno = 9000
ignorehitpause = 1
pausemovetime = 999999999999999999999
size.ground.back = 1
size.ground.front = 1
size.air.back = 1
size.air.front = 1

Next, 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? ? = L
movetype= H
physics = N
sprpriority = -3

[State 5150, 1] ;Normal anim
type = ChangeAnim
triggerall = Time = 0
triggerall = SelfAnimExist(5140)
trigger1 = (anim != [5111,5119]) && (anim != [5171,5179])
trigger2 = !SelfAnimExist(5140 + (anim % 10))
value = 5140

[State 5150, 3] ;Hit up type anim
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (anim = [5111,5119]) || (anim = [5171,5179])
trigger1 = SelfAnimExist(5140 + (anim % 10))
value = 5140 + (anim % 10)

[State 5150, 4] ;Match over anim
type = ChangeAnim
persistent = 0
;trigger1 = Time = 0
trigger1 = MatchOver = 1
trigger1 = Anim = [5140,5149]
trigger1 = SelfAnimExist(anim+10)
value = anim+10

[State 5150, 5] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Anim != [5140,5159]
trigger1 = Anim != [5110,5119]
value = 5110

[State 5150, 6] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5150, 7] ;Friction
type = VelSet
trigger1 = Vel x < .05
persistent = 0
x = 0

[State 5150, 9]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 5150, 10]
type = ChangeState
trigger1 = Life > 0
value = 5120

[State 5150, 11]
type = ChangeState
trigger1 = (Life <= 0) && (Var(0) = 0) && (NumHelper(9000) > 0) && (Power >= 1000)
value = 9000

Now, 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,? 0
0,-1, 0,0, -1

The Resurrection super states:

;===================
; Resurrection Super
;===================

[Statedef 9000]
type = S
movetype = I
velset = 0,0
anim = 0
ctrl = 0
poweradd = -1000
sprpriority = 2

;This var keeps the Resurrection Super from being used twice in the same round.
[State 9000, VarSet]
type = VarSet
trigger1 = Time = 0
v = 0
value = 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 = NotHitBy
trigger1 = Time <= const(data.life) * 0.10 / 5 * 2
;trigger1 = life >= const(data.life) * 0.10? ;An alternate trigger
value = SCA

[State 9000, Width]
type = Width
trigger1 = 1
player = 45

; The reverse vacuum pushes the player away.
[State 9000, Reverse Vacuum]
type = Helper
trigger1 = (Time%3) = 0
name = "Reverse Vacuum"
pos = 0, 0
postype = p1
stateno = 9015
helpertype = normal
facing = 1 ;ifelse(random >= 500, 1, -1)
ignorehitpause = 1
size.ground.back = 1
size.ground.front = 1
size.air.back = 1
size.air.front = 1

[State 9000, Reverse Vacuum]
type = Helper
trigger1 = (Time%3) = 0
name = "Reverse Vacuum"
pos = 0, 0
postype = p1
stateno = 9015
helpertype = normal
facing = -1 ;ifelse(random >= 500, 1, -1)
ignorehitpause = 1
size.ground.back = 1
size.ground.front = 1
size.air.back = 1
size.air.front = 1

[State 9000, LifeAdd]
type = LifeAdd
trigger1 = (Time%2) = 0
value = 5

; This "invisible" projectile will "slow down" any projectiles. Thanks to [E] for the suggestion.
[State 9000, Projectile]
type = Projectile
trigger1 = (Time&25) = 0
projanim = 9010
offset = 0,0
velocity = 1, 0
projpriority = 1
projremovetime = 25
; HitDef part of projectile info
attr = S, HP
sparkno = -1
guard.sparkno = -1

[State 9000, ChangeState]
type = ChangeState
trigger1 = life = const(data.life)
value = 0
ctrl = 1

;===========================
; Resurrection Helper States
;===========================

[Statedef 9010]

[State 9010, Invisible]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State 9010, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 9010, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 9010, Bind]
type = BindToParent
trigger1 = 1

[State 9010, DestroySelf]
type = DestroySelf
triggerall = parent, life <= 0
trigger1 = (parent, power < 1000) || (parent, var(0) = 1)

;===============
; Reverse Vacuum
;===============

[Statedef 9015]
;type? ? = A
anim = 9015

[State 9015, VarRandom]
type = VarRandom
trigger1 = Time = 0
v = 8
range = 1,5

[State 9015, VelSet]
type = VelSet
trigger1 = Time = 0
x = 5 * (3 * var(8)) + 10? ;30

[State 4015, PlayerPush]
type = PlayerPush
trigger1 = p2bodydist X >= 1
value = 1

[State 9015, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 9015, DestoySelf]
type = DestroySelf
trigger1 = Time > 20
Last Edit: November 07, 2007, 11:51:36 pm by DavidGee
Rotation Effect
#26  May 29, 2005, 06:22:36 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 = VarSet
trigger1 = Time = 0 ;Adjust as you wish.
fv = 0
value = 0

0 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 = VarSet
trigger1 = Time = 0 ;Adjust as you wish.
fv = 1
value = .2

The 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 = VarSet
trigger1 = 1
fv = 2
value = 1 ;Can be .5, .2, or even an expresion.

;This is the X stretch of the move.
[State 9000, VarSet]
type = VarSet
trigger1 = 1
fv = 3
value = 1

What'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 = VarAdd
trigger1 = Time > 0 ;Adjust as you wish.
fv = 0
value = FVar(1)

;This sets the helper's position, relative to its parent.
[State 9000, BindToParent]
type = BindToParent
trigger1 = 1
facing = 1
time = 1
pos = 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 = AngleSet
trigger1 = 1
Value = FVar(0)*2pi ;Angle must be given on degrees.

[State 9000, AngleDraw]
type = AngleDraw
trigger1 = 1

Use 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 = SprPriority
trigger1 = 1
value = IfElse((Fvar(0)/Pi)%2,3,-1)

;Use this to release the helper, in case you need to..
[State 9000, ChangeState]
type = Changestate
trigger1 = Parent, Command = "release"
value = 9001

In state 9001, it can be anything that you make the helper do, so I'll leave you at that. =)

Last Edit: November 07, 2007, 11:52:52 pm by DavidGee
High Jump (SNK Style)
#27  May 29, 2005, 06:30:38 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 = ChangeState
trigger1 = (Command = "High Jump") && (AnimTime = 0)
value = 9000

State 9000 will be your character's high jump state:

[Statedef 9000]
type = A
movetype = I
physics = A

[State 9000, VelSet]
type = VelSet
trigger1 = Time = 0
x = * ;Length of high jump (Must be greater than Y)
y = * height of high jump (Must be lesser than X)

[State 9000, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 0
value = IfElse((Vel x) = 0, 41, IfElse((Vel X) > 0, 42, 43))

[State 9000: ChangeAnim]
type = ChangeAnim
trigger1 = Vel Y > -2 && SelfAnimExist(Anim + 3)
persistent = 0
value = Anim + 3

[State 9000, ChangeState]
type = ChangeState
trigger1 = Pos Y >= 1
value = 52
Last Edit: November 08, 2007, 12:12:55 am by DavidGee
Special KO Effect
#28  May 29, 2005, 06:52:07 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 = VarSet
trigger1 = !WinKO
v = 0
value = 0
ignorehitpause = 1

;Special KO Effect Switch ON
[State -2: VarSet]
type = VarSet
trigger1 = (WinKO) && (Var(0) = 0) && (StateNo >= 700) ;Adjust as you wish.
v = 0
value = 1
ignorehitpause = 1

;Special KO Effect timer. (To prevent repetiveness)
[State -2: VarAdd]
type = VarAdd
trigger1 = Var(0) > 0
v = 0
value = 1
ignorehitpause = 1

This is one example of how a special KO effect can be done.

;Remove life bars during effects.
[State -2: AssertSpecial]
type = AssertSpecial
trigger1 = (Var(0) = 1) && (StateNo >= 700) ;Adjust as you wish.
flag = NoBarDisplay
flag2 = NoFG
ignorehitpause   = 1

;The effect itself
[State -2: Explod]
type = Explod
trigger1 = (Var(0) = 2) && (NumExplod(9000) = 0) && (StateNo >= 700) ;Adjust as you wish.
id = 9000
ignorehitpause = 1
; (etc...)
Last Edit: November 07, 2007, 11:54:22 pm by DavidGee
Self Dizzy State (Stun Meter)
#29  May 29, 2005, 07:00:07 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 = S
physics = S
movetype = H
ctrl = 0

[State 9000, Change Animation]
type = ChangeAnim
trigger1 = Time = 0
value = 5300

[State 9000, Button Jam]
type = ChangeState
triggerall = Random <= 500
trigger1 = (command = "a") || (command = "b") || (command = "c")
trigger2 = (command = "x") || (command = "y") || (command = "z")
value = 9001

[State 9000, Next]
type = ChangeState
trigger1 = Time = 30
value = 9001


Next dizzy state.


[Statedef 9001]
type = S
physics = S
movetype = H
ctrl = 0

[State 9001, Flash]
type = PalFX
trigger1 = Time = 0
time = 2
add = 50,50,50
mul = 300,300,300

[State 9001, Button Jam]
type = ChangeState
triggerall = Random <= 500
trigger1 = (command = "a") || (command = "b") || (command = "c")
trigger2 = (command = "x") || (command = "y") || (command = "z")
value = 9002

[State 9001, Next]
type = ChangeState
trigger1 = Time = 30
value = 9002

...and the next.


[Statedef 9002]
type = S
physics = S
movetype = H
ctrl = 0

[State 9002, Flash]
type = PalFX
trigger1 = Time = 0
time = 2
add = 50,50,50
mul = 300,300,300

[State 9002, Button Jam]
type = ChangeState
triggerall = Random <= 500
trigger1 = (command = "a") || (command = "b") || (command = "c")
trigger2 = (command = "x") || (command = "y") || (command = "z")
value = 9003

[State 9002, Next]
type = ChangeState
trigger1 = Time = 30
value = 9003

This 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 = S
physics = S
movetype = H
ctrl = 0

[State 9003, Flash]
type = PalFX
trigger1 = (!Time)
time = 2
add = 50,50,50
mul = 300,300,300

[State 9003, Button Jam]
type = ChangeState
triggerall = (Random <= 500)
trigger1 = (Command = "a") || (Command = "b") || (Command = "c")
trigger2 = (Command = "x") || (Command = "y") || (Command = "z")
value = 0

[State 9003, Undizzy]
type = SelfState
trigger1 = (Time = 30)
value = 0
ctrl = 1

Being 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 = S
movetype = H
physics = N
ctrl = 0

[State 9010: NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 9010: VarSet]
type = VarSet
trigger1 = (!Time)
v = 10
value = 0

[State 9010: ChangeState]
type = ChangeState
trigger1 = (HitShakeOver)
value = 9011

This is the character's state where he/she is being knocked out when the stun meter has reached it's limit.

[Statedef 9011]
type = A
movetype = H
physics = N
anim = 9011
ctrl = 0
velset = -3, -4

[State 9011: VelAdd]
type = VelAdd
trigger1 = (Pos Y < 0)
y = 0.35

[State 9011: NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 9011: ChangeState]
type = ChangeState
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value = 9012

This is the character's getting up state when being knocked out. He/She will end up dizzy.

[Statedef 9012]
type = S
movetype = H
physics = S
anim = 5110
ctrl = 0

[State 9012: VelSet]
type = VelSet
trigger1 = (!Time)
Y = 0

[State 9012: NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 9012: ChangeAnim]
type = ChangeAnim
trigger1 = (Time = 25)
value = 5120

[State 9012: ChangeState]
type = ChangeState
trigger1 = (AnimTime = 0) && (Anim = 5120)
value = 9000

Now, 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 = VarAdd
triggerall = (Time = 2)
trigger1 = ((StateNo = 5001) && (Anim = 5000)) || (StateNo = 5001) && (Anim = 5010)) || ((StateNo = 5011) && (Anim = 5020))
persistent = 0
ignorehitpause = 1
v = 0
value = 10

[State -3: VarAdd]
type = VarAdd
triggerall = (Time = 4)
trigger1 = ((StateNo = 5001) && (Anim = 5001)) || ((StateNo = 5001) && (Anim = 5011)) || ((StateNo = 5011) && (Anim = 5021))
persistent = 0
ignorehitpause = 1
v = 0
value = 40

[State -3: VarAdd]
type = VarAdd
triggerall = (Time = 6)
trigger1 = ((StateNo = 5001) && (Anim = 5002)) || ((StateNo = 5001) && (Anim = 5012)) || ((StateNo = 5011) && (Anim = 5022))
persistent = 0
ignorehitpause = 1
v = 0
value = 100

This is used to recover the stun meter when the character is not hit.

[State -3: VarAdd]
type = VarAdd
trigger1 = (Var(0) > 0)
ignorehitpause = 1
v = 0
value = -1

Finally, 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 = ChangeState
trigger1 = (Var(0) >= 400) && (StateNo != [9000,9003])
value = 9010
ignorehitpause = 1
Last Edit: November 07, 2007, 11:55:37 pm by DavidGee
Number System
#30  May 29, 2005, 05:25:05 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 = VarRangeSet
trigger1 = Time = 0
value = 0 ; Reset the Vars that we need
first = 1
last = 3

[State a, 1]
type = VarSet
trigger1 = Time = 0 && Var(0) > 99 ; Make sure Var(0) has 3 digits
Var(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 = VarSet
trigger1 = Time = 0 && Var(0) > 9 ; make sure Var(0) has 2 digits
Var(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 = VarSet
trigger1 = Time = 0
Var(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 = Explod
trigger1 = (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 = Explod
trigger1 = (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 = Explod
trigger1 = (whatever)
anim = (AIR group number of sprite "0") + Var(3)
postype = (whatever)
pos = (x) + (width of sprite) + (width of sprite), (y) ; last position
Last Edit: November 07, 2007, 11:59:39 pm by DavidGee
Projectile Charge (Mobile Version)
#31  May 29, 2005, 08:01:05 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 = VarAdd
trigger1 = command = "holdx"
var(0) = 1
ignorehitpause = 1

[State -3]
type = VarSet
trigger1 = (stateno = [9000,9001]) || (stateno = [9010,9011]) || (movetype = H && command != "holdx")
var(0) = 0

[State -3]
type = ChangeState
trigger1 = (command != "holdx") && (var(0) = [0,50]) && (ctrl) && (statetype != A)
value = 9000 ;On the ground (Weak effect)

[State -3]
type = ChangeState
trigger1 = (command != "holdx") && (var(0) > 50) && (ctrl) && (statetype != A)
value = 9001 ;On the ground (Strong effect)

[State -3]
type = ChangeState
trigger1 = (command != "holdx") && (var(0) = [0,50]) && (ctrl) && (statetype = A)
value = 9010 ;In the air (Weak effect)

[State -3]
type = ChangeState
trigger1 = (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. :)
Last Edit: November 08, 2007, 12:04:17 am by DavidGee
Teleportation
#32  May 29, 2005, 08:04:26 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 Teleportation

This particular code can be controlled with the directional keys.

[Statedef 9000]

[State 9000, PlaySnd]
type = PlaySnd
trigger1 = (whatever)
value = *,*

[State 9000, PosSet]
type = PosSet
trigger1 = Pos Y > 0
y = 0

[State 9000, PosAddFwd]
type = PosAdd
triggerall = 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 = PosAdd
triggerall = 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 = PosAdd
triggerall = Time = *** ;Time to teleport.
trigger1 = (command = "holdup") && (command != "holdfwd") && (command != "holdback") && (command != "holddown")
x = 0
y = * ;Must be a negative value.

[State 9000, PosAddDown]
type = PosAdd
triggerall = Time = *** ;Time to teleport.
trigger1 = (command = "holddown") && (command != "holdfwd") && (command != "holdback") && (command != "holdup")
x = 0
y = * ;Must be a positive value.

[State 9000, PosAddFwdUp]
type = PosAdd
triggerall = 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 = PosAdd
triggerall = 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 = PosAdd
triggerall = 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 = PosAdd
triggerall = 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 = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

2.) Non-Fixed Teleportation: Teleportation is determined by the opponent's position (as an example...).

[Statedef 9000]

[State 9000, PlaySnd]
type = PlaySnd
trigger1 = (whatever)
value = *,*

[State 9000, PosAdd]
type = PosAdd
trigger1 = (whatever)
x = (P2Dist X) + *
y = (P2dist Y) + *

[State 9000, End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

The "+ *" 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.
Last Edit: November 08, 2007, 12:05:10 am by DavidGee
Time - Slow Down
#33  May 29, 2005, 08:08:07 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 = Pause
triggerall = (GameTime%3) = 0
trigger1 = ;[Insert trigger here.]
time = 1
movetime = 1
ignorehitpause = 1

If 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.
Last Edit: November 08, 2007, 12:10:30 am by DavidGee
Countdown Timer
#34  May 29, 2005, 08:10:38 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 = VarSet
trigger1 = (whatever)
v = 0
value = 1000 ; Timer value

Next, the -2 state, for the count down:

[State -2, CountDown]
type = VarAdd
trigger1 = Var(0) > 0
var(0) = -1
ignorehitpause = 1
Last Edit: November 08, 2007, 12:09:55 am by DavidGee
Flying
#35  May 29, 2005, 08:13:24 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
Flying: Idainaru Densetsu Style

The 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 = A
movetype = I
physics = N
anim = ****

[State ****: VarSet]
type = VarSet
trigger1 = (!Time)
var(0) = 1

[State ****: VelSet]
type = VelSet
trigger1 = (Time > 10)
y = -6

[State ****: VelAdd]
type = VelAdd
trigger1 = (Time? > 10) && (Time, < 30) && (Vel Y < -1)
y = 0.40

[State ****: ChangeState]
type = ChangeState
trigger1 = (Time > 30)
value = ***1

The flying state, when character is idle.

[Statedef ***1]
type = A
movetype = I
physics = N
anim = ***1
velset = 0,0
ctrl = 1

[State ***1: Turn]
type = Turn
trigger1 = (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 = Null
trigger1 = (!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 = VarAdd
trigger1 = 1
var(1) = IfElse(Var(2) = 0,1,-1)

[State ***1: VelAdd]
type = VelAdd
trigger1 = 1
y = IfElse(Var(2) = 1,0.05,-0.05)

; ***2 is the moving towards state, and ***3 for away.

[State ***1: ChangeState]
type = ChangeState
trigger1 = (Command = "holdup") || (Command = "holdfwd")
value = ***2

[State ***1: ChangeState]
type = ChangeState
trigger1 = (Command = "holddown") || (Command = "holdback")
value = ***3[/code]

Flying towards state.

[code][Statedef ***2]
type = A
movetype = I
physics = N
anim = ***2
ctrl = 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 = Null
trigger1 = (!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 = VelSet
trigger1 = (Whatever)
x = FVar(0)
y = FVar(1)

; Go back to the idle state when commands are released.

[State ***2: ChangeState]
type = ChangeState
trigger1 = (Command != "holdfwd") && (Command != "holdup")
value = ***1

Flying away state.

[Statedef ***3]
type = A
movetype = I
physics = N
anim = ***3
ctrl = 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 = AssertSpecial
trigger1 = 1
flag = NoAirGuard
ignorehitpause = 1

[State ***3: Null]
type = Null
trigger1 = (!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 = VelSet
trigger1? = (Whatever)
x = (FVar(0)*(-1))
y = (FVar(1)*(-1))

[State ***3: ChangeState]
type = ChangeState
trigger1 = (Command != "holdback") && (Command != "holddown")
value = ***1
Last Edit: November 08, 2007, 12:11:44 am by DavidGee
High Jump (VS Style)
#36  May 29, 2005, 08:18:51 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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? ? = A
physics = N
velset = 0,-11
ctrl = 0

[State 9000, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 9000, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = *,*

[state 9000, CtrlSet]
type = CtrlSet
trigger1 = Time >= 1
value = 1

[state 9000, VelSetFwd]
type = VelSet
trigger1 = command = "holdfwd"
x = 3

[state 9000, VelSetBack]
type = VelSet
trigger1 = command = "holdback"
x = -3

[state 9000, VelAdd]
type = VelAdd
trigger1 = Time > 10
x = 0
y = .40

[state 9000, End]
type = ChangeState
trigger1 = Pos Y >= 1
value = 52
ctrl
Last Edit: November 08, 2007, 12:14:57 am by DavidGee
High Jump (VS Style)
#37  May 29, 2005, 08:21:36 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
Method 2 of creating Versus super jumps:

  • Requires a variable
  • Is 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 = A
physics = S
ctrl = 0
anim = 40

[State 9000, VarSet]
type = VarSet
trigger1 = Time = 0
var(10) = 1

[State 9000, VelSet]
type = VelSet
trigger1 = AnimTime = 0
x = 0
y = -11

[State 9000, PlaySnd]
type = PlaySnd
trigger1 = AnimTime = 0
value = *,*

[State 9000, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

2.) Overridden states:

; Jump Up
[Statedef 50]
type = A
physics = A

[State 50, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 50, VelAdd]
type = VelAdd
trigger1 = (Vel X < 3.25) && (Var(0) = 1) && (Command = "holdfwd") && (Command != "holdback")
x = .45

[State 50, VelAdd]
type = VelAdd
trigger1 = (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 = ChangeAnim
trigger1 = Time = 0
value = ifelse((vel x)=0, ((var(0) * 10000) + 41), ifelse((vel x)>0, ((var(0) * 10000) + 42), ((var(0) * 10000) + 43)))

[State 50, 3]
type = ChangeAnim
trigger1 = Anim = [41,43]
trigger1 = AnimTime = 0
;trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3

So that you don't retain super jump movement capabilities:


; -[ Super Jump Control ]-
[State -2]
type = VarSet
trigger1 = StateType != A
var(0) = 0

:) Enjoy.
Last Edit: November 08, 2007, 12:15:41 am by DavidGee
Tag Team
#38  May 29, 2005, 08:27:20 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 = A
movetype = A
physics = N
anim = 9000
ctrl = 0

;Screen will iIgnore your character as the switch is made.
[State 9000, ScreenBound]
type = ScreenBound
trigger1 = Time <= 5
value = 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 = Helper
trigger1 = Time = 0
stateno = 9001
postype = p1
pos = 0,0
ownpal = 1

;XY Position to put character into, for an illusion effect
of jumping in. (Facing to the right.)
[State 9000, PosSet]
type = PosSet
trigger1 = (Facing = 1) && (Time = 1)
x = -150
y = -75

;XY Position to put character into, for an illusion effect
of jumping in. (Facing to the left.)
[State 9000, PosSet]
type = PosSet
trigger1 = (Facing = -1) && (Time = 1)
x = 150
y = -75

;Jumping in velocity.
[State 9000, VelSet]
type = VelSet
trigger1 = Time = 1
x = 14
y = 3.5

;Adjust according to your preferences. (This is Sunboy's original values!!)
[State 9000, HitDef]
type = HitDef
trigger1 = (whatever)
attr = A, NA
animtype = Hard
damage = 30
sparkxy = 0, -24
hitflag = MAFD
guardflag = MA
pausetime = 10,10
;hitsound =
;guardsound =
ground.type = High
ground.slidetime = 8
ground.hittime = 20
ground.velocity = -.5,-8.5
air.velocity = -.5,-8.5
fall = 1

;When you land on the ground, go to your character's taunt state.
[State 9000, ChangeState]
type = ChangeState
trigger1 = Time > 2
trigger1 = Pos Y >= -10
value = 195


Finally, the helper created from this action:

; Tagging Away
[Statedef 9001]
type = A
movetype = I
physics = N
velset = -14, -3.5
anim = 9001
ctrl = 0

[State 9001, DestroySelf]
type = DestroySelf
trigger1 = AnimTime = 0

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



Last Edit: November 08, 2007, 12:16:33 am by DavidGee
Wake-Up Attacks
#39  May 29, 2005, 08:29:04 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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 style

OR

trigger(available trigger number) = stateno = 5120 && time = [4, 9] ; Capcom style

For 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 = ChangeState
trigger1 = AnimTime = 0
value = (close hard punch state)

For the other stuff, I suggest you observe any properties of the moves of your character.
Last Edit: November 08, 2007, 12:18:34 am by DavidGee
Wall Jump
#40  May 29, 2005, 08:30:16 am
  • ***
  • I never really was on your side.
    • www.mugenguild.com/~davidgee
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. =P

All 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 = ChangeState
value = 40
triggerall = (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 = 0

The 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 = StateTypeSet
trigger1 = (StateNo = 40) && (Pos Y < 0)
statetype = A

If you want to use a custom anim to jump off the wall, you can add this as well.

[State -1: ChangeAnim]
type = ChangeAnim
trigger1 = (StateNo = 40) && (Pos Y < 0) && (!Time)
value = ****
Last Edit: November 08, 2007, 12:19:07 am by DavidGee