Hello, I would like to know how I could add a time limit for when the character is in the air, and that when performing attacks the time does not restart, I already tried a lot of variants and state changes but either the time is restarted or it flies a few seconds and falls.
An example could be like Iron Man from Marvel vs. Capcom, who have a limited time to fly and then fall to the ground.
;----------------------------------------------------------------------------------
; go to fly mode
[statedef 1800] ;< Statedef, this is the process to go in fly from standing.
type = A ;< Make sure you use A = Air as type
movetype = A
physics = N
juggle = 0
velset = 0,0
ctrl = 0
anim = 1800 ;< Enter the anim you want
;go up (whether you are in ground or air before you went to this state, you go up)
[state 0, VelSet] ;< This is for make the character go up till the Anim ends
type = VelSet
trigger1 = 1
x = 0
y = -10
[State 100, Spark Stars]
type = Explod
trigger1 = -1
anim = 14901
postype = p1
pos = 0,-15
scale = 0.4,0.4
accel = 0, -0.3
facing = -1
vfacing = -1
sprpriority = -1
ontop = 1
ownpal = 1
bindtime = 1
pausemovetime = 20
supermovetime = 99999
persistent = 5
removetime = 13
ignorehitpause = 1
[State 1300, Super D]
type = AfterImage
trigger1 = Time = 0
trans = add
TimeGap = 1
FrameGap = 1
time = 15
length = 10
palbright = 161, 0, 252
palcontrast = 161, 0, 252
palpostbright = 140,45,140
PalAdd = 1,1,1
PalMul = .65,.65,.75
[State 410, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 100,2
[state 0, ChangeState] ;< This Change state is to go to Fly Stand state after you are flying
type = ChangeState
trigger1 = animtime = 0
value = 1806
ctrl = 1
;---------------------------------------------------------------------------
;fly stance
[statedef 1806] ;< This is fly stance
type = A ;< Make sure you use A = Air as type
movetype= I
physics = N
juggle = 0
poweradd= 0
ctrl = 0
anim = 1900 ;< here enter the number of anim which you want as Fly idle
velset = 0,0
[State -3, sense bar]
type = Explod
triggerall = animtime = 0
trigger1 = numexplod(3309)=0
anim = 3309
id = 3309
pos = 6,ifelse(var(14) = 0,214,202)+var(16)
postype = left
facing = 1;ifelse(TeamSide = 1, 1, -1)
bindtime = -1
removetime = -2
sprpriority = 92
ignorehitpause = 1
ownpal = 1
scale = 0.5,0.5
[State 1500,fuwavar(1)]
type = VarSet
trigger1 = (command != "holdfwd" && command != "holdback" && command != "holdup" && command != "holddown") && var(2) != 2
trigger2 = (var(2) = 2) && Vel Y >= 1
v = 2
value = 1
[State 1500,fuwavar(2)]
type = VarSet
triggerall = var(2) = 1
trigger1 = Vel Y <= -1
trigger2 = (P2BodyDist Y > 200)&&(Vel Y < 0)
v = 2
value = 2
[State 1500,fuwaUp]
type = VelAdd
trigger1 = var(2) = 1
y = -0.05
[State 1500,fuwaDown]
type = VelAdd
trigger1 = var(2) = 2
y = 0.05
;turn
[state 0, Turn] ;< Simple Turn, When P2's distance is X <-10
type = Turn
trigger1 = P2dist X < -10
; fly dash forward
[state 0, ChangeState] ;< This is the command for fly dash forward.
type = ChangeState
trigger1 = command = "FF"
value = 104
ctrl = 1
;fly forward ;< This is the command for fly forward.
[state 0, ChangeState]
type = ChangeState
trigger1 = command = "holdfwd"
value = 1807
ctrl = 1
;fly backward ;< This is the command for fly backward.
[state 0, ChangeState]
type = ChangeState
trigger1 = command = "holdback"
value = 1808
ctrl = 1
;fly up ;< This is the command for fly up
[state 0, ChangeState]
type = ChangeState
trigger1 = command = "holdup"
value = 1809
ctrl = 1
;fly down ;< This is the command for fly down
[state 0, ChangeState]
type = ChangeState
trigger1 = command = "holddown"
value = 1810
ctrl = 1
[State 5000, Smart Bombs]
type = Changestate
trigger1 = command = "RaiolaserF"
value = 1015
ctrl = 1
[State 5000, Caida Libre]
type = Changestate
trigger1 = (command = "y+z" && command != "holddown")
value = 650
ctrl = 1
[State 5000, Smart Bombs]
type = Changestate
trigger1 = command = "Lightning"
value = 730
ctrl = 1
[State 5000, Smart Bombs]
type = Changestate
trigger1 = command = "lightningball"
value = 3250
ctrl = 1
[State 5000, Air Uni Beam]
type = Changestate
trigger1 = command = "megaice"
value = 3950
ctrl = 1
[State 5000, Air Uni Beam]
type = Changestate
trigger1 = command = "qcf_z"
value = 717
ctrl = 1
[State 5000, weak kick]
type = Changestate
trigger1= command = "a"
value = 111903
ctrl = 1
[State 5000, medium kick]
type = ChangeState
value = 111904
trigger1= command = "b"
[State 5000, strong kick]
type = ChangeState
value = 111906
trigger1= command = "c"
[State 5000, weak punch]
type = ChangeState
value = 111901
trigger1= command = "x"
[State 5000, weak punch]
type = ChangeState
value = 219
trigger1= command = "x"
[State 5000, medium punch]
type = ChangeState
value = 111902
trigger1 = command = "y"
[State 5000, medium punch]
type = ChangeState
value = 214
trigger1 = command = "y"
[State 5000, strong punch]
type = ChangeState
value = 111905
trigger1 = command = "z"
;go back to jump/fall state ;< This is the command for jump to ground if you Won in air, you know no one will like to have the win pose in AIR
[state 0, ChangeState]
type = ChangeState
trigger1 = Win = 1
value = 50
ctrl = 1
;go back to damage fall state ;< If you get hit then this will happen.
[state 0, ChangeState]
type = ChangeState
trigger1 = Life = 0
trigger2 = roundstate = 3
value = 1040
ctrl = 1
;go back to fly land state
[state 0, ChangeState] ;< This is to come down from Fly mode
type = ChangeState
trigger1 = pos y >= 0
value = 1047
ctrl = 1
[State 0, RemoveExplod]
type = RemoveExplod
triggerall = stateno = 1806
trigger1 = numexplod(133333) > 0
id = 133333