setSoundEffect: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " |game2= arma2 |version2= 1.00 |game3= arma2oa |version3= 1.51" to " |game2= arma2 |version2= 1.00 |game3= arma2oa |version3= 1.50") |
Lou Montana (talk | contribs) m (Text replacement - "\|s([0-9])\= ([^' ]+)'''([^' ]+)'''([^ ]*) " to "|s$1= $2$3$4 ") |
||
Line 24: | Line 24: | ||
|descr= Defines the different sound effects. To stop any sound, deactivate the trigger (might take up to 0.5 seconds to stop) or delete the trigger (immediate). | |descr= Defines the different sound effects. To stop any sound, deactivate the trigger (might take up to 0.5 seconds to stop) or delete the trigger (immediate). | ||
|s1= trigger | |s1= trigger [[setSoundEffect]] [sound, voice, soundEnv, soundDet] | ||
|p1= trigger: [[Object]] | |p1= trigger: [[Object]] | ||
Line 38: | Line 38: | ||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
|s2= waypoint | |s2= waypoint [[setSoundEffect]] [sound, voice] | ||
|p21= waypoint: [[Array]] - format [[Waypoint]] | |p21= waypoint: [[Array]] - format [[Waypoint]] |
Revision as of 18:11, 20 June 2021
Description
- Description:
- Defines the different sound effects. To stop any sound, deactivate the trigger (might take up to 0.5 seconds to stop) or delete the trigger (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)
- 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 ["", "Alarm", "", ""];
- Example 4:
_trigger setSoundEffect ["", "", "BattlefieldExplosions3", ""];
- Example 5:
_trigger setSoundEffect ["", "", "", "Owl"];
Additional Information
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
- Posted on October 2, 2013
- Neokika
-
To avoid having to create a dummy sound definition, you can use $NONE$ instead.
private "_trigger"; _trigger = createTrigger ["EmptyDetector", position player]; _trigger setTriggerStatements ["true", "", ""]; _trigger setSoundEffect ["$NONE$", "", "BattlefieldExplosions3", ""];
- Posted on March 7, 2012
- old_man_auz
-
When using this function, I found that if the parameter sound was empty, then you would always get a 'Sound not found' error. The following code fixes this problem. You need to create a dummy sound. This is what example 3 is hinting towards.
description.ext:
class CfgSounds { sounds[] = {}; class NoSound { name = "NoSound"; sound[] = {"", 0, 1}; titles[] = {}; }; // Dummy sound needed for setSoundEffect command, due to bug in engine. };
(code sample above written by 'CarlGustaffa' on the Bohemia Interactive forums.)
script.sqf:_trigger = createTrigger [ "EmptyDetector" , _position ]; _trigger setTriggerStatements [ "true" , "" , "" ]; _trigger setSoundEffect [ "NoSound" , "" , "" , "Wind2_EP1" ];
Categories:
- Scripting Commands
- Introduced with Armed Assault version 1.00
- ArmA: Armed Assault: New Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Sounds
- Command Group: Triggers
- Command Group: Waypoints