mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
ClassicAPI extensions: actor:SetPlayAnimationSounds(enabled) and scene:SetGroundTerrain([terrainTypeID]), each with its getter. Each actor model now gets the engine's event callback (CM2Model::SetEventCallback, 0x007133A0), as a unit's model does (0x00607800). model/SceneEvents.cpp sorts the events by their four-character tag, as the unit dispatcher CGUnit_C::OnModelEvent (0x005FFBD0) does. It receives the $CSL, $CSR and $CST missile releases, which moved there from SceneSpell.cpp. When the actor opts in, it also plays the sounds that a unit plays. They come from the CreatureSoundData of the display: its own row, else its model data's, as GetSoundData (0x0060AFB0) picks it. - $FD1 to $FD4: the fidgets at +0x38 (0x006232C0). - $FDX: the stand vocal at +0x20, with the world's 41-in-101 chance and a 10 s limit shared by all actors. It never plays for the active player's copy (0x006236B0, 0x00623490). - $WNG and $WGG: the wing flap at +0x2C and the glide at +0x30. The dispatcher plays them as vocal kinds 7 and 10, through slot 34 (push 7 / push 0xA, call [eax+0x88]). - $FSD: the engine's GetFootstepSound (0x00458450), by the scene's ground terrain, with FootstepSounds on. - $DTH: the dry thud from the engine's death-thud table (0x00C4E0F4), by size class (GetUnitSoundSize 0x00625500) and the ground. - $CSD: the event's own SoundEntries id, with EmoteSounds on. - $TRD: the precast sound (SpellVisual +0x38) of a PlaySpellVisual that is still preparing (0x0062FAA0). The sounds are off by default, so stock scenes such as the dressing room stay silent. They play in 2D through the by-ID player. A scene without a ground terrain has no footsteps and no death thud. $CSS, $CAH and $AH0 to $AH3 play nothing: they present a pending swing (0x006247D0), and an actor never swings at anything. The unit's display ID is kept on the actor so that its sound data can be found.