Greetings all,
I'm assisting a creator in making a character. The character is supposed to fly. He's been able to figure out some of the code to get the character to fly and attack in the air; however, he wants to add to the code to make the character come down after re-entering the flying command? What does he need to add?
Here's the code:
From CMD:
;-------------------------------------------------------------------------
;Fly
[Command]
name = "Fly"
command = ~D,DB,B, a
[Command]
name = "Fly"
command = ~D,DB,B, a
[Command]
name = "Fly"
command = ~D,DB,B, a
;---------------------------------------------------------------------------
;Commands
;---------------------------------------------------------------------------
[Statedef -1]
;---------------------------------------------------------------------------
;Fly
[State -1]
type = Changestate
trigger1 = command = "Fly"
trigger1 = statetype = S
trigger1 = ctrl = 1
value = 4999
[State -1]
type = Changestate
trigger1 = command = "Fly"
trigger1 = statetype = A
trigger1 = ctrl = 1
value = 4999
------------------------------------------------------------------
From the CNS:
[Statedef 4999]
type = S
movetype= I
physics = S
anim =41
ctrl = 0
[State 4999, 1]
type = Explod
trigger1 = Time = 1
trigger1 = statetype != A
anim = F62
pos= 0,0
postype= p1
sprpriority = 3
[State 4999, 2]
type = PlaySnd
trigger1 = Time = 0
value = 6, 3
[State 5000, stand in the air]
type = Velset
trigger1= time = 0
y=-9
[State 5000, define var]
type = Varset
trigger1= time = 0
v = 4
value = 0
[State 5000, stand in the air]
type = Changestate
trigger1= time = 10
value = 4998
;===============================================================================
;Flying
;===============================================================================
[Statedef 4998]
type = A
movetype= I
physics = A
ctrl = 0
[State 5000, 0]
type = Varset
trigger1 = time = 0
v=5
value = 5000
[State 5000, stand in the air]
type = Changeanim
trigger1= vel x =0
trigger1= vel y >= 0
trigger1= anim != 6000
value = 6000
[State 5000, stop in the air]
type = Velset
trigger1= command != "holdfwd"
trigger1= command != "holdback"
trigger1= command != "holdup"
trigger1= command != "holddown"
x=0
y=0
[State 5000, stand in the air]
type = Velset
trigger1= command = "holdfwd"
trigger2= command = "holdback"
y=0
[State 5000, stand in the air]
type = Velset
trigger1= command = "holdup"
trigger2= command = "holddown"
x=0
[State 5000, to turn aroud]
type = Turn
trigger1 = p2dist X < -5
[State 5000, fly forward]
type = Velset
trigger1= command = "holdfwd"
x = 4.3
[State 5000, fly back]
type = Velset
trigger1= command = "holdback"
x = -4.3
[State 5000, fly up]
type = Velset
trigger1= command = "holdup"
trigger1= command != "holdback"
trigger1= command != "holdfwd"
trigger1= pos y > -220
y = -3.5
[State 5000, fly diagonally forward and upward]
type = Velset
trigger1 = command = "holdfwd"
trigger1 = command = "holdup"
x = 4.3
y = -3.5
[State 5000, fly diagonally up and back]
type = Velset
trigger1 = command = "holdback"
trigger1 = command = "holdup"
x = -4.3
y = -3.5
[State 5000, stop flying up]
type = Velset
trigger1= command = "holdup" || command != "holdback" || command != "holdfwd"
trigger1= pos y < -220
y=0
[State 5000, stop flying up]
type = Velset
trigger1= command = "holdup" || command = "holdfwd" || command != "holdback"
trigger1= pos y < -220
y=0
[State 5000, fly down]
type = Velset
trigger1= command = "holddown"
trigger1= command != "holdback"
trigger1= command != "holdfwd"
trigger1= pos y <= -40
y = 2.9
[State 5000, fly back down diagonal]
type = Velset
trigger1= command = "holddown"
trigger1= command = "holdback"
trigger1= pos y <= -40
x = -4.3
y = 2.9
[State 5000, fly diagonal front low]
type = Velset
trigger1= command = "holddown"
trigger1= command = "holdfwd"
trigger1= pos y <= -40
x = 4.3
y = 2.9
[State 5000, stop flying down]
type = Velset
trigger1= command = "holddown"
trigger1= pos y >= -40
y=0
[State 5000, fly up]
type = Changeanim
trigger1= vel y < 0
trigger1= pos y >= -220
trigger1= command != "holdfwd"
trigger1= command != "holddown"
trigger1= command != "holdback"
trigger1= command = "holdup"
trigger1= anim != 6003
value = 6003
[State 5000, fly forward]
type = Changeanim
trigger1 = command = "holdfwd"
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger1= anim != 6001
value = 6001
[State 5000, fly diagonally up front]
type = ChangeAnim
trigger1 = command = "holdfwd" && command = "holdup"
trigger1 = command != "holddown"
trigger1 = anim != 6004
value = 6004
[State 5000, fly back]
type = Changeanim
trigger1 = command = "holdback"
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger1 = anim != 6002
value = 6002
[State 5000, fly diagonally backwards up]
type = Changeanim
trigger1 = command = "holdup"
trigger1 = command = "holdback"
trigger1 = command != "holddown"
trigger1 = anim != 6002
value = 6002
[State 5000, fly down]
type = Changeanim
trigger1= vel y > 0
trigger1= anim != 6000
trigger1 = command != "holddown"
value = 6000
[State 5000, fly back down diagonal]
type = Changeanim
trigger1= command = "holddown"
trigger1= command = "holdback"
trigger1 = anim != 6002
value = 6002
[State 5000, fly diagonal front low]
type = Changeanim
trigger1= command = "holddown"
trigger1= command = "holdfwd"
trigger1 = anim != 6001
value = 6001
[State 5000, Manual order]
type = VarSet
trigger1 = command = "Fly"
trigger2 = command = "Fly"
trigger3 = command = "Fly"
v = 4
value = 458
[State 5000, Land if fight ends]
type = Changestate
trigger1 = Win = 1
trigger2 = lose = 1
value = 50
[State 5000, weak punch]
type = ChangeState
value = 6010
trigger1= command = "x"
[State 5000, medium punch]
type = ChangeState
value = 6011
trigger1 = command = "y"
[State 5000, strong punch]
type = ChangeState
value = 6012
trigger1 = command = "z"
[State 5000, weak kick]
type = Changestate
trigger1= command = "a"
value = 6013
[State 5000, medium kick]
type = ChangeState
value = 6014
trigger1= command = "b"
[State 5000, strong kick]
type = ChangeState
value = 6015
trigger1= command = "c"
[State 5000, land]
type = ChangeState
trigger1 = AnimTime = 0
trigger1 = Var(5) != 5000
value = 50
;-------------------------------------------------------------------------------
;Flying light punch
[Statedef 6010]
type = A
movetype= A
physics = N
juggle = 4
ctrl = 0
anim = 6010
poweradd = 15
sprpriority = 2
velset = vel x, 0
[State 6010, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = 8400,0
[State 6010, HitDef]
type = HitDef
trigger1 = time = 0
attr = A,NA
damage = 15,1
givepower = 15
getpower = 20
animtype = Light
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11,11
sparkno = s7710
sparkxy = -10, -63
guard.sparkno = s6767
hitsound = s8000,0
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime = 25
ground.velocity = -6
air.fall = 0
air.velocity = -3.2, -10.5
[State 6010, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = prevstateno
;-------------------------------------------------------------------------------
;Flying medium punch
[Statedef 6011]
type = A
movetype= A
physics = N
juggle = 4
ctrl = 0
anim = 6011
poweradd = 35
sprpriority = 2
[State 6011, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = 8400,1
[State 6011, HitDef]
type = HitDef
trigger1 = time = 0
attr = A,NA
damage = 35,1
givepower = 30
getpower = 40
animtype = medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11,11
sparkno = s7711
sparkxy = -10,-68
guard.sparkno = s6767
hitsound = s8000,1
guardsound = 6,0
ground.type = High
ground.slidetime = 25
ground.hittime = 20
ground.velocity = -8
air.fall = 0
air.velocity = -3.2, -7.5
[State 6011, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = prevstateno
;-------------------------------------------------------------------------------
;Flying strong punch
[Statedef 6012]
type = A
movetype= A
physics = N
juggle = 4
ctrl = 0
anim = 6012
poweradd = 55
sprpriority = 2
[State 6012, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = 8400,2
[State 6012, HitDef]
type = HitDef
trigger1 = time = 0
attr = A,NA
damage = 45,1
givepower = 50
getpower = 70
animtype = High
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11,11
sparkno = s7712
sparkxy = -10, -53
guard.sparkno = s6767
hitsound = s8000,2
guardsound = 6,0
ground.type = High
ground.slidetime = 18
ground.hittime = 25
ground.velocity = -10
air.velocity = -12,10
air.hittime = 25
air.fall = 1
[State 6012, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = prevstateno
;-------------------------------------------------------------------------------
;Flying light kick
[Statedef 6013]
type = A
movetype= A
physics = N
juggle = 4
ctrl = 0
anim = 6013
poweradd = 15
sprpriority = 2
[State 6013, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = 8400,0
[State 6013, HitDef]
type = HitDef
trigger1 = time = 0
attr = A,NA
damage = 15,1
givepower = 15
getpower = 20
animtype = Light
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11,11
sparkno = s7710
sparkxy = -10, -63
guard.sparkno = s6767
hitsound = s8000,3
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime = 15
ground.velocity = -6
air.fall = 0
air.velocity = -3.2, -10.5
air.hittime = 25
[State 6013, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = prevstateno
;-------------------------------------------------------------------------------
;Flying medium kick
[Statedef 6014]
type = A
movetype= A
physics = N
juggle = 4
ctrl = 0
anim = 6014
poweradd = 35
sprpriority = 2
[State 6014, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = 8400,1
[State 6014, HitDef]
type = HitDef
trigger1 = time = 0
attr = A,NA
damage = 35,1
givepower = 30
getpower = 40
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11,11
sparkno = s7711
sparkxy = -10,-68
guard.sparkno = s6767
hitsound = s8000,4
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -8
air.fall = 0
air.velocity = -3.2, -7.5
air.hittime = 25
[State 6014, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = prevstateno
;-------------------------------------------------------------------------------
;Flying strong kick
[Statedef 6015]
type = A
movetype= A
physics = N
juggle = 4
ctrl = 0
anim = 6015
poweradd = 55
sprpriority = 2
[State 6015, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = 8400,2
[State 6015, HitDef]
type = HitDef
trigger1 = time = 0
attr = A,NA
damage = 45,1
givepower = 50
getpower = 70
animtype = High
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11,11
sparkno = s7712
sparkxy = -10, -53
guard.sparkno = s6767
hitsound = s8000,5
guardsound = 6,0
ground.type = High
ground.slidetime = 18
ground.hittime = 25
ground.velocity = -10
air.velocity = -12,10
air.fall = 1
air.hittime = 25
[State 6015, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = prevstateno