radioChannelCreate: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
No edit summary
 
(62 intermediate revisions by 7 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands]]
{{RV|type=command


{{Command|= Comments
|game1= tkoh
|version1= 1.00


____________________________________________________________________________________________
|game2= arma3
|version2= 0.50


| TKOH |= Game name
|serverExec= server


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


| 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=
|eff= global
____________________________________________________________________________________________


| '''radioChannelCreate''' [color, label, callSign, units, sentenceType] |SYNTAX=
|gr1= Radio and Chat
|p1= [color, label, callSign, units, sentenceType]: [[Array]]
|p2= color: [[Array]] - RGBA color values |PARAMETER1=
|p3= label: [[String]] - label |PARAMETER2=
|p4= callSign: [[String]] - call sign |PARAMETER3=
|p5= units: [[Array]] - list of units in the channel |PARAMETER4=
|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=


|x1= <code>_index = '''radioChannelCreate''' [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2]];</code> |=
|gr2= Custom Radio and Chat


|x2= <code>_index = '''radioChannelCreate''' <nowiki>[[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2],</nowiki> [[false]]<nowiki>];</nowiki>
|descr= Create a custom radio channel with the given color, label, call sign and registered characters.
// disable automatic quotes for chat in channel (ArmA 3)</code> |=
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.


|x3= Create custom channel and add all players to it, present and JIP:<code>[[if]] ([[isServer]]) [[then]]
|s1= [[radioChannelCreate]] [color, label, callSign, units, sentenceType]
{
 
[[private]] _channelName = "Q-dance Radio";
|p1= color: [[Array]] - [[Color|RGBA color]] values
[[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]};
|p2= label: [[String]] - label
[_channelID, {_this [[radioChannelAdd]] <nowiki>[</nowiki>[[player]]]}] [[remoteExec]] ["call", [0, -2] [[select]] [[isDedicated]], _channelName];
 
};</code> |=
|p3= callSign: [[String]] - call sign - see [[radioChannelSetCallSign]]
 
|p4= units: [[Array]] - list of units in the channel


|mp= Execute on the server |=
|p5= sentenceType: [[Boolean]] - (Optional, default [[true]])
| [[radioChannelAdd]], [[radioChannelRemove]], [[radioChannelSetCallSign]], [[radioChannelSetLabel]], [[customChat]], [[customRadio]], [[setCurrentChannel]], [[currentChannel]], [[enableChannel]], [[channelEnabled]], [[getPlayerChannel]] |SEEALSO=
* [[true]] - use ''Protocol'' message color from <sqf inline>getArray (configFile >> "RscChatListDefault" >> "colorMessageProtocol")</sqf>
* [[false]] - use ''Normal'' message color from <sqf inline>getArray (configFile >> "RscChatListDefault" >> "colorMessage")</sqf>


}}
|r1= [[Number]] - created '''[[Channel IDs|custom channel ID]]''' (used in [[customChat]] command), 0 if failed


<h3 style="display:none">Notes</h3>
|x1= <sqf>_channelID = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2]];</sqf>
<dl class="command_description">


|x2= <sqf>
_channelID = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2], true];
// using true also disables automatic quotes for chat in channel (Arma 3)
</sqf>


<!-- Note Section END -->
|x3= Create custom channel and add all players to it, present and JIP:
</dl>
<sqf>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];
};
</sqf>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[radioChannelAdd]] [[radioChannelRemove]] [[radioChannelSetCallSign]] [[radioChannelSetLabel]] [[customChat]] [[customRadio]] [[setCurrentChannel]] [[currentChannel]] [[enableChannel]] [[channelEnabled]] [[getPlayerChannel]] [[radioChannelInfo]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
}}
[[Category:Take On Helicopters: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]


<!-- CONTINUE Notes -->
{{Note
<dl class="command_description">
|user= Killzone_Kid
<dd class="notedate">Posted on January 21, 2016 - 13:30 (UTC)</dd>
|timestamp= 20160121133000
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
|text= Make sure you add all units you intend to speak or receive messages on created custom channel to the channel.
<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 -->
{{Note
<dl class="command_description">
|user= Hypoxic125
<dd class="notedate">Posted on October 12, 2017 - 12:27 (UTC)</dd>
|timestamp= 20221101063808
<dt class="note">[[User:Demellion|Demellion]]</dt>
|text= Units are removed from the chat channel on RESPAWN. Be sure to add units back to their custom chat channels upon respawn via [[Event_Scripts#onPlayerRespawn.sqf|onPlayerRespawn.sqf]] or [[Arma_3:_Event_Handlers#Respawn|Respawn Event Handler]].
<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 -->

Latest revision as of 01:42, 12 March 2024

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 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 - see radioChannelSetCallSign
units: Array - list of units in the channel
sentenceType: Boolean - (Optional, default true)
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], true]; // using true also disables 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:
radioChannelAdd radioChannelRemove radioChannelSetCallSign radioChannelSetLabel customChat customRadio setCurrentChannel currentChannel enableChannel channelEnabled getPlayerChannel radioChannelInfo

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
Killzone_Kid - c
Posted on Jan 21, 2016 - 13:30 (UTC)
Make sure you add all units you intend to speak or receive messages on created custom channel to the channel.
Hypoxic125 - c
Posted on Nov 01, 2022 - 06:38 (UTC)
Units are removed from the chat channel on RESPAWN. Be sure to add units back to their custom chat channels upon respawn via onPlayerRespawn.sqf or Respawn Event Handler.