PlayActorSound
void PlayActorSound (int tid, int sound, int channel, fixed volume, bool looping, fixed attenuation);
Usage
Plays a sound at a thing. This is similar to PlaySound except it takes a sound identifier as the sound parameter instead of an explicit sound, and thus the sound that is eventually played depends on the actor's defined sounds. If tid is 0, the sound will be played by the activator of the script.
Parameters
- tid: The tid of the actor to play the sound from.
- sound: The sound identifiers to play the sound they reference:
- SOUND_See — Plays the SeeSound of the actor.
- SOUND_Attack — Plays the AttackSound.
- SOUND_Pain — Plays the PainSound.
- SOUND_Death — Plays the DeathSound.
- SOUND_Active — Plays the ActiveSound.
- SOUND_Use — Plays the Inventory.UseSound. (Verification needed)
- SOUND_Bounce — Plays the BounceSound.
- SOUND_WallBounce — Plays the WallBounceSound.
- SOUND_CrushPain — Plays the CrushPainSound.
- SOUND_Howl — Plays the HowlSound.
- SOUND_Push — Plays the PushSound. (New from 4.10.0)
- channel: The channel to play the sound on. Default is CHAN_BODY.
- volume: The volume of the sound. This ranges from 0.0 (mute) to 1.0 (full volume). Default is 1.0.
- looping: Whether the sound is to be looped or not. If TRUE, the sound loops, otherwise it does not. Default is FALSE.
- attenuation: This is how quickly the sound fades with distance from its source. The higher the value the quicker the sound fades out. The following are the standard attenuation values:
- ATTN_NONE — 0 (no attenuation; the sound can be heard regardless of the distance).
- ATTN_NORM — 1.0 (normal attenuation; this is the default value).
- ATTN_IDLE — 1.001
- ATTN_STATIC — 3.0 (the sound diminish very rapidly with distance).
Examples
![]() |
Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated. |
This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.