YesNoOk
avatar

How To Prevent Special Attacks From Cancelling Flight? (Read 9445 times)

Started by Ki$@1st456v, November 02, 2021, 10:54:16 PM
Share this topic:
How To Prevent Special Attacks From Cancelling Flight?
#1  November 02, 2021, 10:54:16 PM
  • avatar
  • **
    • USA
Hi again, everyone! I know normal aerial attacks for Lilith finally worked while flying, but how do you get special attacks to come out while flying without cancelling flight? I have seen characters like Sevil Nahte who can perform midair Psycho Shots without Sevil Nahte dropping from the air. What do I add to the code of midair specials to allow that as well?

Here is Sevil Nahtes' coding for a jumping Psycho Shot below:

; Light Air Psycho Shot - Attack

[Statedef 1050]
type    = A
movetype= A
physics = N
juggle  = 0
velset = 0,0
poweradd= 35
ctrl = 0
anim = 1050
sprpriority = 2

[State 1050, 1]
type = Width
trigger1 = AnimElem = 4
value = 15

[State 1050, 2]
type = PlaySnd
trigger1 = AnimElem = 3
value = 1000,0
channel = 0

[State 1050, 3]
type = PlaySnd
trigger1 = AnimElem = 3
value = 1000,1
channel = 1

[State 1050, 4.1]
type = Helper
trigger1 = AnimElem = 4
trigger1 = P2BodyDist X > 90
helpertype = Normal
id = 1055
name = "shot"
postype = p1
pos = 50,-50
stateno = 1055
ownpal = 1

[State 1050, 4.2]
type = Helper
trigger1 = AnimElem = 4
trigger1 = P2BodyDist X <= 90
helpertype = Normal
id = 1058
name = "shot"
postype = p1
pos = 50,-50
stateno = 1055
ownpal = 1

[State 1050, 6]
type = Explod
trigger1 = Time = 0
anim = 1001
id = 1001
pos = 0,0
postype = p1
sprpriority = 3
ownpal = 1
bindtime = -1
removeongethit = 1
ignorehitpause = 1

[State 1070, 7]
type = VelAdd
trigger1 = AnimElem = 7, >= 0
y = 0.47

[State 1050, 8.1]
type = ChangeState
trigger1 = AnimElem = 7, >= 0 && Pos Y >= 0
value = 1071
ctrl = 0

[State 1050, 8.2]
type = ChangeState
trigger1 = AnimElem = 7, = 0 && Var(14) = 1
value = 730
ctrl = 0

;---------------------------------------------------------------------------
; Light Air Psycho Shot - Helper Projectile

[Statedef 1055]
type    = A
movetype= A
physics = N
ctrl = 0
anim = 1055
sprpriority = 3

[State 1055, 1.1]
type = VelSet
trigger1 = Time = 0
x = 3

[State 1055, 1.2]
type = VelAdd
trigger1 = Time >= 0
y = 0.2

[State 1055, 2]
type = AssertSpecial
trigger1 = 1
flag = NoShadow

[State 1055, 3.1]
type = HitDef
triggerall = IsHelper(1055)
trigger1 = Time >= 0
attr = A, SP
numhits = 2
damage    = 70,7
getpower = 24,6
givepower = 24,8
animtype  = Heavy
guardflag = MA
hitflag = MAFD
priority = 4, Hit
pausetime = 0,10
guard.pausetime = 0,8
guard.sparkno = S8007
sparkno = S8003
sparkxy = 0,0
hitsound   = S1000,2
guardsound = S0,1
ground.type = High
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -5
air.type = Low
air.velocity = -4,-3
air.fall = 1
envshake.time = 5
envshake.ampl = 3
fall.envshake.time = 5
fall.envshake.ampl = -3
palfx.time = 40
palfx.add = 40,40,40
palfx.mul = 100,100,100
palfx.sinadd = 80,80,80,5
palfx.color = 0

[State 1055, 3.2]
type = HitDef
triggerall = IsHelper(1058)
trigger1 = Time >= 0
attr = A, SP
numhits = 2
damage    = 80,8
getpower = 32,10
givepower = 32,12
animtype  = Heavy
guardflag = MA
hitflag = MAFD
priority = 4, Hit
pausetime = 0,10
guard.pausetime = 0,8
guard.sparkno = S8007
sparkno = S8003
sparkxy = 0,0
hitsound   = S1000,2
guardsound = S0,1
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -8
air.velocity = -6,-2
air.animtype = Back
air.juggle = 3
air.fall = 1
fall = 1
fall.recover = 0
envshake.time = 5
envshake.ampl = 3
fall.envshake.time = 5
fall.envshake.ampl = -3
palfx.time = 40
palfx.add = 40,40,40
palfx.mul = 100,100,100
palfx.sinadd = 80,80,80,5
palfx.color = 0

[State 1055, 4.1]
type = Explod
trigger1 = (MoveHit) && (P2MoveType = H) && (NumExplod(8600) < 1)
id = 8600
anim = 8603
postype = p2
pos = 0,-30
supermove = 1
ownpal = 1
sprpriority = 100
bindtime = -1
ignorehitpause = 1
persistent = 0

[State 1055, 4.2]
type = Explod
trigger1 = (MoveHit) && (P2MoveType = H) && (NumExplod(8601) < 1)
id = 8601
anim = 8603
postype = p2
pos = -20,-60
supermove = 1
ownpal = 1
sprpriority = -100
bindtime = -1
ignorehitpause = 1
persistent = 0

[State 1055, 5.1]
type = HitBy
trigger1 = 1
value = SCA, NP, SP, HP

[State 1055, 5.2]
type = HitOverride
trigger1 = Time = 0
slot = 0
time = -1
attr = SCA, AA, AT, AP, NA, NP, HP, NT, HT
stateno = 1056

[State 1055, 6.1]
type = ChangeState
trigger1 = MoveContact = 1
trigger2 = MoveType = H
trigger3 = Time >= 200
value = 1056

[State 1055, 6.2]
type = ChangeState
trigger1 = !MoveContact
trigger1 = Pos Y >= 0
value = 1057

;---------------------------------------------------------------------------
; All Air Psycho Shot - Helper Explode

[Statedef 1056]
type    = S
movetype= I
physics = N
ctrl = 0
anim = 1056
velset = 0,0

[State 1456, 2]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Light Air Psycho Shot - Helper Ground Explode

[Statedef 1057]
type    = S
movetype= A
physics = N
ctrl = 0
anim = 1057
velset = 0,0

[State 1057, 1]
type = Explod
anim = 8500
trigger1 = Time = 0
postype = P1
pos = 0,2
ownpal = 1
scale = 0.6,0.6

[State 1057, 2]
type = PlaySnd
trigger1 = Time = 0
value = 1057,1
channel = 1

[State 1057, 3]
type = EnvShake
trigger1 = Time = 0
time = 10
ampl = -5

[State 1057, 4]
type = HitDef
trigger1 = Time = 0
attr = S, SA
numhits = 2
damage = 70,7
getpower = 24,6
givepower = 24,8
animtype = Heavy
guardflag = H
hitflag = MAFD
priority = 4, Hit
pausetime = 0,12
guard.sparkno = S8007
sparkno = S8002
sparkxy = 20,-60
hitsound = S1,2
guardsound = S0,1
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5,-3
air.velocity = -3,-3
fall = 1
air.fall = 1
envshake.time = 7
envshake.ampl = 4
palfx.time = 50
palfx.add = 40,40,40
palfx.mul = 100,100,100
palfx.sinadd = 80,80,80,5
palfx.color = 0

[State 1057, 5]
type = Explod
trigger1 = (MoveHit) && (P2MoveType = H) && (NumExplod(8600) < 1)
id = 8600
anim = 8603
postype = p2
pos = 0,-30
supermove = 1
ownpal = 1
sprpriority = 100
bindtime = -1
ignorehitpause = 1
persistent = 0

[State 1057, 6]
type = Explod
trigger1 = (MoveHit) && (P2MoveType = H) && (NumExplod(8601) < 1)
id = 8601
anim = 8603
postype = p2
pos = -20,-60
supermove = 1
ownpal = 1
sprpriority = -100
bindtime = -1
ignorehitpause = 1
persistent = 0

[State 1057, 7]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------

Here is the cns for one of the midair specials

; Air Plasma Beam
[StateDef 3305]
type = A
movetype= A
physics = N
juggle  = 1
velset = Vel X/10,Vel Y/5
ctrl = 0
anim = 3305
poweradd = 80
sprpriority = -1
offset = 43,-54

[State 0, VelSet]
type = VelSet
trigger1 = Pos Y >= 0
trigger1 = Vel Y >= 0
y = 0

[state 410,3]
type = veladd
trigger1 = var(19)
y = 0
x = 0

[state 410,3]
type = velset
trigger1 = var(19)
y = 0
x = 0

[State 0, ChangeState]
type = ChangeState
triggerall = anim = 3306
trigger1 = animelem = 6 && var(19)
value = 1305

[State 0, VarSet]
type = VarSet
trigger1= !time && var(59)<=0
var(10) = ifelse(command="QCF_B",2,ifelse(command="QCF_C",1,0))

[State 1000, VarSet]
type=varset
trigger1= !time && var(59)>=1
var(10)= ifelse((p2movetype=H || random<500), 2, ifelse(random<500, 1, 0))

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3305 && AnimElem = 5
value = 3,2
volume = 255
volumescale = 255
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3305 && AnimElem = 5
value = 4,6
volume = 255
volumescale = 255

[State 0, Helper]
type = Helper
triggerall = numhelper(3305)=0
triggerall = anim = 3305
trigger1 = AnimElem = 5
helpertype = normal ;player
name = "Plasma Beam"
ID = 3305
stateno = 3315
pos = floor(18*const(size.xscale)),floor(-45*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = numhelper(3305)=0
trigger1 = Anim != 3306
trigger1 = AnimElemTime(5)>=0
value = 3306

[State 0, StateTypeSet]
type = StateTypeSet
triggerall = anim = 3306
trigger1 = var(19)=0
trigger1 = AnimElemTime(5)=0
statetype = A       ;S,A,C,L
movetype = I        ;I,A,H
physics = A         ;A,C,S,N


[State 620, ChangeState]
type = ChangeState
triggerall = anim = 3306
triggerall = floor (pos Y < -155)
trigger1 = animelem = 7
value = 1261
ctrl = 1

;------------------------------
; Plasma Beam helper
[Statedef 3315]
type = A
movetype = A
physics = N
ctrl = 0
anim = 3315
sprpriority = 4
velset = 0,0
juggle = 1

[State 3000, ChangeAnim]
type = ChangeAnim
trigger1 = !Time && Anim != StateNo
value = StateNo

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
scale = 1.3,0.92

[State 0, VarSet]
type = VarSet
trigger1= !time && !prevstateno
var(10) = ifelse(parent,var(10)=2,2,ifelse(parent,var(10)=1,1,0))

[State 0, BindToParent]
type = BindToParent
trigger1 = 1
pos = floor(50*const(size.xscale)),floor(-54*const(size.yscale))

[State 901:Assertspecial]
type = assertspecial
trigger1 = 1
flag = noshadow

[State 901:playerpush]
type = PlayerPush
trigger1 = 1
value = 0
persistent = 1

[State 1005, hitoverride]
type=hitoverride
trigger1=1
time=-1
attr=SCA,AA,AP,AT
stateno=3315
ignorehitpause=1

[State 1005, hitby]
type=hitby
trigger1=1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1

[State 0, SprPriority]
type = SprPriority
trigger1 = 1
value = 4
ignorehitpause = 1
persistent = 1

[State 901:projectile]
type = hitdef
trigger1 = time%5 = 4  && (P2StateNo != [5070,5071])
attr = S,NA
hitflag = MAFD
guardflag = MA
animtype = Diagup
air.animtype = Diagup
damage = 75,55
getpower = 50,0
givepower = 20,0
pausetime = 0,7
guard.pausetime = 0,7
sparkno = S9999
guard.sparkno = S8050
sparkxy = -10,11
hitsound = s5+parent,var(49),3
guardsound = s6+parent,var(49),0
ground.type = High
ground.slidetime = 18
ground.hittime = 20
down.velocity = -6,-7
air.hittime = 2
yaccel = 1.16
ground.velocity = -8,-2
guard.velocity = -13
ground.cornerpush.veloff = -14
air.velocity = -7,-2
airguard.velocity = -10.5,3
fall.xvelocity = 0
fall.yvelocity = -2
fall.recover = 0
fall = 1
air.fall = 1

[State G-FX, Hit/Guard Spark]
type = Explod
trigger1 = MoveContact
anim = Cond(MoveHit, 8004, 32004)
postype = p1
pos = Floor(P2Dist X - 10), Floor(P2Dist Y - 81)
bindtime = 1
removetime = -2
scale = 0.5, 0.5
supermovetime = 500
ontop = 1
ownpal = 1
ignorehitpause = 1
persistent = 0 

[State 901:destroyself]
type = Destroyself
trigger1 = AnimTime=0
trigger2 = parent,movetype=H
trigger3 = parent,stateno!= 3305
;---------------------------------------------------------------------------
I appreciate any help anyone has for this topic. Thank you all.
Re: How To Prevent Special Attacks From Cancelling Flight?
#2  November 06, 2021, 12:31:18 PM
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Thats  lot of unnecessary code to decipher. For any move if you can access it during flight you code it so the changestate OUT leads back to flight. This is as simple as another changestate working on pos y> 0 sending you to flight instead of 0. Or you can use a state -2 to send you to flight if statetype = S ctrl is 1 and pos y> 0


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: How To Prevent Special Attacks From Cancelling Flight?
#3  November 07, 2021, 03:34:04 AM
  • avatar
  • **
    • USA
Is this in the cns or the cmd list? I do not know where I should add this. I have added State -2 to the cmd list entry when it was originally state -1.

; Air Plasma Beam
[State -2, Air Plasma Beam]
type = ChangeState
value = 40036
triggerall = command = "QCF_A"||command="QCF_B"||command="QCF_C"
trigger1 = statetype = A  && (ctrl || stateno = 40005)
trigger2 = (stateno = [600,699])
trigger3 = pos y>0

Is this somewhat in the right direction?
Re: How To Prevent Special Attacks From Cancelling Flight?
#4  November 07, 2021, 10:04:25 AM
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Statedef -2 is normally in the cns. What that version does and it doesnt rely on commands is checks if you are in a standing state but not on the ground. If thats the case it puts you into flight.

Alternatively at the end of any air attack just add a new changestate to send you back to flight when the state is done. So rather than 0 you go to 1500 or whatever it is.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: How To Prevent Special Attacks From Cancelling Flight?
#5  November 08, 2021, 02:58:26 PM
  • avatar
  • **
    • USA
Okay, after taking a look at the code I changed it to this in the cmd and for one of Liliths' moves it worked and she went back to flight after performing a special attack. Here is what I put in there at the end for the cns:

[State 1360, ChangeState]
type = ChangeState
triggerall = animtime = 0 && anim = 1363
trigger1 = time = 30
value = 40005

[State 1370]
type = Helper
trigger1 = Time = 7
trigger1 = NumHelper(6221) = 6221
stateno = 6221
id = 6221
pos = -7,-9

[State 1370]
type = Helper
trigger1 = Time%5 = 4
stateno = 21382
id = 21382
postype = p2
pos = 32,-floor(Pos Y)
ownpal = 1

[State 1360, 1.1]
type = ChangeAnim
trigger1 = Time = 7
value = 1363
persistent = 0

[State 1360, 1.2]
type = ChangeState
trigger1 = AnimTime = 0 && Anim = 1363
trigger2 = Time = 30
trigger3 = pos y> 0
value = 40005
ctrl = 1

For the triggers in her cmd for the move I added this:

[State -1, Laser]
type = ChangeState
value = 40037
triggerall = !var(59)
triggerall = command = "MS" || command = "MS" || command = "MS"
trigger1 = statetype = A && (ctrl || stateno = 40005)
trigger2 = var(51) = 1
trigger3 = pos y> 0

I have tried to do it again in the same manner for her air dashes while flying, but it did not work. Are those supposed to be coded differently or am I missing something?
Re: How To Prevent Special Attacks From Cancelling Flight?
#6  November 10, 2021, 05:05:05 PM
  • avatar
  • **
    • USA
Oh yeah, I forgot to add the code again to show what I did for one of them.

;Air Dash Up
[Statedef 40038]
type    = A
physics = N
movetype = I
anim = 11000
ctrl = 0 + (0*(var(55):=1))
velset = 0,0
sprpriority = 3

[State 117, 1]
type = VelSet
trigger1 = time >= 1
x = 0
y = -9

[State 855, VarSet]
type = PosAdd
triggerall = var(15)
trigger1 = pos y < -170
y = 10

[State 111, 1]
type = VelSet
trigger1 = time >= 20
x = 0
y = 0

[State 112, 3]
type = CtrlSet
trigger1 = time = 5
value = 1

[State 117, 2] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 112, ChangeState]
type = ChangeState
triggerall = var(15)
trigger1 = time = 21
value = 40005

[State 112, 4.1]
type = ChangeState
triggerall = !var(15)
trigger1 = time = 21
value = 40005
ctrl = 1

[State 112, 4.2]
type = ChangeState
triggerall = var(15)
trigger1 = time = 21
trigger2 = pos y> 0
value = 40005
ctrl = 1

I have this for the cmd.

; Air Dash Up
[State -1, Air Run Up]
type = ChangeState
value = 40038
triggerall = !var(55)
triggerall = (stateno !=[100,109])&&var(20)<3
triggerall = command = "holdup" && command = "guardpush"
trigger1 = statetype = A  && (ctrl || stateno = 40005)
trigger2 = (stateno = [600,720])&&movecontact
trigger3 = pos y> 0

Should I add something different?
Re: How To Prevent Special Attacks From Cancelling Flight?
#7  November 13, 2021, 09:06:33 PM
  • avatar
  • **
    • USA
Thank you again, Cyanide!