BIS fnc jukebox: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
m (Text replacement - "{{Feature|Informative|" to "{{Feature|informative|")
 
(26 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma3
____________________________________________________________________________________________
|version1= 1.08


| arma3 |= Game name
|gr1= Sound


|1.00|= Game version
|descr= Plays music, depending on the player group status.
____________________________________________________________________________________________
{{Feature|informative|If no music classes are given, the function will get them from config automatically.}}


| <pre>/*
|s1= [function, parameters] call [[BIS_fnc_jukebox]]


Description:
|p1= function: [[String]] - (Optional, default "initialize") can be one of:
Plays music, depending on the player groups status
{{Columns|4|
* "initialize"
* "terminate"
* "readContainerFromConfig"
* "isInitialized"
* "forceBehaviour"
* "status"
* "randomMusic"
* "selectMusic"
* "playMusic"
* "nearEnemies"
* "hasContact"
* "isContact"
* "isStealth"
* "isCombat"
* "isSafe"
* "onEachFrame"
}}


Parameter(s):
|p2= parameters: [[Array]] - (Optional)
_this select 0: STRING - The sub-function to call
_this select 1: ARRAY - Parameters to be sent to sub-function
Returns:
Dependent on sub-function
*/


#define DEFAULT_VOLUME 0.2
* '''"initialize"''': [stealthMusics, combatMusics, safeMusics, volume, transition, radius, executionRate, noRepeat]
#define DEFAULT_TRANSITION 5
** stealthMusics: [[Array]] of [[String]]s
#define DEFAULT_RADIUS 500
** combatMusics: [[Array]] of [[String]]s
#define DEFAULT_EXECUTIONRATE 5
** safeMusics: [[Array]] of [[String]]s
#define DEFAULT_NOREPEAT true
** volume: [[Number]]
* '''"terminate"''': none
* '''"readContainerFromConfig"''': [wantedTheme]
* '''"isInitialized"''': none
* '''"forceBehaviour"''': [behaviour]
** behaviour: [[String]] - can be "stealth", "combat" or "safe". Any other value will reset the forced behaviour.
* '''"status"''': none
* '''"randomMusic"''': [container]
** container: [[Array]] of [[String]]s - music list to choose from
* '''"selectMusic"''': none
* '''"playMusic"''': [musicName]
** musicName: [[String]]
* '''"nearEnemies"''': none
* '''"hasContact"''': none
* '''"isContact"''': none
* '''"isStealth"''': none
* '''"isCombat"''': none
* '''"isSafe"''': none
* '''"onEachFrame"''': none


//Parameters
|r1=
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
* [[Array]] for:
____________________________________________________________________________________________
** "readContainerFromConfig"
** "nearEnemies" - a list of enemies nearby


| <!-- [] call [[BIS_fnc_jukebox]]; --> |= Syntax
* [[Boolean]] for:
** "isInitialized"
** "hasContact"
** "isContact"
** "isStealth"
** "isCombat"
** "isSafe"


|p1= |= Parameter 1
* [[String]] for:
** "status" - can be "stealth", "combat", "safe" or "error"
** "randomMusic" - one of the available musics
** "selectMusic"


| |= Return value
* [[Nothing]] for:
____________________________________________________________________________________________
** "initialize"
** "terminate"
** "forceBehaviour"
** "playMusic"
** "onEachFrame"


|x1= <code></code> |=
|x1= <sqf>[] call BIS_fnc_jukebox;</sqf>
____________________________________________________________________________________________
 
| |= See also


|seealso= [[playMusic]] [[BIS_fnc_music]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Misc|{{uc:jukebox}}]]
[[Category:Functions|{{uc:jukebox}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:jukebox}}]]

Latest revision as of 01:24, 2 February 2024

Hover & click on the images for description

Description

Description:
Plays music, depending on the player group status.
If no music classes are given, the function will get them from config automatically.
Execution:
call
Groups:
Sound

Syntax

Syntax:
[function, parameters] call BIS_fnc_jukebox
Parameters:
function: String - (Optional, default "initialize") can be one of:
  • "initialize"
  • "terminate"
  • "readContainerFromConfig"
  • "isInitialized"
  • "forceBehaviour"
  • "status"
  • "randomMusic"
  • "selectMusic"
  • "playMusic"
  • "nearEnemies"
  • "hasContact"
  • "isContact"
  • "isStealth"
  • "isCombat"
  • "isSafe"
  • "onEachFrame"
parameters: Array - (Optional)
  • "initialize": [stealthMusics, combatMusics, safeMusics, volume, transition, radius, executionRate, noRepeat]
  • "terminate": none
  • "readContainerFromConfig": [wantedTheme]
  • "isInitialized": none
  • "forceBehaviour": [behaviour]
    • behaviour: String - can be "stealth", "combat" or "safe". Any other value will reset the forced behaviour.
  • "status": none
  • "randomMusic": [container]
  • "selectMusic": none
  • "playMusic": [musicName]
  • "nearEnemies": none
  • "hasContact": none
  • "isContact": none
  • "isStealth": none
  • "isCombat": none
  • "isSafe": none
  • "onEachFrame": none
Return Value:
  • Array for:
    • "readContainerFromConfig"
    • "nearEnemies" - a list of enemies nearby
  • Boolean for:
    • "isInitialized"
    • "hasContact"
    • "isContact"
    • "isStealth"
    • "isCombat"
    • "isSafe"
  • String for:
    • "status" - can be "stealth", "combat", "safe" or "error"
    • "randomMusic" - one of the available musics
    • "selectMusic"
  • Nothing for:
    • "initialize"
    • "terminate"
    • "forceBehaviour"
    • "playMusic"
    • "onEachFrame"

Examples

Example 1:
[] call BIS_fnc_jukebox;

Additional Information

See also:
playMusic BIS_fnc_music

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