radioChannelCreate: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(return id)
m (Text replacement - " <nowiki>[</nowiki>" to " [<nowiki/>")
(24 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands]]
[[Category:Scripting Commands]]


{{Command|= Comments
{{Command|Comments=


____________________________________________________________________________________________
____________________________________________________________________________________________


| TKOH |= Game name
| TKOH |Game name=


|1.00|= Game version
|1.00|Game version=
|exec= server|= Exec
|serverExec= server |Exec=
|arg= global|= Arguments in MP
|arg= global|Multiplayer Arguments=
|eff= global|= Effects in MP
|eff= global|Multiplayer Effects=
____________________________________________________________________________________________
____________________________________________________________________________________________


| Create a custom radio channel with the given color, label, call sign and registered characters. The index returned can be used to manipulate the created channel later.  
| Create a custom radio channel with the given color, label, call sign and registered characters. The index 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. '''Server only'''. |DESCRIPTION=
 
There are 10 slots for custom radio channels. The command will find an unused index in this range and create it when found. |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| '''radioChannelCreate''' [color, label, callSign, units]|= Syntax
| '''radioChannelCreate''' [color, label, callSign, units, sentenceType] |SYNTAX=
|p1= [color, label, callSign, units, sentenceType]: [[Array]]
|p2= color: [[Array]] - RGBA color values |PARAMETER2=


|p1= color: [[Array]] - RGBA color values |= Parameter 1
|p3= label: [[String]] - label |PARAMETER2=
|p2= label: [[String]] - label |= Parameter 2
|p4= callSign: [[String]] - call sign |PARAMETER3=
|p3= callSign: [[String]] - call sign |= Parameter 3
|p5= units: [[Array]] - list of units in the channel |PARAMETER4=
|p4= units: [[Array]] - list of units in the channel |= Parameter 4
|p6= sentenceType (Optional): [[Boolean]] (Default: [[true]])
* [[true]] - use ''Protocol'' message color from <tt>[[getArray]] ([[configFile]] >> "RscChatListDefault" >> "colorMessageProtocol")</tt>
* [[false]] - use ''Normal'' message color from <tt>[[getArray]] ([[configFile]] >> "RscChatListDefault" >> "colorMessage")</tt> |PARAMETER5=
|  [[Number]] - created channel ID (used in [[customChat]] command), 0 if failed |RETURNVALUE=


| [[Number]] - created channel id (used in [[customChat]] command) |= Return value
|x1= <code>_index = '''radioChannelCreate''' [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2]];</code> |Example1=
____________________________________________________________________________________________


| s2= '''radioChannelCreate''' [color, label, callSign, characters, sentenceType] |= Syntax
|x2= <code>_index = '''radioChannelCreate''' <nowiki>[[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2],</nowiki> [[false]]<nowiki>];</nowiki>
|p21= color: [[Array]] - RGBA color values |= Parameter 1
// disable automatic quotes for chat in channel (Arma 3)</code> |Example2=
|p22= label: [[String]] - label |= Parameter 2
|p23= callSign: [[String]] - call sign |= Parameter 3
|p24= characters: [[Array]] - list of units in the channel |= Parameter 4
|p25= sentenceType: [[Boolean]] - enable putting all chat messages in quotations (default: true) |= Parameter 5
| r2= [[Number]] - created channel id (used in [[customChat]] command)|= Return value


|x1= <code>_index = '''radioChannelCreate''' [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player]];</code> |=
|x3= Create custom channel and add all players to it, present and JIP:<code>[[if]] ([[isServer]]) [[then]]
 
{
|x2= <code>_index = '''radioChannelCreate''' <nowiki>[[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [</nowiki>[[player]]<nowiki>],</nowiki> [[false]]<nowiki>];</nowiki>
[[private]] _channelName = "Q-dance Radio";
// disable automatic quotes for chat in channel (ArmA 3)</code> |=
[[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]] [<nowiki/>[[player]]]}] [[remoteExec]] ["call", [0, -2] [[select]] [[isDedicated]], _channelName];
};</code> |=


|mp= Execute on the server |=
|mp= Execute on the server |=
| [[radioChannelAdd]], [[radioChannelRemove]], [[radioChannelSetCallSign]], [[radioChannelSetLabel]], [[customChat]], [[customRadio]] |= See also
| [[radioChannelAdd]], [[radioChannelRemove]], [[radioChannelSetCallSign]], [[radioChannelSetLabel]], [[customChat]], [[customRadio]], [[setCurrentChannel]], [[currentChannel]], [[enableChannel]], [[channelEnabled]], [[getPlayerChannel]] |SEEALSO=


}}
}}
Line 58: Line 58:
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on January 21, 2016 - 13:30 (UTC)</dd>
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<dd class="note">
Make sure you add all units you intend to speak or receive messages on created custom channel to the channel.
</dd>
</dl>
<!-- DISCONTINUE Notes -->
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on October 12, 2017 - 12:27 (UTC)</dd>
<dt class="note">[[User:Demellion|Demellion]]</dt>
<dd class="note">
'''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.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 12:28, 19 March 2020


Hover & click on the images for description

Description

Description:
Create a custom radio channel with the given color, label, call sign and registered characters. The index 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. Server only.
Multiplayer:
Execute on the server
Groups:
Uncategorised

Syntax

Syntax:
radioChannelCreate [color, label, callSign, units, sentenceType]
Parameters:
[color, label, callSign, units, sentenceType]: Array
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)
Return Value:
Number - created channel ID (used in customChat command), 0 if failed

Examples

Example 1:
_index = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2]];
Example 2:
_index = 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

Bottom Section

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.