A_PlaySoundEx

From ZDoom Wiki
Jump to navigation Jump to search
Nuvolabomb.png Warning: The feature described on this page has been deprecated since r1544, and will no longer be supported or updated by the GZDoom developers. While some functionality may be retained for the purposes of backwards-compatibility, authors are strongly discouraged from utilizing this feature in future projects and to instead use A_StartSound. Compatibility with future GZDoom versions is not guaranteed.


A_PlaySoundEx (soundwhattoplay, string slot [, bool loop [, int attenuation]])

Usage

Plays the a sound on the specified channel. Each actor has its own set of channels to play sounds on, so sounds played by different actors will not affect each other. This function allows sounds to be played on a specific channel, which can allow for multiple sounds generated from one actor simultaneously that would normally cut each other off, or other special effects.

Parameters

  • whattoplay: The “nice name” of the sound to play. See SNDINFO for how to define this.
  • slot: The channel to play the sound on. Sound played on separate channels will not interfere with each other. Valid values are:
    • Auto
    • Weapon
    • Voice
    • Item
    • Body
    • SoundSlot5
    • SoundSlot6
    • SoundSlot7
  • loop: If true, the sound will play in a continuous loop.
  • attenuation: Controls how the sound falls off with distance. Legal values are:
    • -1: the sound drops off rapidly with distance.
    • 0: the sound plays as normal (default).
    • 1: the sound plays at full volume everywhere in the level.
    • 2: the sound plays at full volume everywhere in the level and in surround sound.

Examples

	Missile:
		GRNA A 3
		GRNA B 3 A_SposAttack
		GRNA C 3 A_PlaysoundEx("Grunt/Attack","Weapon")
		GRNA DEFG 3
		Goto See