Creatures and Attack sounds

From PSwiki
Revision as of 22:34, 20 June 2023 by Talad (talk | contribs) (Hit sound)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Attack Sound

For humanoid and creatures we consider that they can use melee or switch weapons. In the Combat_Montage of our player character, we have the attack animation. In the attack animation segment we have one events (Notify) at the start of type PSAnimNotifyAttackSound


In psAttack::Attack() we create a soundID with this rule:

if the weapon is melee then use the race: <race>-4

otherwise use the weapon skill id: "w-" + <weapon skill>

Example: Stonehammer hitting with a Fist = 0-4

Example: Stonehammer hitting with a sword = w-0

this soundID is then sent to all clients this way: we call BroadcastAttackAnimation() to send it to all players in range, and then we call ReceiveAttackAnimation() on clients BP, this is then calling PlayPSAnimMontage()

Inside PlayPSAnimMontage() we use the soundid

The class used is UPSAnimNotifyAttackSound

Hit sound

When someone is hit.

in psAttack::AffectTarget() we create a soundID <Weapon Type> + "-" + <Material> + <Hit>

Material is defined in Race infoTable.skin_type

Example: fist hitting carapare of a trepor: 4-3-1

Example: sword getting blocked by flesh: 0-0-0

this soundID is then sent to all clients this way: we call BroacastCombatResultSound() to send it to all players in range

The hit sounds are decoupled from the hit animation because they need to play regardless.

Death Sound

If we want to have a sound when the creature dies, we have it in the Death Montage, on the death animation