User Tools

Site Tools


stop_sound

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
stop_sound [2024/02/01 13:10] justinstop_sound [2024/02/01 14:01] (current) justin
Line 1: Line 1:
-======Add Item To Tile======+======Stop Sound======
 ---- ----
-Stops an actively playing sound. A sound's unique ID is returned from the [[Play Sound]] function. The second parameter is optional and will fade out the sound over the specified amount of time.+Stops an actively playing [[sound|sound effect]]. A sound's unique ID is returned from the [[Play Sound]] function. The second parameter is optional and will fade out the [[sound|sound effect]] over the specified amount of time.
  
 ====Signature:==== ====Signature:====
Line 9: Line 9:
  
 ^Argument^Description^Type^Required^ ^Argument^Description^Type^Required^
-|sound_id| |[[Number]]|Yes| +|sound_id|Unique ID of the [[sound|sound effect]] to stop (numeric value returned from the [[Play Sound]] function).|[[Number]]|Yes| 
-|fade_out_length| |[[Number]]|No|+|fade_out_length|Length of time over which to fade out (in seconds).|[[Number]]|No|
  
 ====Example:==== ====Example:====
Line 16: Line 16:
 stop_sound(global.property["alarm_id"], 2); stop_sound(global.property["alarm_id"], 2);
 </code> </code>
-//Results:// .+//Results:// The [[sound|sound effect]] with unique ID equal to that of the value stored in the "alarm_id" [[global_properties|global property]] will be faded out over a duration of two seconds.
  
 <WRAP center round tip 100%> <WRAP center round tip 100%>
-Use the **Stop Sound** function to...+Use the **Stop Sound** function to stop a looping [[sound]] that was previously triggered, for example to stop a warning alarm from going off when the player interacts with a security computer.
 </WRAP> </WRAP>
  
stop_sound.1706821854.txt.gz · Last modified: 2024/02/01 13:10 by justin