Hit Sound problem

Started by musthe1 (Jotaro_Joestar), May 07, 2022, 12:53:34 AM

Previous topic - Next topic

musthe1 (Jotaro_Joestar)

I'm having a little problem here. When I finished coding the hit sound, the sound doesn't play at the same time when the enemy is attacked by a move.

Spoiler (click to show)
[State 200, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 21, 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime = 8, 8                 ;Time attacker pauses, time opponent shakes
sparkno = -1                      ;Spark anim no (Def: set above)
sparkxy = -10, -76               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = -1, 0*(Var(4) := 0)                 ;Sound to play on hit
guardsound = -1                ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5             ;Time that the opponent slides back
ground.hittime  = 11             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 15                 ;Time before opponent regains control in air


Spoiler (click to show)
[State -2, Hit Sound]
type = PlaySnd
trigger1 = MoveHit = 1 && Var(4) >= 0 && MoveContact = 1 && Var(3) = HitPauseTime
value = FIfElse(RoundState = 3, 21, 5), Var(4)
channel = 2
ignorehitpause = 1

[State -2, VarSet]
type = VarSet
trigger1 = MoveContact = 1 && Var(3) < 0
v = 3
value = HitPauseTime
ignorehitpause = 1

I've tried referencing from PotS' characters, but the sound still plays out of sync.

Charles_2011

Hello Jotaro_Joestar.

I have a similar problem some days ago, maybe is the same case, take a look at this, and change the last numbe, for example 4,6,8..:

trigger1 = AnimElem = 2

I hope this help you.

musthe1 (Jotaro_Joestar)

Quote from: Charles_2011 on May 07, 2022, 02:05:01 AM
Hello Jotaro_Joestar.

I have a similar problem some days ago, maybe is the same case, take a look at this, and change the last numbe, for example 4,6,8..:

trigger1 = AnimElem = 2

I hope this help you.

The sound still plays out of sync when I change the AnimElem = 2 to AnimElem = 1, but thanks for your help.