setSoundEffect: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) No edit summary |
Killzone Kid (talk | contribs) No edit summary |
||
Line 41: | Line 41: | ||
|x2= <code> [_group1,2] [[setSoundEffect]] ["Alarm", "", "", ""];</code> | |x2= <code> [_group1,2] [[setSoundEffect]] ["Alarm", "", "", ""];</code> | ||
|x3= <code>_trigger [[setSoundEffect]] ["$NONE$", "Alarm", "", ""];</code> | |x3= <code>_trigger [[setSoundEffect]] ["$NONE$", "Alarm", "", ""];</code> | ||
|x4= <code>_trigger [[setSoundEffect]] ["$NONE$", "", " | |x4= <code>_trigger [[setSoundEffect]] ["$NONE$", "", "BattlefieldExplosions3", ""];</code> | ||
|x5= <code>_trigger [[setSoundEffect]] ["$NONE$", "", "", "Owl"];</code> | |x5= <code>_trigger [[setSoundEffect]] ["$NONE$", "", "", "Owl"];</code> | ||
Line 57: | Line 57: | ||
_trigger = createTrigger ["EmptyDetector", position player]; | _trigger = createTrigger ["EmptyDetector", position player]; | ||
_trigger setTriggerStatements ["true", "", ""]; | _trigger setTriggerStatements ["true", "", ""]; | ||
_trigger setSoundEffect ["$NONE$", "", " | _trigger setSoundEffect ["$NONE$", "", "BattlefieldExplosions3", ""]; | ||
</code> | </code> | ||
<!-- Note Section END --> | <!-- Note Section END --> |
Revision as of 12:32, 5 February 2021
Description
- Description:
- Description needed
- Groups:
- SoundsTriggersWaypoints
Syntax
- Syntax:
- Syntax needed
- Parameters:
- trigger: Object
- [sound, voice, soundEnv, soundDet]: Array of strings
- Return Value:
- Return value needed
Alternative Syntax
- Syntax:
- waypoint setSoundEffect [sound, voice, soundEnv, soundDet]
- Parameters:
- waypoint: Array - format Waypoint
- [sound, voice, soundEnv, soundDet]: Array of strings
- 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:
- See also needed
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 stupid 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" ];