enableAudioFeature: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|arma3 |= Game " to "|arma3 |Game name= ")
m (Fix)
 
(34 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________
 
|arma3 |Game name=
|game1= arma3
|1.64|Game Version=
|version1= 1.64
|arg= |Multiplayer Arguments=
 
|eff= |Multiplayer Effects=
|arg= global
____________________________________________________________________________________________
|eff= local
| Enable/disable an audio feature, features are: "lowpass", "building_interior". Return previous state |DESCRIPTION=
 
____________________________________________________________________________________________
|gr1= Sounds
| [[enableAudioFeature]] [feature, enable] |SYNTAX=
 
|p1= feature: [[String]] |PARAMETER1=
|descr= Get the state of '''or''' enable/disable an audio feature. Available features are {{hl|"lowpass"}} and {{hl|"building_interior"}}.
|p2= enable: [[Bool]] - [[true]] enable, [[false]], disabled |PARAMETER2=
* {{GVI|arma3|2.14|size= 0.75}} it is possible to enable {{hl|"building_interior"}} on an object placed in a building.
|p3= |PARAMETER3=
* {{GVI|arma3|2.14|size= 0.75}} if 'enable' argument is omitted, the command returns the current state of the feature.
|p3= |PARAMETER4=
 
|p3=  |PARAMETER5=
|mp= To use this command on objects in multiplayer, [[remoteExec]] it globally with JIP queue enabled:
|p3= |PARAMETER6=
<sqf>[_obj, ["building_interior", true]] remoteExec ["enableAudioFeature", 0, _obj];</sqf>
| [[Bool]] - Previous state |RETURNVALUE=
 
|x1= prevState = [[enableAudioFeature]] ["lowpass", [[true]]]; |EXAMPLE1=
|s1= [[enableAudioFeature]] [feature, enable]
| - |SEEALSO=
 
}}
|p1= feature: [[String]] - {{hl|"lowpass"}} or {{hl|"building_interior"}}
 
|p2= enable: [[Boolean]] - (Optional, getter if not provided) [[true]] enable, [[false]], disable
 
|r1= [[Boolean]] - previous state
 
|s2= object [[enableAudioFeature]] [feature, enable]
 
|s2since= arma3 2.14
 
|p21= object: [[Object]]
 
|p22= feature: [[String]] - {{hl|"building_interior"}} or {{hl|"building_exterior"}} only (mutually exclusive)
 
|p23= enable: [[Boolean]] - (Optional, getter if not provided) [[true]] enable, [[false]], disable
 
|r2= [[Boolean]] - previous state
 
|x1= <sqf>private _prevState = enableAudioFeature ["lowpass", true];</sqf>
 
|x2= <sqf>private _prevState = pallet enableAudioFeature ["building_interior", true];</sqf>


<dl class='command_description'>
|x3= <sqf>
<!-- BEGIN Note Section -->
private _currState = pallet enableAudioFeature ["building_interior"];
<!-- For example:
private _prevState = pallet enableAudioFeature ["building_interior", !_currState];
<dd class='notedate'>Posted on Month Day, Year - Time (UTC)</dd>
hint str (_currState == _prevState); // true
<dt class='note'>'''[[User:User Name|User Name]]'''</dt>
<dd class='note'>This is an example note. It is true and verifiable, and contains a little code snippet.
<code>[[if]] ([[_this]] == anExample) [[then]] { hint: Leave it here for others to read; };</code></dd>
-->
<!-- END Note Section -->
</dl>


<h3 style='display:none'>Bottom Section</h3>
private _currState = pallet enableAudioFeature ["building_interior"];
<!-- Appropriate categories go here -->
hint str (_currState == _prevState); // false
</sqf>


[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
|seealso= [[insideBuilding]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
}}

Latest revision as of 11:41, 1 April 2024

Hover & click on the images for description

Description

Description:
Get the state of or enable/disable an audio feature. Available features are "lowpass" and "building_interior".
  • Arma 3 logo black.png2.14 it is possible to enable "building_interior" on an object placed in a building.
  • Arma 3 logo black.png2.14 if 'enable' argument is omitted, the command returns the current state of the feature.
Multiplayer:
To use this command on objects in multiplayer, remoteExec it globally with JIP queue enabled:
[_obj, ["building_interior", true]] remoteExec ["enableAudioFeature", 0, _obj];
Groups:
Sounds

Syntax

Syntax:
enableAudioFeature [feature, enable]
Parameters:
feature: String - "lowpass" or "building_interior"
enable: Boolean - (Optional, getter if not provided) true enable, false, disable
Return Value:
Boolean - previous state

Alternative Syntax

Syntax:
object enableAudioFeature [feature, enable]
Parameters:
object: Object
feature: String - "building_interior" or "building_exterior" only (mutually exclusive)
enable: Boolean - (Optional, getter if not provided) true enable, false, disable
Return Value:
Boolean - previous state

Examples

Example 1:
private _prevState = enableAudioFeature ["lowpass", true];
Example 2:
private _prevState = pallet enableAudioFeature ["building_interior", true];
Example 3:
private _currState = pallet enableAudioFeature ["building_interior"]; private _prevState = pallet enableAudioFeature ["building_interior", !_currState]; hint str (_currState == _prevState); // true private _currState = pallet enableAudioFeature ["building_interior"]; hint str (_currState == _prevState); // false

Additional Information

See also:
insideBuilding

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