EVENT SOUND: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
No edit summary
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{EventTable|1=EVENT_SOUND|2=[[screenpeek]]|3=[[i|player->i]] / sound origin|4=1 value}}
EVENT_SOUND is a [[EDuke32 event list|Game Event]].
EVENT_SOUND is a [[EDuke32 event list|Game Event]].


This [[event]] is triggered upon playback of any sound, and allows hard coded sounds to be altered in a context-aware fashion. The [[RETURN]] variable is set to the sound effect number of the sound that is being played. Set [[RETURN]] to the sound you want to be played instead, or set it to -1 to cancel playback.
This [[event]] is triggered upon playback of actor, global and screen sounds. It allows hard coded sounds to be altered in a context-aware fashion
 
For sounds that originate from a sprite, [[THISACTOR]] will be set to the origin of the sound. Sounds that are played on the menu, or which are played through [[screensound]] or [[globalsound]] will instead set [[THISACTOR]] to [[i|player[screenpeek].i]].
 
The current player is '''always''' set to [[screenpeek]], NOT the closest player.
 
[[RETURN]] is initially set to the sound effect number of the sound that is being played. Set [[RETURN]] to the sound you want to be played instead, or set it to -1 to cancel playback.


[[Category:Events]]
[[Category:Events]]

Latest revision as of 01:02, 5 February 2022

Event ID player# THISACTOR RETURN
EVENT_SOUND screenpeek player->i / sound origin 1 value

EVENT_SOUND is a Game Event.

This event is triggered upon playback of actor, global and screen sounds. It allows hard coded sounds to be altered in a context-aware fashion

For sounds that originate from a sprite, THISACTOR will be set to the origin of the sound. Sounds that are played on the menu, or which are played through screensound or globalsound will instead set THISACTOR to player[screenpeek].i.

The current player is always set to screenpeek, NOT the closest player.

RETURN is initially set to the sound effect number of the sound that is being played. Set RETURN to the sound you want to be played instead, or set it to -1 to cancel playback.