Communication Menu – Arma 3
Lou Montana (talk | contribs) m (Text replacement - "{{KeyboardShortcut" to "{{Controls") |
Lou Montana (talk | contribs) (Fix Expression Arguments and Submenus) |
||
| (5 intermediate revisions by 2 users not shown) | |||
| Line 6: | Line 6: | ||
* Press {{Controls|8}} then {{Controls|1}} (Reply - Communication) | * Press {{Controls|8}} then {{Controls|1}} (Reply - Communication) | ||
Available items are announced upon adding by a [[Arma 3 Notification|notification]] and remain visualized as icons next to the commanding menu.<br> | {{Feature|arma2|For {{arma2}} and additional information, see [[Arma 2: Custom Command Menu]].}} | ||
Available items are announced upon adding by a [[Arma 3: Notification|notification]] and remain visualized as icons next to the commanding menu.<br> | |||
[[File:A3_commMenu.jpg|Communication menu and icons|500px]] | [[File:A3_commMenu.jpg|Communication menu and icons|500px]] | ||
= Configuration = | |||
== Config == | == Configuration == | ||
=== Config === | |||
Communication menu items can be defined in config - global [[Config.cpp]], [[Campaign Description.ext]] or mission [[Description.ext]] (searched in this order, the latter has the highest priority). | Communication menu items can be defined in config - global [[Config.cpp]], [[Campaign Description.ext]] or mission [[Description.ext]] (searched in this order, the latter has the highest priority). | ||
{{Feature|informative|'CfgCommunicationMenu' is purely scripted config which requires the use of scripted function [[BIS_fnc_addCommMenuItem]]. It will not work with [[showCommandingMenu]] script command.}} | |||
[[File:CommunicationMenuIconsA3Beta.jpg|thumb|Preview and path for icons]] | [[File:CommunicationMenuIconsA3Beta.jpg|thumb|Preview and path for icons]] | ||
| Line 31: | Line 37: | ||
{ | { | ||
text = "Menu Comms 1"; | text = "Menu Comms 1"; | ||
submenu = "#USER:MENU_COMMS_1"; | submenu = "#USER:MENU_COMMS_1"; // will open submenu that is defined as global variable MENU_COMMS_1 | ||
expression = ""; | expression = ""; | ||
icon = ""; | icon = ""; | ||
| Line 55: | Line 61: | ||
You can also preview pre-defined items using the [[BIS_fnc_configViewer|Splendid™ Config Viewer]]. | You can also preview pre-defined items using the [[BIS_fnc_configViewer|Splendid™ Config Viewer]]. | ||
== Simple expressions == | === Simple expressions === | ||
<div style="display: inline-block; max-height: 40em; overflow: auto"> | <div style="display: inline-block; max-height: 40em; overflow: auto"> | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
| Line 67: | Line 74: | ||
| cursorOnGround || Only callable when pointing at a valid position || {{Icon|checked}} | | cursorOnGround || Only callable when pointing at a valid position || {{Icon|checked}} | ||
|- | |- | ||
| IsLeader | | IsLeader || Player has to be the leader of his group || {{Icon|checked}} | ||
|- | |- | ||
| IsAlone || | | IsAlone || || {{Icon|unchecked}} | ||
|- | |- | ||
| IsAloneInVehicle || | | IsAloneInVehicle || || {{Icon|unchecked}} | ||
|- | |- | ||
| IsCommander || | | IsCommander || || {{Icon|unchecked}} | ||
|- | |- | ||
| VehicleCommander || | | VehicleCommander || || {{Icon|unchecked}} | ||
|- | |- | ||
| CommandsToGunner || | | CommandsToGunner || || {{Icon|unchecked}} | ||
|- | |- | ||
| CommandsToPilot || | | CommandsToPilot || || {{Icon|unchecked}} | ||
|- | |- | ||
| NotEmpty || | | NotEmpty || || {{Icon|unchecked}} | ||
|- | |- | ||
| NotEmptySoldiers || | | NotEmptySoldiers || || {{Icon|unchecked}} | ||
|- | |- | ||
| NotEmptyCommanders || | | NotEmptyCommanders || || {{Icon|unchecked}} | ||
|- | |- | ||
| NotEmptyMainTeam || | | NotEmptyMainTeam || || {{Icon|unchecked}} | ||
|- | |- | ||
| NotEmptyRedTeam || | | NotEmptyRedTeam || || {{Icon|unchecked}} | ||
|- | |- | ||
| NotEmptyGreenTeam || | | NotEmptyGreenTeam || || {{Icon|unchecked}} | ||
|- | |- | ||
| NotEmptyBlueTeam || | | NotEmptyBlueTeam || || {{Icon|unchecked}} | ||
|- | |- | ||
| NotEmptyYellowTeam || | | NotEmptyYellowTeam || || {{Icon|unchecked}} | ||
|- | |- | ||
| NotEmptySubgroups || | | NotEmptySubgroups || || {{Icon|unchecked}} | ||
|- | |- | ||
| NotEmptyInVehicle || | | NotEmptyInVehicle || || {{Icon|unchecked}} | ||
|- | |- | ||
| SelectedTeam || | | SelectedTeam || || {{Icon|unchecked}} | ||
|- | |- | ||
| SelectedUnit || | | SelectedUnit || || {{Icon|unchecked}} | ||
|- | |- | ||
| FuelLow || | | FuelLow || || {{Icon|unchecked}} | ||
|- | |- | ||
| AmmoLow || | | AmmoLow || || {{Icon|unchecked}} | ||
|- | |- | ||
| Injured || | | Injured || || {{Icon|unchecked}} | ||
|- | |- | ||
| Multiplayer || | | Multiplayer || || {{Icon|unchecked}} | ||
|- | |- | ||
| AreActions || | | AreActions || || {{Icon|unchecked}} | ||
|- | |- | ||
| CursorOnGroupMember || | | CursorOnGroupMember || || {{Icon|unchecked}} | ||
|- | |- | ||
| CursorOnHoldingFire || | | CursorOnHoldingFire || || {{Icon|unchecked}} | ||
|- | |- | ||
| CursorOnEmptyVehicle || | | CursorOnEmptyVehicle || || {{Icon|unchecked}} | ||
|- | |- | ||
| CursorOnVehicleCanGetIn || | | CursorOnVehicleCanGetIn || || {{Icon|unchecked}} | ||
|- | |- | ||
| CursorOnFriendly || | | CursorOnFriendly || || {{Icon|unchecked}} | ||
|- | |- | ||
| CursorOnEnemy || | | CursorOnEnemy || || {{Icon|unchecked}} | ||
|- | |- | ||
| CursorOnGround || | | CursorOnGround || || {{Icon|unchecked}} | ||
|- | |- | ||
| CanSelectUnitFromBar || | | CanSelectUnitFromBar || || {{Icon|unchecked}} | ||
|- | |- | ||
| CanDeselectUnitFromBar || | | CanDeselectUnitFromBar || || {{Icon|unchecked}} | ||
|- | |- | ||
| CanSelectVehicleFromBar || | | CanSelectVehicleFromBar || || {{Icon|unchecked}} | ||
|- | |- | ||
| CanDeselectVehicleFromBar || | | CanDeselectVehicleFromBar || || {{Icon|unchecked}} | ||
|- | |- | ||
| CanSelectTeamFromBar || | | CanSelectTeamFromBar || || {{Icon|unchecked}} | ||
|- | |- | ||
| CanDeselectTeamFromBar || | | CanDeselectTeamFromBar || || {{Icon|unchecked}} | ||
|- | |- | ||
| FormationLine || | | FormationLine || || {{Icon|unchecked}} | ||
|- | |- | ||
| FormationDiamond || | | FormationDiamond || || {{Icon|unchecked}} | ||
|- | |- | ||
| SomeSelectedHoldingFire || | | SomeSelectedHoldingFire || || {{Icon|unchecked}} | ||
|- | |- | ||
| PlayableLeader || | | PlayableLeader || || {{Icon|unchecked}} | ||
|- | |- | ||
| PlayableSelected || | | PlayableSelected || || {{Icon|unchecked}} | ||
|- | |- | ||
| IsWatchCommanded || | | IsWatchCommanded || || {{Icon|unchecked}} | ||
|- | |- | ||
| IsSelectedToAdd || | | IsSelectedToAdd || || {{Icon|unchecked}} | ||
|- | |- | ||
| HCIsLeader || | | HCIsLeader || || {{Icon|unchecked}} | ||
|- | |- | ||
| HCCursorOnIcon || | | HCCursorOnIcon || || {{Icon|unchecked}} | ||
|- | |- | ||
| HCCursorOnIconSelectable || | | HCCursorOnIconSelectable || || {{Icon|unchecked}} | ||
|- | |- | ||
| HCCanSelectUnitFromBar || | | HCCanSelectUnitFromBar || || {{Icon|unchecked}} | ||
|- | |- | ||
| HCCanDeselectUnitFromBar || | | HCCanDeselectUnitFromBar || || {{Icon|unchecked}} | ||
|- | |- | ||
| HCCanSelectTeamFromBar || | | HCCanSelectTeamFromBar || || {{Icon|unchecked}} | ||
|- | |- | ||
| HCCanDeselectTeamFromBar || | | HCCanDeselectTeamFromBar || || {{Icon|unchecked}} | ||
|- | |- | ||
| HCNotEmpty || | | HCNotEmpty || || {{Icon|unchecked}} | ||
|- | |- | ||
| PlayerVehicleCanGetIn || | | PlayerVehicleCanGetIn || || {{Icon|unchecked}} | ||
|- | |- | ||
| IsXbox || | | IsXbox || || {{Icon|unchecked}} | ||
|- | |- | ||
| IsTeamSwitch || | | IsTeamSwitch || || {{Icon|unchecked}} | ||
|- | |- | ||
| CursorOnNotEmptySubgroups || | | CursorOnNotEmptySubgroups || || {{Icon|unchecked}} | ||
|- | |- | ||
| SomeSelectedHaveTarget || | | SomeSelectedHaveTarget || || {{Icon|unchecked}} | ||
|- | |- | ||
| CursorOnGroupMemberSelected || | | CursorOnGroupMemberSelected || || {{Icon|unchecked}} | ||
|- | |- | ||
| HCCursorOnIconSelectableSelected || | | HCCursorOnIconSelectableSelected || || {{Icon|unchecked}} | ||
|- | |- | ||
| HCCursorOnIconenemy || | | HCCursorOnIconenemy || || {{Icon|unchecked}} | ||
|- | |- | ||
| PlayerOwnRadio || | | PlayerOwnRadio || || {{Icon|unchecked}} | ||
|- | |- | ||
| CursorOnNeedFirstAID || | | CursorOnNeedFirstAID || || {{Icon|unchecked}} | ||
|- | |- | ||
| CursorOnNeedHeal || | | CursorOnNeedHeal || || {{Icon|unchecked}} | ||
|} | |} | ||
</div> | </div> | ||
= | |||
Use following functions to add the item in your mission or system: | == Add Menu Item == | ||
Use the following functions to add the item in your mission or system: | |||
* [[BIS_fnc_addCommMenuItem]] | * [[BIS_fnc_addCommMenuItem]] | ||
* [[BIS_fnc_removeCommMenuItem]] | * [[BIS_fnc_removeCommMenuItem]] | ||
| Line 202: | Line 211: | ||
Number of slots is limited to 10, no pagination is implemented. Larger number is an edge case, no mission should need as many supports. | Number of slots is limited to 10, no pagination is implemented. Larger number is an edge case, no mission should need as many supports. | ||
== | {{Feature|informative|See all {{Link|Category:Function Group: Communication Menu|Communication Menu}} functions.}} | ||
=== Submenu === | |||
== | ==== Config ==== | ||
<syntaxhighlight lang="cpp"> | |||
submenu = "#USER:MENU_COMMS_1"; // "MENU_COMMS_1" is just a global variable, can be named anything | |||
</syntaxhighlight> | |||
==== SQF ==== | |||
A submenu is an array in format [menuInfo, item1, item2, ... itemX]: | |||
* menuInfo: [[Array]] format [menuName, hasInputFocus]: | |||
** menuName: [[String]] | |||
** hasInputFocus: [[Boolean]] - as of {{arma3}} v1.05, if "has input focus" is false, custom icons are not displayed | |||
* itemX: [[Array]] format [itemName, assignedKey, submenuName, command, expression, isVisible, isActive, iconPath]: | |||
** itemName: [[String]] - displayed title | |||
** assignedKey: [[Array]] of [[Number]]s (see [[DIK KeyCodes]]) - e.g 0 = no key, 1 = {{Controls|Esc}}, etc | |||
** submenuName: [[String]] - user menu name string (e.g "#USER:MY_SUBMENU_NAME"), "" for script to execute. | |||
** command: [[Number]] - for main menu, -1 = CMD_SEPARATOR, -2 = CMD_NOTHING, -3 = CMD_HIDE_MENU, -4 = CMD_BACK, -5 (custom menu only) = CMD_EXECUTE | |||
** expression: [[Array]] of [[String]]s format [type, codeString]: | |||
*** type: [[String]] - the <sqf inline>"expression"</sqf> string, always | |||
*** codeString: [[String]] - {{Link|SQF Syntax|SQF}} code in string format (see e.g {{Link|toString#Syntax_2|toString}}); the expression has predefined variables: | |||
**** _caller: [[Object]] - unit which called the item, usually [[player]] | |||
**** _pos: [[Array]] in format [[Position]] - cursor position | |||
**** _target: [[Object]] - cursor target | |||
**** _is3D: [[Boolean]] - [[true]] when in 3D scene, [[false]] when in map | |||
**** _id: [[String]] - item ID as returned by [[BIS_fnc_addCommMenuItem]] function | |||
** isVisible: [[String]] - visibility condition; "1" for true, "0" for false, or optional argument string e.g "CursorOnGround" | |||
** isActive: [[String]] - enabled condition; "1" for true, "0" for false, or optional argument string e.g "CursorOnGround" | |||
** iconPath: [[String]] - (Optional, default "") cursor icon path for this menu item | |||
< | ; Example | ||
<sqf> | |||
MENU_COMMS_1 = | |||
[ | [ | ||
["MenuName", false], | |||
["Teleport", [2], "", -5, [["expression", "player setPos _pos;"]], "1", "1", "\A3\ui_f\data\IGUI\Cfg\Cursors\iconcursorsupport_ca.paa"], | |||
["MenuName", | ["Kill Target", [3], "", -5, [["expression", "_target setDamage 1;"]], "1", "1", "\A3\ui_f\data\IGUI\Cfg\Cursors\iconcursorsupport_ca.paa"], | ||
["Disabled", [4], "", -5, [["expression", ""]], "1", "0"], | |||
["Submenu", [5], "#USER:MENU_COMMS_2", -5, [], "1", "1"] | |||
]; | |||
["Teleport", [2], "", -5, | |||
["Kill Target", [3], "", -5, | |||
["Disabled", [4], "", -5, | |||
["Submenu", [5], "#USER:MENU_COMMS_2", -5, [ | |||
]; | |||
MENU_COMMS_2 = | MENU_COMMS_2 = | ||
[ | [ | ||
["Submenu", | ["Submenu", false], | ||
["Option 1", [2], "", -5, | ["Option 1", [2], "", -5, [["expression", "hint 'Option 1';"]], "1", "1"], | ||
["Option 2", [3], "", -5, | ["Option 2", [3], "", -5, [["expression", "hint 'Option 2';"]], "1", "1"], | ||
["Option 3", [4], "", -5, | ["Option 3", [4], "", -5, [["expression", "hint 'Option 3';"]], "1", "1"] | ||
]; | ]; | ||
</ | </sqf> | ||
=== Existing Submenus === | <sqf>showCommandingMenu "#USER:MENU_COMMS_1"; // displays the custom menu</sqf> | ||
Some of the existing submenus | |||
==== Existing Submenus ==== | |||
Some of the existing submenus: | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| Line 273: | Line 292: | ||
| "#USER:BIS_MENU_SOM_Support" || Communication Support menu | | "#USER:BIS_MENU_SOM_Support" || Communication Support menu | ||
|} | |} | ||
{{GameCategory|arma3|Editing}} | {{GameCategory|arma3|Editing}} | ||
Latest revision as of 14:53, 25 October 2025
Communication menu is a commanding menu where support or mission requests are placed.
The player can access it using following means:
- Open the quick command menu ~ and select "Communication" item
- Press 8 then 1 (Reply - Communication)
Available items are announced upon adding by a notification and remain visualized as icons next to the commanding menu.
Configuration
Config
Communication menu items can be defined in config - global Config.cpp, Campaign Description.ext or mission Description.ext (searched in this order, the latter has the highest priority).
class CfgCommunicationMenu
{
class myArtillery
{
text = "Artillery Strike"; // Text displayed in the menu and in a notification
submenu = ""; // Submenu opened upon activation (expression is ignored when submenu is not empty.)
expression = "player setVariable ['BIS_SUPP_request', ['Artillery', _pos]];"; // Code executed upon activation
icon = "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\artillery_ca.paa"; // Icon displayed permanently next to the command menu
cursor = "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"; // Custom cursor displayed when the item is selected
enable = "1"; // Simple expression condition for enabling the item
removeAfterExpressionCall = 1; // 1 to remove the item after calling
};
class menu_comms_1
{
text = "Menu Comms 1";
submenu = "#USER:MENU_COMMS_1"; // will open submenu that is defined as global variable MENU_COMMS_1
expression = "";
icon = "";
cursor = "";
enable = "1";
removeAfterExpressionCall = 0;
};
};
Available default icons:
- "
\a3 \Ui_f \data \GUI \Cfg \CommunicationMenu \artillery_ca.paa" - "
\a3 \Ui_f \data \GUI \Cfg \CommunicationMenu \attack_ca.paa" - "
\a3 \Ui_f \data \GUI \Cfg \CommunicationMenu \call_ca.paa" - "
\a3 \Ui_f \data \GUI \Cfg \CommunicationMenu \cas_ca.paa" - "
\a3 \Ui_f \data \GUI \Cfg \CommunicationMenu \casheli_ca.paa" - "
\a3 \Ui_f \data \GUI \Cfg \CommunicationMenu \defend_ca.paa" - "
\a3 \Ui_f \data \GUI \Cfg \CommunicationMenu \instructor_ca.paa" - "
\a3 \Ui_f \data \GUI \Cfg \CommunicationMenu \mortar_ca.paa" - "
\a3 \Ui_f \data \GUI \Cfg \CommunicationMenu \supplydrop_ca.paa" - "
\a3 \Ui_f \data \GUI \Cfg \CommunicationMenu \transport_ca.paa"
You can also preview pre-defined items using the Splendid™ Config Viewer.
Simple expressions
| Expression | Effect | Tested |
|---|---|---|
| 1 | Always available | |
| 0 | Always disabled | |
| cursorOnGround | Only callable when pointing at a valid position | |
| IsLeader | Player has to be the leader of his group | |
| IsAlone | ||
| IsAloneInVehicle | ||
| IsCommander | ||
| VehicleCommander | ||
| CommandsToGunner | ||
| CommandsToPilot | ||
| NotEmpty | ||
| NotEmptySoldiers | ||
| NotEmptyCommanders | ||
| NotEmptyMainTeam | ||
| NotEmptyRedTeam | ||
| NotEmptyGreenTeam | ||
| NotEmptyBlueTeam | ||
| NotEmptyYellowTeam | ||
| NotEmptySubgroups | ||
| NotEmptyInVehicle | ||
| SelectedTeam | ||
| SelectedUnit | ||
| FuelLow | ||
| AmmoLow | ||
| Injured | ||
| Multiplayer | ||
| AreActions | ||
| CursorOnGroupMember | ||
| CursorOnHoldingFire | ||
| CursorOnEmptyVehicle | ||
| CursorOnVehicleCanGetIn | ||
| CursorOnFriendly | ||
| CursorOnEnemy | ||
| CursorOnGround | ||
| CanSelectUnitFromBar | ||
| CanDeselectUnitFromBar | ||
| CanSelectVehicleFromBar | ||
| CanDeselectVehicleFromBar | ||
| CanSelectTeamFromBar | ||
| CanDeselectTeamFromBar | ||
| FormationLine | ||
| FormationDiamond | ||
| SomeSelectedHoldingFire | ||
| PlayableLeader | ||
| PlayableSelected | ||
| IsWatchCommanded | ||
| IsSelectedToAdd | ||
| HCIsLeader | ||
| HCCursorOnIcon | ||
| HCCursorOnIconSelectable | ||
| HCCanSelectUnitFromBar | ||
| HCCanDeselectUnitFromBar | ||
| HCCanSelectTeamFromBar | ||
| HCCanDeselectTeamFromBar | ||
| HCNotEmpty | ||
| PlayerVehicleCanGetIn | ||
| IsXbox | ||
| IsTeamSwitch | ||
| CursorOnNotEmptySubgroups | ||
| SomeSelectedHaveTarget | ||
| CursorOnGroupMemberSelected | ||
| HCCursorOnIconSelectableSelected | ||
| HCCursorOnIconenemy | ||
| PlayerOwnRadio | ||
| CursorOnNeedFirstAID | ||
| CursorOnNeedHeal |
Add Menu Item
Use the following functions to add the item in your mission or system:
Number of slots is limited to 10, no pagination is implemented. Larger number is an edge case, no mission should need as many supports.
Config
submenu = "#USER:MENU_COMMS_1"; // "MENU_COMMS_1" is just a global variable, can be named anything
SQF
A submenu is an array in format [menuInfo, item1, item2, ... itemX]:
- menuInfo: Array format [menuName, hasInputFocus]:
- itemX: Array format [itemName, assignedKey, submenuName, command, expression, isVisible, isActive, iconPath]:
- itemName: String - displayed title
- assignedKey: Array of Numbers (see DIK KeyCodes) - e.g 0 = no key, 1 = Esc, etc
- submenuName: String - user menu name string (e.g "#USER:MY_SUBMENU_NAME"), "" for script to execute.
- command: Number - for main menu, -1 = CMD_SEPARATOR, -2 = CMD_NOTHING, -3 = CMD_HIDE_MENU, -4 = CMD_BACK, -5 (custom menu only) = CMD_EXECUTE
- expression: Array of Strings format [type, codeString]:
- isVisible: String - visibility condition; "1" for true, "0" for false, or optional argument string e.g "CursorOnGround"
- isActive: String - enabled condition; "1" for true, "0" for false, or optional argument string e.g "CursorOnGround"
- iconPath: String - (Optional, default "") cursor icon path for this menu item
- Example
Some of the existing submenus:
| Menu | Menu Location |
|---|---|
| "#User:BIS_fnc_addCommMenuItem_menu" | Group/Reply communication menu /High Command Group reply menu |
| "#User:BIS_MENU_GroupCommunication" | High Command/UAV Reply communication menu |
| "#USER:BIS_VR_commMenu_1" | VR Training Mission menu |
| "#USER:HCWPWaitRadio" | High Command/UAV Waypoints waitRadio menu |
| "#USER:HCWPWaitUntil" | High Command/UAV Waypoints waitUnitl menu |
| "#USER:HC_Custom_0" | High Command/UAV Action menu |
| "#USER:HC_Missions_0" | High Command/UAV Missions menu |
| "#USER:HC_Targets_0" | High Command/UAV Targets menu |
| "#USER:BIS_fnc_kbMenu_menu" | Conversation menu |
| "#USER:BIS_MENU_SOM_SecOps" | Communication menu |
| "#USER:BIS_MENU_SOM_Support" | Communication Support menu |