setSoundEffect: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *P([a-gi-z ])" to "$1 - p$2")
 
(100 intermediate revisions by 16 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


|arma|= Game name
|game1= arma1
|version1= 1.00


|1.0|= Game version
|game2= arma2
____________________________________________________________________________________________
|version2= 1.00


| Defines the different sound effects. Sound / voice plays a 2D / 3D sound from CfgSounds. SoundEnv plays an enviromental sound from CfgEnvSounds. SoundDet (only for triggers) creates a dynamic sound object attached to a trigger defined in CfgSFX. |= Description
|game3= arma2oa
____________________________________________________________________________________________
|version3= 1.50


| trigger or waypoint '''setSoundEffect''' [sound, voice, soundEnv, soundDet] |= Syntax
|game4= tkoh
|version4= 1.00


|p1= trigger or waypoint: [[Object]] |= Parameter 1
|game5= arma3
|version5= 0.50


|p2= [sound, voice, soundEnv, soundDet]: [[Array]] |= Parameter 2
|gr1= Sounds


| [[Nothing]] |= Return value
|gr2= Triggers
____________________________________________________________________________________________
 
|x1= <pre>trigger setSoundEffect ["Alarm", "", "", ""]</pre> |= Example 1
____________________________________________________________________________________________


| |= See also
|gr3= Waypoints


}}
|descr= Defines the different sound effects for a trigger or a waypoint. To stop any sound, deactivate the trigger (might take up to 0.5 seconds to stop) or delete the trigger/waypoint (immediate).
 
|s1= trigger [[setSoundEffect]] [sound, voice, soundEnv, soundDet]
 
|p1= trigger: [[Object]]
 
|p2= sound: [[String]] - plays a 2D sound as if [[playSound]] was used from CfgSounds (mission or main config). Use {{hl|"$NONE$"}} for an empty sound
 
|p3= voice: [[String]] - attaches a 3D sound from CfgSounds (mission or main config) to the object that activated the trigger and plays it as if [[say3D]] was used
 
|p4= soundEnv: [[String]] - plays an environmental sound from CfgEnvSounds (mission or main config)
 
|p5= soundDet: [[String]] - creates a dynamic sound object attached to a trigger defined in [[CfgSFX]] (mission or main config)
 
|r1= [[Nothing]]
 
|s2= waypoint [[setSoundEffect]] [sound, voice]
 
|p21= waypoint: [[Array]] - format [[Waypoint]]
 
|p22= sound: [[String]] - plays a 2D sound as if [[playSound]] was used from CfgSounds (mission or main config)
 
|p23= voice: [[String]] - attaches a 3D sound from CfgSounds (mission or main config) to the object that activated the trigger and plays it as if [[say3D]] was used
 
|r2= [[Nothing]]
 
|x1= <sqf>_trigger setSoundEffect ["Alarm", "", "", ""];</sqf>
 
|x2= <sqf>[_group1, 2] setSoundEffect ["Alarm", ""];</sqf>
 
|x3= <sqf>_trigger setSoundEffect ["$NONE$", "Alarm", "", ""];</sqf>


<h3 style="display:none">Notes</h3>
|x4= <sqf>_trigger setSoundEffect ["$NONE$", "", "BattlefieldExplosions3", ""];</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x5= <sqf>_trigger setSoundEffect ["$NONE$", "", "", "Owl"];</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[createTrigger]] [[setMusicEffect]] [[setTitleEffect]]
[[Category:Scripting Commands|SETSOUNDEFFECT]]
}}
[[Category:Scripting Commands OFP Elite |SETSOUNDEFFECT]]
[[Category:Scripting Commands ArmA|SETSOUNDEFFECT]]

Latest revision as of 15:45, 8 November 2023

Hover & click on the images for description

Description

Description:
Defines the different sound effects for a trigger or a waypoint. To stop any sound, deactivate the trigger (might take up to 0.5 seconds to stop) or delete the trigger/waypoint (immediate).
Groups:
SoundsTriggersWaypoints

Syntax

Syntax:
trigger setSoundEffect [sound, voice, soundEnv, soundDet]
Parameters:
trigger: Object
sound: String - plays a 2D sound as if playSound was used from CfgSounds (mission or main config). Use "$NONE$" for an empty sound
voice: String - attaches a 3D sound from CfgSounds (mission or main config) to the object that activated the trigger and plays it as if say3D was used
soundEnv: String - plays an environmental sound from CfgEnvSounds (mission or main config)
soundDet: String - creates a dynamic sound object attached to a trigger defined in CfgSFX (mission or main config)
Return Value:
Nothing

Alternative Syntax

Syntax:
waypoint setSoundEffect [sound, voice]
Parameters:
waypoint: Array - format Waypoint
sound: String - plays a 2D sound as if playSound was used from CfgSounds (mission or main config)
voice: String - attaches a 3D sound from CfgSounds (mission or main config) to the object that activated the trigger and plays it as if say3D was used
Return Value:
Nothing

Examples

Example 1:
_trigger setSoundEffect ["Alarm", "", "", ""];
Example 2:
[_group1, 2] setSoundEffect ["Alarm", ""];
Example 3:
_trigger setSoundEffect ["$NONE$", "Alarm", "", ""];
Example 4:
_trigger setSoundEffect ["$NONE$", "", "BattlefieldExplosions3", ""];
Example 5:
_trigger setSoundEffect ["$NONE$", "", "", "Owl"];

Additional Information

See also:
createTrigger setMusicEffect setTitleEffect

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note