playMusic: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "\[\[Category:[cC]ommand[_ ][gG]roup:[_ ][^|]+\|\{*uc:{{PAGENAME}*]\]" to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
| ofp | | ofp | ||
|1.00 | |1.00 | ||
|eff= local | |eff= local | ||
|gr1= Sounds | |gr1= Sounds | ||
| Plays music defined in [[Description.ext#CfgMusic|Description.ext's CfgMusic]] or config.cpp. If the ''musicName'' could not be found a message is logged into the .rpt file: <tt>Music <''musicName''> not found</tt>. | | Plays music defined in [[Description.ext#CfgMusic|Description.ext's CfgMusic]] or config.cpp. If the ''musicName'' could not be found a message is logged into the .rpt file: <tt>Music <''musicName''> not found</tt>. | ||
Line 16: | Line 16: | ||
{{Informative | To stop the music, use {{Inline code|[[playMusic]] ""}}.}} | {{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.}} | {{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.}} | ||
| [[playMusic]] musicName | | [[playMusic]] musicName | ||
|p1= musicName: [[String]] - music classname | |p1= musicName: [[String]] - music classname | ||
|[[Nothing]] | |[[Nothing]] | ||
|s2= [[playMusic]] [musicName, start] | |s2= [[playMusic]] [musicName, start] | ||
|p21= musicName: [[String]] - music classname |PARAMETER21= | |p21= musicName: [[String]] - music classname |PARAMETER21= | ||
Line 30: | Line 30: | ||
|p22= start: [[Number]] - start, in seconds. Can be negative. |PARAMETER22= | |p22= start: [[Number]] - start, in seconds. Can be negative. |PARAMETER22= | ||
|r2= [[Nothing]] | |r2= [[Nothing]] | ||
|x1= <code>[[playMusic]] "RadioAmbient1";</code> | |x1= <code>[[playMusic]] "RadioAmbient1";</code> | ||
|x2= <code>[[playMusic]] ["RadioAmbient3", 3]; {{cc|start to play from 00:00:03}}</code> | |x2= <code>[[playMusic]] ["RadioAmbient3", 3]; {{cc|start to play from 00:00:03}}</code> | ||
|x3= Play from 00:00:01 to 00:00:05: | |x3= Play from 00:00:01 to 00:00:05: | ||
Line 41: | Line 41: | ||
[[sleep]] 4; | [[sleep]] 4; | ||
[[playMusic]] ""; | [[playMusic]] ""; | ||
};</code> | };</code> | ||
| [[getMusicPlayedTime]], [[playSound]], [[say]], [[createSoundSource]], [[addMusicEventHandler]], [[fadeMusic]] | | [[getMusicPlayedTime]], [[playSound]], [[say]], [[createSoundSource]], [[addMusicEventHandler]], [[fadeMusic]] | ||
}} | }} | ||
Revision as of 01:27, 18 January 2021
Description
- Description:
- Plays music defined in Description.ext's CfgMusic or config.cpp. If the musicName could not be found a message is logged into the .rpt file: Music <musicName> not found.
- Groups:
- Sounds
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
Bottom Section
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Command Group: Sounds
- Scripting Commands: Local Effect
- Scripting Commands OFP 1.46
- Scripting Commands OFP 1.96
- Scripting Commands OFP 1.99
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 3: Scripting Commands