playMusic: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|PARAMETER3= |r2=" to "|PARAMETER23= |r2=")
Line 9: Line 9:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Plays music defined in [[Description.ext#CfgMusic]] or config.cpp. To stop the music execute [[playMusic]] "" or give the start time which is beyond the music duration [[playMusic]] ["SomeMusic", 1000]; <br><br>
| Plays music defined in [[Description.ext#CfgMusic|Description.ext's CfgMusic]] or config.cpp.
For Arma 3 music, see [[Arma 3 CfgMusic]]. Since Arma 3 v1.67 one can use [[Arma_3_Utilities#Jukebox|Jukebox Utility]] to preview in-game music. |DESCRIPTION=
* [[Arma 3 CfgMusic]]
* [[Arma 2: Music]]
* [[Arma: cfgMusic]]
 
{{Informative | To stop the music, use {{Inline code|[[playMusic]] ""}}.}}
 
{{Feature arma3 | See [[Arma 3 CfgMusic]] for possible vanilla values. Since {{arma3}} v1.67 one can use the [[Arma_3_Utilities#Jukebox|Jukebox Utility]] to preview in-game music.}} |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| '''playMusic''' name |SYNTAX=
| [[playMusic]] musicName |SYNTAX=
| p1 = name : [[String]] - music class
 
|[[Nothing]] |RETURNVALUE=
|p1= musicName: [[String]] - music classname |Parameter1=
 
|[[Nothing]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________
|s2= '''playMusic''' [name, start] |SYNTAX= 2


|p21= [name, start]: [[Array]] |PARAMETER1=
|s2= [[playMusic]] [musicName, start] |SYNTAX2=
|p22 = name: [[String]] - music class |PARAMETER22=
 
|p23= start: [[Number]] - start from (seconds). Could be negative. |PARAMETER23=
|p21= musicName: [[String]] - music classname |PARAMETER21=


|r2= [[Nothing]] |RETURNVALUE= 2
|p22= start: [[Number]] - start, in seconds. Can be negative. |PARAMETER22=


|r2= [[Nothing]] |RETURNVALUE2=
____________________________________________________________________________________________
____________________________________________________________________________________________
|x1 = <code>[[playMusic]] "RadioAmbient1";</code> |EXAMPLE1=
 
|x2 = <code>[[playMusic]] ["RadioAmbient3", 3]; //start from 00:00:03</code> |EXAMPLE2=
|x1= <code>[[playMusic]] "RadioAmbient1";</code> |EXAMPLE1=
|x3 = Play from 00:00:01 to 00:00:05<code>0 = [] [[spawn]] {
 
|x2= <code>[[playMusic]] ["RadioAmbient3", 3]; {{cc|start to play from 00:00:03}}</code> |EXAMPLE2=
 
|x3= Play from 00:00:01 to 00:00:05:
<code>[] [[spawn]] {
[[playMusic]] ["RadioAmbient5", 1];
[[playMusic]] ["RadioAmbient5", 1];
[[sleep]] 4;
[[sleep]] 4;
Line 35: Line 47:


| [[getMusicPlayedTime]], [[playSound]], [[say]], [[createSoundSource]], [[addMusicEventHandler]] |SEEALSO=
| [[getMusicPlayedTime]], [[playSound]], [[say]], [[createSoundSource]], [[addMusicEventHandler]] |SEEALSO=
}}
}}


Line 41: Line 52:
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
<dd class="notedate">
<dt class="note">'''[[User:Crowe|Crowe]]'''
<dd class="note">
You can get all Music Types from [[Arma:_cfgMusic]]
http://community.bistudio.com/wiki/Arma_2:_Music#top


<!-- Note Section END -->
<!-- Note Section END -->
Line 52: Line 57:


<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|PLAYMUSICNAME]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.46|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|PLAYMUSICNAME]]
[[Category:Scripting Commands ArmA|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.46|PLAYMUSICNAME]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA|PLAYMUSICNAME]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|PLAYMUSICNAME]]
[[Category:Scripting Commands Arma 3|PLAYMUSICNAME]]
[[Category:Command_Group:_Sounds|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Sounds|{{uc:{{PAGENAME}}}}]]

Revision as of 16:10, 4 September 2019

Hover & click on the images for description

Description

Description:
Plays music defined in Description.ext's CfgMusic or config.cpp.
To stop the music, use playMusic "".
Arma 3
See Arma 3 CfgMusic for possible vanilla values. Since Arma 3 v1.67 one can use the Jukebox Utility to preview in-game music.
Groups:
Uncategorised

Syntax

Syntax:
playMusic musicName
Parameters:
musicName: String - music classname
Return Value:
Nothing

Alternative Syntax

Syntax:
playMusic [musicName, start]
Parameters:
musicName: String - music classname
start: Number - start, in seconds. Can be negative.
Return Value:
Nothing

Examples

Example 1:
playMusic "RadioAmbient1";
Example 2:
playMusic ["RadioAmbient3", 3]; // start to play from 00:00:03
Example 3:
Play from 00:00:01 to 00:00:05: [] spawn { playMusic ["RadioAmbient5", 1]; sleep 4; playMusic ""; };

Additional Information

See also:
getMusicPlayedTimeplaySoundsaycreateSoundSourceaddMusicEventHandler

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