Posted by kiLabee
in help me undersstand this code.... MVC 8 way air-dashing (Started by kiLabee December 29, 2019, 08:51:09 pm
Board: M.U.G.E.N Development Help
Board: M.U.G.E.N Development Help
so im trying to understand how to implement the 8 way airdash code used by author="Kong & DarkWolf13-MvC2"
Editor = "REDHOT" version of magneto.
code is here below.
Code:
;Air Dash Fwd
[Statedef 110]
type = A
physics = A
sprpriority = 1
ctrl = 0 + (0*((var(37):=2) + (var(38):=20)))
anim = 730
[State 117, 1]
type = VelSet
trigger1 = time >= 1
x = 11
y = 0
[State 111, 1]
type = VelSet
trigger1 = time >= 20
x = 0
y = 0
[State 117, 2] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn
[State 110, 2]
type = CtrlSet
trigger1 = Time = 0
value = Cond((!var(1) && (PrevStateNo = [600,799])), 0, 1)
[State 102, ChangeState]
type = ChangeState
trigger1 = !var(17) && animtime = 0
anim = 57
value = 51 + (0 * ((var(37) := -1) + (var(38) := 0)))
ctrl = ctrl
[State 102, ChangeState]
type = ChangeState
trigger1 = var(17) && animtime = 0
value = 1335
;Air Dash Backward
[Statedef 111]
type = A
physics = N
sprpriority = 1
velset = 0,0
ctrl = 0 + (0*((var(37):=2) + (var(38):=20)))
anim = 731
[State 117, 1]
type = VelSet
trigger1 = time >= 1
x = -11
y = 0
[State 111, 1]
type = VelSet
trigger1 = time >= 20
x = 0
y = 0
[State 117, 2] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn
[State 110, 2]
type = CtrlSet
trigger1 = Time = 0
value = Cond((!var(1) && (PrevStateNo = [600,799])), 0, 1)
[State 102, ChangeState]
type = ChangeState
trigger1 = !var(17) && animtime = 0
anim = 57
value = 51 + (0 * ((var(37) := -1) + (var(38) := 0)))
ctrl = ctrl
[State 102, ChangeState]
type = ChangeState
trigger1 = var(17) && animtime = 0
value = 1335
;Air Dash Up
[Statedef 112]
type = A
physics = N
sprpriority = 1
velset = 0,0
ctrl = 0 + (0*((var(37):=2) + (var(38):=20)))
anim = 732
[State 117, 1]
type = VelSet
trigger1 = time >= 1
x = -0
y = -9
[State 111, 1]
type = VelSet
trigger1 = time >= 20
x = 0
y = 0
[State 117, 2] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn
[State 110, 2]
type = CtrlSet
trigger1 = Time = 0
value = Cond((!var(1) && (PrevStateNo = [600,799])), 0, 1)
[State 102, ChangeState]
type = ChangeState
trigger1 = !var(17) && animtime = 0
anim = 57
value = 51 + (0 * ((var(37) := -1) + (var(38) := 0)))
ctrl = ctrl
[State 102, ChangeState]
type = ChangeState
trigger1 = var(17) && animtime = 0
value = 1335
;Air Dash Down
[Statedef 113]
type = A
physics = N
sprpriority = 1
velset = 0,0
ctrl = 0 + (0*((var(37):=2) + (var(38):=20)))
anim = 733
[State 115, 1.1]
type = VelSet
trigger1 = Pos Y < -5
x = 0
y = 9
[State 115, 1.2]
type = VelSet
trigger1 = Pos Y >= -8
x = 0
y = 0
[State 111, 1]
type = VelSet
triggerall = Pos Y >= -255
trigger1 = time >= 20
x = 0
y = 0
[State 117, 2] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn
[State 110, 2]
type = CtrlSet
trigger1 = Time = 0
value = Cond((!var(1) && (PrevStateNo = [600,799])), 0, 1)
[State 102, ChangeState]
type = ChangeState
trigger1 = !var(17) && animtime = 0
anim = 57
value = 51 + (0 * ((var(37) := -1) + (var(38) := 0)))
ctrl = ctrl
[State 102, ChangeState]
type = ChangeState
trigger1 = var(17) && animtime = 0
value = 1335
;Air Dash Fwd Up
[Statedef 114]
type = A
physics = N
sprpriority = 1
velset = 0,0
ctrl = 0 + (0*((var(37):=2) + (var(38):=20)))
anim = 734
[State 117, 1]
type = VelSet
trigger1 = time >= 1
x = 11
y = -6.5
[State 111, 1]
type = VelSet
trigger1 = time >= 20
x = 0
y = 0
[State 117, 2] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn
[State 110, 2]
type = CtrlSet
trigger1 = Time = 0
value = Cond((!var(1) && (PrevStateNo = [600,799])), 0, 1)
[State 102, ChangeState]
type = ChangeState
trigger1 = !var(17) && animtime = 0
anim = 57
value = 51 + (0 * ((var(37) := -1) + (var(38) := 0)))
ctrl = ctrl
[State 102, ChangeState]
type = ChangeState
trigger1 = var(17) && animtime = 0
value = 1335
;Air Dash Fwd Down
[Statedef 115]
type = A
physics = N
sprpriority = 1
velset = 0,0
ctrl = 0 + (0*((var(37):=2) + (var(38):=20)))
anim = 735
[State 114, 1.1]
type = VelSet
trigger1 = Pos Y < -5
x = 11
y = 6.5
[State 114, 1.2]
type = VelSet
trigger1 = Pos Y >= -9
x = 9
y = 0
[State 111, 1]
type = VelSet
triggerall = Pos Y >= -255
trigger1 = time >= 20
x = 0
y = 0
[State 117, 2] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn
[State 110, 2]
type = CtrlSet
trigger1 = Time = 0
value = Cond((!var(1) && (PrevStateNo = [600,799])), 0, 1)
[State 102, ChangeState]
type = ChangeState
trigger1 = !var(17) && animtime = 0
anim = 57
value = 51 + (0 * ((var(37) := -1) + (var(38) := 0)))
ctrl = ctrl
[State 102, ChangeState]
type = ChangeState
trigger1 = var(17) && animtime = 0
value = 1335
;Air Dash Back Up
[Statedef 116]
type = A
physics = N
sprpriority = 1
velset = 0,0
ctrl = 0 + (0*((var(37):=2) + (var(38):=20)))
anim = 736
[State 117, 1]
type = VelSet
trigger1 = time >= 1
x = -11
y = -6.5
[State 111, 1]
type = VelSet
trigger1 = time >= 20
x = 0
y = 0
[State 117, 2] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn
[State 110, 2]
type = CtrlSet
trigger1 = Time = 0
value = Cond((!var(1) && (PrevStateNo = [600,799])), 0, 1)
[State 102, ChangeState]
type = ChangeState
trigger1 = !var(17) && animtime = 0
anim = 57
value = 51 + (0 * ((var(37) := -1) + (var(38) := 0)))
ctrl = ctrl
[State 102, ChangeState]
type = ChangeState
trigger1 = var(17) && animtime = 0
value = 1335
;Air Dash Back Down
[Statedef 117]
type = A
physics = N
sprpriority = 1
velset = 0,0
ctrl = 0 + (0*((var(37):=2) + (var(38):=20)))
anim = 737
[State 114, 1.1]
type = VelSet
trigger1 = Pos Y < -5
x = -11
y = 6.5
[State 114, 1.2]
type = VelSet
trigger1 = Pos Y >= -9
x = -9
y = 0
[State 111, 1]
type = VelSet
triggerall = Pos Y >= -255
trigger1 = time >= 20
x = 0
y = 0
[State 117, 2] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn
[State 110, 2]
type = CtrlSet
trigger1 = Time = 0
value = Cond((!var(1) && (PrevStateNo = [600,799])), 0, 1)
[State 102, ChangeState]
type = ChangeState
trigger1 = !var(17) && animtime = 0
anim = 57
value = 51 + (0 * ((var(37) := -1) + (var(38) := 0)))
ctrl = ctrl
[State 102, ChangeState]
type = ChangeState
trigger1 = var(17) && animtime = 0
value = 1335
; HIT_FALLRECOVER (on the ground)
[Statedef 5201]
type = C
movetype= H
physics = N
anim = ifelse(prevstateno=5200,5200,5201)
facep2 = 1
sprpriority = -1
[State 5201, PosSet]
type = PosSet
trigger1 = time = 0
y = 0
[State 5201, VelSet]
type = VelSet
trigger1 = time = 0
x = ifelse(anim=5200,8,-4)
y = 0
[State 5201, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
[State 5201, PlayerPush]
type = PlayerPush
trigger1 = anim = 5200
value = 0
[State 5201, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1
so i am trying to understand what the code is doing and i have a few questions obviously,
1. how does one read/ interpret what this is?
there are a bunch of variables included in the code.
help me identify and understand what each variable does if someone here is more experienced in variable usage.
2. in this code the final changestate for the dash is "changestate =1335"
i look it up and here is 1335
Code:
[Statedef 1335]
type = A
movetype = I
physics = N
ctrl = 0
anim = 0
velset = 0,0
sprpriority = 2
[State 0, 2]
type = Helper
trigger1 = NumHelper(6000) = 0
stateno = 6000
id = 6000
[State 855, PosAdd]
type = PosAdd
trigger1 = pos y < -170
y = 10
[State 855, PosAdd]
type = PosAdd
trigger1 = pos y > -30
y = -10
[State 20, Turn]
type = Turn
trigger1 = (enemy,pos x-pos x)*facing < -5
[State 20, VelSet]
type = VelSet
trigger1 = 1
x = 0
y = 0
[State 20, VelSet]
type = VelSet
trigger1 = command = "holdfwd"
x = ifelse(command!="holdup"&&command!="holddown",1,1)
[State 20, VelSet]
type = VelSet
trigger1 = command = "holdback"
x = ifelse(command!="holdup"&&command!="holddown",-1,-1)
[State 20, VelSet]
type = VelSet
trigger1 = command = "holdup"
y = ifelse(command!="holdfwd"&&command!="holdback",-1,-1)
[State 20, VelSet]
type = VelSet
trigger1 = command = "holddown"
y = ifelse(command!="holdfwd"&&command!="holdback",1,1)
[State 855, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 0
trigger1 = command != "holdfwd" &&command != "holdback" && command != "holdup"
value = 0
[State 855, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 1336
trigger1 = command = "holdup"
value = 1336
[State 855, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 1335
trigger1 = command = "holddown"
value = 1335
[State 855, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 1331
trigger1 = command = "holdfwd" && command!="holdup" && command!="holddown"
value = 1331
[State 855, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 1337
trigger1 = command = "holdfwd" && command="holdup" && !command="holddown"
value = 1337
[State 855, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 1334
trigger1 = command = "holdfwd" && !command="holdup" && command="holddown"
value = 1334
[State 855, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 1332
trigger1 = command = "holdback" && command!="holdup" && command!="holddown"
value = 1332
[State 855, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 1338
trigger1 = command = "holdback" && command="holdup" && command!="holddown"
value = 1338
[State 855, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 1339
trigger1 = command = "holdback" && command!="holdup" && command="holddown"
value = 1339
[State 855, ChangeState]
type = ChangeState
trigger1 = var(17) = 0
value = 1336
[Statedef 1336]
type = A
movetype = I
physics = A
ctrl = 0
anim = 57
velset = 0,0
sprpriority = 2
[State 856, VarSet]
type = VarSet
trigger1 = time = 0
var(17) = 0
what is going on in here and how does this pertain to making the 8 way dash work?