Difference between revisions of "Arma 3: Communication Menu"

From Bohemia Interactive Community
Jump to navigation Jump to search
m
Line 47: Line 47:
 
*'''is3D''': [[Boolean]] - [[true]] when in 3D scene, [[false]] when in map
 
*'''is3D''': [[Boolean]] - [[true]] when in 3D scene, [[false]] when in map
 
*'''ID''': [[String]] - item ID as returned by BIS_fnc_addCommMenuItem function
 
*'''ID''': [[String]] - item ID as returned by BIS_fnc_addCommMenuItem function
 +
 +
=== Submenu ===
 +
submenu = "#USER:MENU_COMMS_1"; {{codecomment|// 'MENU_COMMS_1' is just a global variable, can name it anything}}
 +
 +
<pre>
 +
MENU_COMMS_1 =
 +
[
 +
    // Name, context sensitive
 +
    ["MenuName",false],
 +
    // [Item name, shortcut, submenu, -5 (do not change), expression (_target=CursorTarget,_pos=CursorPos), show, enable]
 +
    ["Teleport", [2], "", -5, [["expression", "Player SetPos _pos;"]], "1", "1"],
 +
    ["Kill Target", [3], "", -5, [["expression", "_target SetDamage 1;"]], "1", "1"],
 +
    ["Disabled", [4], "", -5, [["expression", ""]], "1", "0"],
 +
    ["Submenu", [5], "#USER:MENU_COMMS_2", -5, [], "1", "1"]
 +
];
 +
 +
MENU_COMMS_2 =
 +
[
 +
    // Name, context sensitive
 +
    ["Submenu",false],
 +
    // [Item name, shortcut, submenu, -5(do not change), expression (_target=CursorTarget,_pos=CursorPos), show, enable]
 +
    ["Option 1", [2], "", -5, [["expression", "Hint 'Option 1';"]], "1", "1"],
 +
    ["Option 2", [3], "", -5, [["expression", "Hint 'Option 2';"]], "1", "1"],
 +
    ["Option 3", [4], "", -5, [["expression", "Hint 'Option 3';"]], "1", "1"],
 +
];
 +
</pre>

Revision as of 07:13, 9 November 2014


Communication menu and icons

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 ('~' by default) and select "Communication" item
  • Press 8-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).

Preview and path for icons
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
    };
};

You can also preview pre-defined items using the config viewer.

Adding

Use 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.

Expression Arguments

Following arguments are passed into the expression field:

[caller,pos,target,is3D,ID]

Submenu

submenu = "#USER:MENU_COMMS_1"; // 'MENU_COMMS_1' is just a global variable, can name it anything

MENU_COMMS_1 =
[
    // Name, context sensitive
    ["MenuName",false],
    // [Item name, shortcut, submenu, -5 (do not change), expression (_target=CursorTarget,_pos=CursorPos), show, enable]
    ["Teleport", [2], "", -5, [["expression", "Player SetPos _pos;"]], "1", "1"],
    ["Kill Target", [3], "", -5, [["expression", "_target SetDamage 1;"]], "1", "1"],
    ["Disabled", [4], "", -5, [["expression", ""]], "1", "0"],
    ["Submenu", [5], "#USER:MENU_COMMS_2", -5, [], "1", "1"]
];

MENU_COMMS_2 =
[
    // Name, context sensitive
    ["Submenu",false],
    // [Item name, shortcut, submenu, -5(do not change), expression (_target=CursorTarget,_pos=CursorPos), show, enable]
    ["Option 1", [2], "", -5, [["expression", "Hint 'Option 1';"]], "1", "1"],
    ["Option 2", [3], "", -5, [["expression", "Hint 'Option 2';"]], "1", "1"],
    ["Option 3", [4], "", -5, [["expression", "Hint 'Option 3';"]], "1", "1"],
];