YesNoOk
avatar

p2stateno activate in air (Read 3026 times)

Started by Dendog90, May 16, 2016, 06:01:51 pm
Share this topic:
p2stateno activate in air
New #1  May 16, 2016, 06:01:51 pm
  • avatar
  • **
    • USA
hello again so I have a problem with my bounce off the ground move, Im trying to have p2stateno only activate if p2 is in the air and if p2 is on the ground it activates the regular stand get hit 5000 state. 310 is my bounce move and 395+ is the p2 custom states into bounce off the ground please and thank you for your help

;Ender
[Statedef 310]
type    = A                       
movetype= A                     
physics = A   
juggle  = 0                       
ctrl = 0                         
anim = 310                       
sprpriority = 2

[State 320, HitDef]
type = Hitdef
trigger1 = time = 0
attr = A,NA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = HA         ;HLA
animtype = Heavy          ;light,medium,hard,back,up,diagup
air.animtype = Heavy
priority = 4,Hit
damage = 30,0
pausetime = 15,15
sparkno = s10001+(random%4)
guard.sparkno = s7550
sparkxy = -15,-65
getpower = 0,0
givepower = 0,0
hitsound = S1,9
guardsound = S2,0
ground.type = High     
ground.slidetime = 11
ground.hittime = 11
guard.ctrltime = 11
air.hittime = 12
ground.velocity = 0,14
air.velocity = 0,14
airguard.velocity = -2.3,-2.35
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
p2facing = 1
fall = 0
fall.recover = 0
fall.recovertime = 0
fall.damage = 0
air.fall = 1
persistent = 0
yaccel = -4
kill = 1
id = 310
p2stateno = 395
envshake.time = 6
envshake.ampl = 10

[State 320, VelSet]
type = Veladd
trigger1 = Animelemtime(1)>0
y = .47

[State 320, VelSet]
type = Veladd
trigger1 = animelem = 1
x = 3       
       

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0



;=========================================================
; Custom State 5
;=========================================================
[Statedef 395]
type    = A
movetype= H
physics = A
velset = 0,0
facep2 = 1

[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = 1
value = 392

[State 1028, Vel Y]
type = VelSet
trigger1 = HitShakeOver = 1
x = facing*gethitvar(xvel)
y = gethitvar(yvel)

[State 1025, State]
type = ChangeState
trigger1 = HitShakeOver = 1
value = 396
;=========================================================
; Custom State 6
;=========================================================
[Statedef 396]
type    = A
movetype= H
physics = N

[State 1028, 1]
type = NotHitBy
trigger1 = 1
value = ,NT,ST,HT

[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AA,AP

[State 1028, Gravity]
type = VelAdd
trigger1 = 1
y = 1.52

[State 1028, Anim 5050] ;Self falling animation
type = ChangeAnim2
trigger1 = Time = 0
value = 392
elem = 2

[State 1028, Hit ground]
type = ChangeState
trigger1 = (Vel y > 0) && (Pos Y >= Const(movement.down.bounce.groundlevel))
value = 397
;=========================================================
; Custom State 7
;=========================================================
[Statedef 397]
type    = L
movetype= H
physics = N

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, 14] ;Friction
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim2
trigger1 = time = 0
value = 393
persistent = 0

[State 1025, State]
type = ChangeState
trigger1 = Animtime = 0
value = 398
;=========================================================
; Custom State 8
;=========================================================
[Statedef 398]
type    = A
movetype= H
physics = N

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = 1
value = 394

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = -.95
y = -9.5
persistent = 0

[State 5101, 6] ;Acceleration
type = VelAdd
trigger1 = time
y = .5

[State 5101, 7] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= Const(movement.down.bounce.groundlevel)
value = 5110





Last Edit: May 17, 2016, 02:15:19 am by Noctis
Re: p2stateno activate in air
#2  May 16, 2016, 06:10:11 pm
  • ******
It's better to use the TargetState controller. Remove the p2stateno line on the HitDef.

Make it to where it will only trigger if P2StateType = A, like such:

Quote
[State 310, TargetState]
type = TargetState
triggerall = P2StateType = A
trigger1 = MoveHit
value = 395
Re: p2stateno activate in air
#3  May 16, 2016, 06:47:34 pm
  • avatar
  • **
    • USA
thank for the reply but it didn't work p2 still bounces when standing
Re: p2stateno activate in air
#4  May 16, 2016, 07:10:38 pm
  • ******
Remove the Y value (14) from the HitDef's ground.velocity
Re: p2stateno activate in air
#5  May 16, 2016, 07:47:14 pm
  • avatar
  • **
    • USA
ahhh thank you so much for your help it worked