BIS fnc jukebox: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (GVI 1.00 --> 1.08 http://dev.arma3.com/post/spotrep-00016)
(Page filling without (good) examples)
Line 1: Line 1:
{{Function|= Comments
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________
Line 8: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>/*
| Plays music, depending on the player group status. |= Description
____________________________________________________________________________________________


Description:
| [function, parameters] call [[BIS_fnc_jukebox]] |= Syntax
Plays music, depending on the player groups status


Parameter(s):
|p1= function: [[String]] - (Optional, default "initialize") can be one of:
_this select 0: STRING - The sub-function to call
* "initialize"
_this select 1: ARRAY - Parameters to be sent to sub-function
* "terminate"
* "readContainerFromConfig"
Returns:
* "isInitialized"
Dependent on sub-function
* "forceBehaviour"
*/
* "status"
* "randomMusic"
* "selectMusic"
* "playMusic"
* "nearEnemies"
* "hasContact"
* "isContact"
* "isStealth"
* "isCombat"
* "isSafe"
* "onEachFrame"
&nbsp;|= Parameter 1


#define DEFAULT_VOLUME 0.2
|p2= parameters: [[Array]] - (Optional)
#define DEFAULT_TRANSITION 5
#define DEFAULT_RADIUS 500
#define DEFAULT_EXECUTIONRATE 5
#define DEFAULT_NOREPEAT true


//Parameters
* '''"initialize"''': [stealthMusics, combatMusics, safeMusics, volume, transition, radius, executionRate, noRepeat]
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
** stealthMusics: [[Array]] of [[String|Strings]]
____________________________________________________________________________________________
** combatMusics: [[Array]] of [[String|Strings]]
** safeMusics: [[Array]] of [[String|Strings]]
** 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|Strings]] - 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 |= Parameter 2
 
|
* [[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" |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code></code> |=  
|x1= <code>[] [[call]] [[BIS_fnc_jukebox]];</code> |= Example 1
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
| [[playMusic]], [[BIS_fnc_music]] |= See also
 
}}
}}



Revision as of 17:38, 26 April 2018

Hover & click on the images for description

Description

Description:
Plays music, depending on the player group status.
Execution:
call
Groups:
Uncategorised

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:
playMusicBIS_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

Notes

Bottom Section