PlayActorSound

From ZDoom Wiki
Jump to navigation Jump to search

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:
  • 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

Nuvolachalk.png 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.