YesNoOk
avatar

PosAdd Not Working in Custom Hitstate (Read 199 times)

Started by felineki, October 05, 2012, 10:00:30 pm
Share this topic:
PosAdd Not Working in Custom Hitstate
#1  October 05, 2012, 10:00:30 pm
  • ****
Yeah, another problem with the same SF2 aerial hitstun I posted about last time. The hitpause should be the usual deal, 15 frames of the character frozen at the position they were at when the attack made contact. The first frame after the hitpause should have them bumped upward exactly 16 pixels. No horizontal change. The frame after that is when they start the midair arc movement. Here's my code:

Code:
;---------------------------------------------------------------------------
; Air Hitpause
[Statedef 15020]
type    = A
movetype= H
physics = N
velset = 0,0
anim = 5030

[State 15020, 1];Invincible
trigger1 = 1
type = NotHitBy
value = SCA

[State 15020, 2];Freeze Animation
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 15020, 3];Go to Hit Reel State
type = ChangeState
trigger1 = HitShakeOver
value = 15030

;---------------------------------------------------------------------------
; Air Hitstun
[Statedef 15030]
type    = A
movetype= H
physics = N
ctrl = 0

[State 15030, 1];Invincible
trigger1 = 1
type = NotHitBy
value = SCA

[State 15030, 2]:Upward Nudge
type = PosAdd
trigger1 = Time = 0
y = -16

[State 15030, 3];Initial Vels
type = HitVelSet
trigger1 = Time = 1
x = 1
y = 1

[State 15030, 4];Gravity
type = VelAdd
trigger1 = Time > 0
y = GetHitVar(yaccel)

[State 15030, 5];Switch to Transition Animation
type = ChangeAnim
trigger1 = Anim = 5030
trigger1 = AnimTime = 0
trigger1 = SelfAnimExist(5035)
value = 5035

[State 15030, 6];Switch from Transition to Recovery Animation
type = ChangeAnim
trigger1 = Anim = 5035
trigger1 = AnimTime = 0
value = 5040

[State 15030, 7];Switch to Recovery Animation
type = ChangeAnim
trigger1 = Anim = 5030
trigger1 = AnimTime = 0
trigger1 = !SelfAnimExist(5035)
value = 5040

[State 15030, 8];Go to Wall Hit State
type = ChangeState
triggerall = Time > 1
trigger1 = BackEdgeBodyDist <= 0
trigger1 = FrontEdgeBodyDist <= 0
value = 15031

[State 15030, 9];Go to Landing State
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Vel Y + Pos Y >= 0
value = 52

Everything's working fine except for the 16 pixel upward nudge. For some reason it just won't happen at all, and I can't see why. I've even tried replacing it with different StateControllers (PalFX, etc.) to see if it was triggering at all, and it wasn't. I also tried various other triggers aside from "Time = 0", such as "GetHitVar(hitshaketime) = 0" and it still wouldn't work. I'm having trouble seeing what exactly I could be doing wrong. Any ideas?
Re: PosAdd Not Working in Custom Hitstate
#2  October 05, 2012, 10:22:34 pm
  • **
  • Gay Alien Boyfriend
    • USA
    • lunchboxlabs.tumblr.com
First of, try putting an ignorehitpause = 1 on the trigger and seeing if that fixes things.

If that doesn't work, you can try this, though it's a rather crude fix:

Code:
[State 15030, 2]:Upward Nudge
type = PosAdd
trigger1 = 1
y = -16
persistent = 0

The downside is that it may trigger on tick 1 instead of tick 0, but it will make sure that there's a 16 pixel nudge.
Re: PosAdd Not Working in Custom Hitstate
#3  October 05, 2012, 10:44:45 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
# [State 15030, 2]:Upward Nudge
# type = PosAdd
# trigger1 = Time = 0
# y = -16

You do have a problem here. Namely the : after the state line. You have inadvertantly disabled the controller by using that.

Yes that's almost impossible to spot and mugen doesn't debug it.


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: PosAdd Not Working in Custom Hitstate
#4  October 05, 2012, 11:47:31 pm
  • ****
Man, I was wondering if it was some really trivial stupid typo like that. Thanks for catching it for me. Fixed it and now it's working just fine.