Code a multi-hit attack

Started by Continuity, June 25, 2009, 06:33:02 AM

Previous topic - Next topic

Continuity

I'm sorry to bother you guys again but I'm really stuck here, here's my code for a 2 hits kick
[Statedef 240]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 65
ctrl = 0
velset = 0,0
anim = 240
sprpriority = 2

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

[State 240, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = medium
damage    = 40
guardflag = MA
pausetime = 8,18
sparkno = 1
sparkxy = -10,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = high
ground.slidetime = 6
ground.hittime  = 15
ground.velocity = -4
air.velocity = -2.2,-3.2

[State 240, 5]
type = hitdef
trigger1 = AnimElem = 16
attr = S, NA
animtype = medium
damage = 23
guardflag = MA
hitflag = MA
pausetime = 12, 12
sparkno = 1
sparkxy = -10,-60
hitsound = 5,2
guardsound = 6,0
ground.type = high
ground.slidetime = 6
ground.hittime = 15
ground.velocity = -6
air.velocity = -2.2, -3.2

[State 240, 3]
type = PosAdd
trigger1 = AnimElem = 7
x = 12

[State 240, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

the first hit landed ok but the second hit always misses, the hit box is perfectly fine, the second hit sprite is element 16 and tick 22, thank you

GT

Instead of time = 0 use animelem.

Rajaa Retired

That shouldn't be the problem unless animation element 16 is the the first clsn1; only one hitdef can be active at a time.

Actually, I see nothing there that would cause the second hitdef not to activate.


Use "animelemtime(16) = 0" instead of "animelem = 16" just because you should.

Bastard Mami

post your animation 240 as well.

Noctis

#4
I just used entire the coding for one of my attacks and it works perfectly fine.
Maybe your opponent is missing some CLSN boxes or your attack's CLSN box isn't really hitting.

(Youtube) (WIP) (Mediafire) (New Anime Shop) My Manga Reviews! Personal favorite Patreon! Check her out!

"There is nothing either good or bad, but thinking makes it so."