playMusic: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "|PARAMETER3= |r2=" to "|PARAMETER23= |r2=") |
Lou Montana (talk | contribs) |
||
Line 9: | Line 9: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| Plays music defined in [[Description.ext#CfgMusic]] or config.cpp. | | Plays music defined in [[Description.ext#CfgMusic|Description.ext's CfgMusic]] or config.cpp. | ||
* [[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]] musicName |SYNTAX= | ||
| p1 = | |||
|[[Nothing]] | |p1= musicName: [[String]] - music classname |Parameter1= | ||
|[[Nothing]] |RETURNVALUE= | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | |s2= [[playMusic]] [musicName, start] |SYNTAX2= | ||
| | |||
|p21= musicName: [[String]] - music classname |PARAMETER21= | |||
| | |p22= start: [[Number]] - start, in seconds. Can be negative. |PARAMETER22= | ||
|r2= [[Nothing]] |RETURNVALUE2= | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1 = <code>[[playMusic]] "RadioAmbient1";</code> |EXAMPLE1= | |||
|x2 = <code>[[playMusic]] ["RadioAmbient3", 3]; | |x1= <code>[[playMusic]] "RadioAmbient1";</code> |EXAMPLE1= | ||
|x3 = Play from 00:00:01 to 00:00:05<code> | |||
|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 --> | ||
<!-- 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| | [[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 | [[Category:Scripting Commands ArmA|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]] | |||
[[Category:Scripting Commands | [[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Scripting Commands Arma 3| | |||
[[Category:Command_Group:_Sounds|{{uc:{{PAGENAME}}}}]] | [[Category:Command_Group:_Sounds|{{uc:{{PAGENAME}}}}]] |
Revision as of 15:10, 4 September 2019
Description
- Description:
- Plays music defined in Description.ext's CfgMusic or config.cpp.
- Groups:
- Uncategorised
Syntax
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
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
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Command Group: Uncategorised
- Scripting Commands: Local Effect
- Scripting Commands OFP 1.46
- Scripting Commands OFP 1.96
- Scripting Commands OFP 1.99
- Scripting Commands ArmA
- Scripting Commands ArmA2
- Scripting Commands Arma 3
- Command Group: Sounds