radioChannelCreate: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " 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 | ||
| TKOH | | TKOH | ||
|1.00 | |1.00 | ||
|serverExec= server |Exec= | |serverExec= server |Exec= | ||
|arg= global | |arg= global | ||
|eff= global | |eff= global | ||
|gr1= Radio and Chat | |gr1= Radio and Chat | ||
|gr2= Custom Radio and Chat | |gr2= Custom Radio and Chat | ||
| Create a custom radio channel with the given color, label, call sign and registered characters. The '''[[Channel IDs|custom channel ID]]''' returned can be used to manipulate the created channel later. There are 10 slots for custom radio channels which would correspond to channels 6-15 (see [[getPlayerChannel]]). The command will find an unused index in this range and create it when found. | | Create a custom radio channel with the given color, label, call sign and registered characters. The '''[[Channel IDs|custom channel ID]]''' returned can be used to manipulate the created channel later. There are 10 slots for custom radio channels which would correspond to channels 6-15 (see [[getPlayerChannel]]). The command will find an unused index in this range and create it when found. | ||
| [[radioChannelCreate]] [color, label, callSign, units, sentenceType] | | [[radioChannelCreate]] [color, label, callSign, units, sentenceType] | ||
|p1= color: [[Array]] - RGBA color values | |p1= color: [[Array]] - RGBA color values | ||
|p2= label: [[String]] - label | |p2= label: [[String]] - label | ||
|p3= callSign: [[String]] - call sign | |p3= callSign: [[String]] - call sign | ||
|p4= units: [[Array]] - list of units in the channel | |p4= units: [[Array]] - list of units in the channel | ||
|p5= sentenceType (Optional): [[Boolean]] (Default: [[true]]) | |p5= sentenceType (Optional): [[Boolean]] (Default: [[true]]) | ||
* [[true]] - use ''Protocol'' message color from <tt>[[getArray]] ([[configFile]] >> "RscChatListDefault" >> "colorMessageProtocol")</tt> | * [[true]] - use ''Protocol'' message color from <tt>[[getArray]] ([[configFile]] >> "RscChatListDefault" >> "colorMessageProtocol")</tt> | ||
* [[false]] - use ''Normal'' message color from <tt>[[getArray]] ([[configFile]] >> "RscChatListDefault" >> "colorMessage")</tt> | * [[false]] - use ''Normal'' message color from <tt>[[getArray]] ([[configFile]] >> "RscChatListDefault" >> "colorMessage")</tt> | ||
| [[Number]] - created '''[[Channel IDs|custom channel ID]]''' (used in [[customChat]] command), 0 if failed | | [[Number]] - created '''[[Channel IDs|custom channel ID]]''' (used in [[customChat]] command), 0 if failed | ||
|x1= <code>_channelID= [[radioChannelCreate]] [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2]];</code> | |x1= <code>_channelID= [[radioChannelCreate]] [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2]];</code> | ||
|x2= <code>_channelID = [[radioChannelCreate]] <nowiki>[[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2],</nowiki> [[false]]<nowiki>];</nowiki> | |x2= <code>_channelID = [[radioChannelCreate]] <nowiki>[[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2],</nowiki> [[false]]<nowiki>];</nowiki> | ||
{{cc|disable automatic quotes for chat in channel ({{arma3}})}}</code> | {{cc|disable automatic quotes for chat in channel ({{arma3}})}}</code> | ||
|x3= Create custom channel and add all players to it, present and JIP:<code>[[if]] ([[isServer]]) [[then]] | |x3= Create custom channel and add all players to it, present and JIP:<code>[[if]] ([[isServer]]) [[then]] | ||
Line 45: | Line 45: | ||
[[if]] (_channelID == 0) [[exitWith]] {[[diag_log]] [[format]] ["Custom channel '%1' creation failed!", _channelName]}; | [[if]] (_channelID == 0) [[exitWith]] {[[diag_log]] [[format]] ["Custom channel '%1' creation failed!", _channelName]}; | ||
[_channelID, {_this [[radioChannelAdd]] [<nowiki/>[[player]]]}] [[remoteExec]] ["call", [0, -2] [[select]] [[isDedicated]], _channelName]; | [_channelID, {_this [[radioChannelAdd]] [<nowiki/>[[player]]]}] [[remoteExec]] ["call", [0, -2] [[select]] [[isDedicated]], _channelName]; | ||
};</code> | };</code> | ||
| [[radioChannelAdd]], [[radioChannelRemove]], [[radioChannelSetCallSign]], [[radioChannelSetLabel]], [[customChat]], [[customRadio]], [[setCurrentChannel]], [[currentChannel]], [[enableChannel]], [[channelEnabled]], [[getPlayerChannel]] | | [[radioChannelAdd]], [[radioChannelRemove]], [[radioChannelSetCallSign]], [[radioChannelSetLabel]], [[customChat]], [[customRadio]], [[setCurrentChannel]], [[currentChannel]], [[enableChannel]], [[channelEnabled]], [[getPlayerChannel]] | ||
}} | }} | ||
Revision as of 01:26, 18 January 2021
Description
- Description:
- Create a custom radio channel with the given color, label, call sign and registered characters. The custom channel ID returned can be used to manipulate the created channel later. There are 10 slots for custom radio channels which would correspond to channels 6-15 (see getPlayerChannel). The command will find an unused index in this range and create it when found.
- Groups:
- Radio and ChatCustom Radio and Chat
Syntax
- Syntax:
- radioChannelCreate [color, label, callSign, units, sentenceType]
- Parameters:
- color: Array - RGBA color values
- label: String - label
- callSign: String - call sign
- units: Array - list of units in the channel
- sentenceType (Optional): Boolean (Default: true)
- true - use Protocol message color from getArray (configFile >> "RscChatListDefault" >> "colorMessageProtocol")
- false - use Normal message color from getArray (configFile >> "RscChatListDefault" >> "colorMessage")
- Return Value:
- Number - created custom channel ID (used in customChat command), 0 if failed
Examples
- Example 1:
_channelID= radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2]];
- Example 2:
_channelID = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2], false]; // disable automatic quotes for chat in channel (Arma 3)
- Example 3:
- Create custom channel and add all players to it, present and JIP:
if (isServer) then { private _channelName = "Q-dance Radio"; private _channelID = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], _channelName, "%UNIT_NAME", []]; if (_channelID == 0) exitWith {diag_log format ["Custom channel '%1' creation failed!", _channelName]}; [_channelID, {_this radioChannelAdd [player]}] remoteExec ["call", [0, -2] select isDedicated, _channelName]; };
Additional Information
- See also:
- radioChannelAddradioChannelRemoveradioChannelSetCallSignradioChannelSetLabelcustomChatcustomRadiosetCurrentChannelcurrentChannelenableChannelchannelEnabledgetPlayerChannel
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
- Posted on January 21, 2016 - 13:30 (UTC)
- Killzone Kid
- Make sure you add all units you intend to speak or receive messages on created custom channel to the channel.
- Posted on October 12, 2017 - 12:27 (UTC)
- Demellion
- WARNING: Be aware that created channels order and count are different between server and client. Example 3 shown that server-side channel ID is actually 4, while client currentChannel on the same channel results in 9. Behaviour is yet unknown for me.
Bottom Section
Categories:
- Scripting Commands
- Introduced with Take On Helicopters version 1.00
- Take On Helicopters: New Scripting Commands
- Take On Helicopters: Scripting Commands
- Command Group: Radio and Chat
- Command Group: Custom Radio and Chat
- Scripting Commands: Global Effect
- Scripting Commands: Server Execution
- Arma 3: Scripting Commands