News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

How Do I....?

Started by JYD, January 04, 2009, 10:37:19 PM

Previous topic - Next topic

JYD

How Do I Make An Animation Stop If I Get Hit

For Example, I'm Coding a Pocket Akuma, If I Do A Shinku Haduken & Get Hit, The Animation Won't Stop

Here's My Code


An Also, How Do I Get The After Image To Stop If He Gets Hit, Cause The After Image Will Still Be On Him If He Gets Hit

Spoiler (click to show)
;MESSATSU GOU SHINKUU HA Z (Strong Vacuum Wave) CHARGE
[Statedef 3065]
type    = S
movetype= A
physics = S
velset = 0,0,0
poweradd = -2000
juggle = 0
ctrl = 0
anim = 3010

[State 191, 3]
type = Playsnd
trigger1 = time = 0
persistent = 0
value = 23,2

[State 4110, 6]
type = AfterImage
trigger1 = time = 0
time = 999
TimeGap  = 1
FrameGap = 4
length = 15

[State 1531, 5]
type = PosFreeze
trigger1 = time = 0
value = 18

[State 3050, 2]
type = Explod
trigger1 = Time = 0
anim = 9999
sprpriority = 4
supermovetime = 40
pos = 0, 30
postype = back

[State 3050, 3]
type = Explod
trigger1 = Time = 0
anim = 9000
sprpriority = 5
supermovetime = 40
pos = 0, 30
postype = back
velocity = 10, 0
removetime = 11

[State 3050, 4]
type = Explod
trigger1 = Time = 0
anim = 9991
sprpriority = 5
supermovetime = 40
pos = 80, 30
postype = back
velocity = 2

[State 4120, 1]
type = SuperPause
trigger1 = Time = 0
movetime = 38
time = 38
anim = S7000
pos = -13, -20

[State 1531, 5]
type = PlaySnd
trigger1 = time = 0
value = 22,1

[State 610, 4]
type = ChangeState
trigger1 = Time = 50
value = 2021

;---------------------------------------------------------------------------
;MESSATSU GOU SHINKUU HA Z (Strong Vacuum Wave) UNLEASH
[Statedef 2021]
type    = S
movetype= A
physics = S
juggle = 0
ctrl = 0
anim = 3011

[State 1000, 2]
type = PlaySnd
trigger1 = AnimElem = 2,-2
value = 1,0

[State 1000, 2]
type = PlaySnd
trigger1 = AnimElem = 2
value = 30,0

[State 184, 2]
type = Projectile
trigger1 = AnimElem = 2
projanim = 3001
projhitanim = 3002
projremanim = 3002
projhits = 20
projmisstime = 3
projshadow = -1
projpriority = 2
projremovetime = 80
projheightbound = -240, 100
projedgebound = 100
projscreenbound = 100
projid = 2000
Velocity = 0.001,0.001
offset = -47,32
attr = S, HP
damage   = 15,10
animtype = heavy
getpower = 0,0
guardflag = MA
hitflag = MAFP
pausetime = 0,3
hitsound   = S30,1
sparkxy = 500,500
guardsound = S20,6
ground.type = Low
ground.slidetime = 25
ground.hittime  = 25
ground.Velocity = -10,-6
fall = 1
air.animtype = Back
air.Velocity = -10,-6
air.juggle = 3
air.fall = 1
down.Velocity = -10
down.hittime = 30
down.bounce = 0
;PalFX
palfx.time = 23
palfx.add = 50,30,130

[State 3000]
type = explod
trigger1 = projcontact2000 = 1
anim = 2028
pos = 30,-20
postype = p2
sprpriority = 4
bindtime = 1

[State 210, 1]
type = AfterImageTime
trigger1 = animtime = 0
Time = 0

[State 1000, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

Byakko

For the afterimage : well, you set it to last for 999 ticks, and you stop it by hand at the end. so if you get it, you also have to stop it by hand. You can put that (the afterimagetime you have at the end of the move) in your statedef -2 and have it activate as long as you're not in any state that requires any afterimage.

What do you call "the animation won't stop" ? Does your character get hit or not ? Do you have gethit animations ? Do you have clsn2 boxes ?
In passing, the explod won't trigger when you get out of the state, so if you get hit, the explod will not show even if the projectile will hit. Is it what you mean ?
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

JYD

Sry If I Sounded confusing

Lets Say I Do A Super Haduken (The Beam One) If I get Hit While Doing This Move I Want The Haduken Animation To Stop

As Of Now If I Get Hit While Doing This, The Haduken Animation Will Still Keep Going Until It's Animation Time Runs Out


Byakko

Oh, it's a beam, that's completely different. ... You have to make a helper out of it, I don't think you can manually stop a projectile. Helpers are used just like the character himself - you give it a statedef, you give it a hitdef, velocities, explods and whatnot - also don't forget to have it handle when it gets hit - if you don't override hits dealt to the helper, it will turn into a clone of the character.
So, you create a helper instead of a projectile, give it a statedef to start at, in that statedef you display the animation, you give it the same hitdefs as the projectile, and you give it a destroyself triggered when the parent isn't in his super state or when it's finished.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

JYD

Cool Thanks Bro :sugoi:

I'll Let Ya Know If It Works