showCommandingMenu: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Comments" to "|Comments=")
m (Some wiki formatting)
 
(44 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma2 |= Game name
|game1= arma2
|version1= 1.00


|1.00|= Game version
|game2= arma2oa
____________________________________________________________________________________________
|version2= 1.50


| Create the commanding menu described by the given config class or menu name. When the name is empty, the current menu is hidden.<br><br>
|game3= tkoh
If commanding menu has "expression" set up, the expression will receive the following arguments when user activated the menu item:
|version3= 1.00
* Local variable  <tt>_target</tt>: [[Object]] - Target under the cursor. This works in both 3D and 2D (when cursor is over the unit icon on the map).
* Local variable <tt>_pos</tt>: [[Array]] - Cursor position.
* Local variable <tt>_is3D</tt>: [[Boolean]] - [[false]] if cursor is over the map, otherwise [[true]].  |DESCRIPTION=
____________________________________________________________________________________________


| '''showCommandingMenu''' name |SYNTAX=
|game4= arma3
|version4= 0.50


|p1= name: [[String]] - Class name or user menu name (with "#USER:" prefix and "_#" page number suffix, where # is the page number starting with 0). |PARAMETER1=  
|gr1= Interaction


| [[Nothing]] |RETURNVALUE=
|descr= Create the commanding menu described by the given config class or menu name. When the name is empty, the current menu is hidden.<br><br>
If commanding menu has "expression" set up, the expression will receive the following arguments when user activated the menu item:
* Local variable {{hl|_target}}: [[Object]] - Target under the cursor. This works in both 3D and 2D (when cursor is over the unit icon on the map).
* Local variable {{hl|_pos}}: [[Array]] - Cursor position.
* Local variable {{hl|_is3D}}: [[Boolean]] - [[false]] if cursor is over the map, otherwise [[true]].


|x1= <code>[[showCommandingMenu]] "";</code>|EXAMPLE1=
|s1= [[showCommandingMenu]] name
|x2= <code>[[showCommandingMenu]] "MyClassName";</code>|EXAMPLE2=
|x3= <code>[[showCommandingMenu]] "#USER:Tag_Menu_myMenu_0";</code>|EXAMPLE3=
|x4= <code>[[showCommandingMenu]] "RscMainMenu";</code>|EXAMPLE4=


____________________________________________________________________________________________
|p1= name: [[String]] - class name or user menu name (with "#USER:" prefix and "_#" page number suffix, where # is the page number starting with 0).


| [[commandingMenu]], [[Arma_3_Communication_Menu]], [[BIS_fnc_createmenu]] |SEEALSO=
|r1= [[Nothing]]


| |MPBEHAVIOUR=  
|x1= <sqf>showCommandingMenu "";</sqf>
____________________________________________________________________________________________
|x2= <sqf>showCommandingMenu "MyClassName";</sqf>
|x3= <sqf>showCommandingMenu "#USER:Tag_Menu_myMenu_0";</sqf>
|x4= <sqf>showCommandingMenu "RscMainMenu";</sqf>
 
|seealso= [[commandingMenu]] [[Arma 3: Communication Menu]] [[BIS_fnc_createMenu]]
}}
}}


<h3 style='display:none'>Notes</h3>
<dl class='command_description'>


<!-- Note Section BEGIN -->
{{Note
 
|user= LaKing
<dd class="notedate">Posted on July 22nd, 2012 - 15:37 (GMT+1)
|timestamp= 20100125172000
<dt class="note">'''[[User:LaKing|LaKing]]'''
|text= <sqf>
<dd class="note">
// This script will create a custom menu, and display it once.
<pre>
//This script will create a custom menu, and display it once.


MY_SUBMENU_inCommunication =
MY_SUBMENU_inCommunication =
[
[
["User submenu",true],
["User submenu", true],
["Option-1", [2], "", -5, [["expression", "player sidechat ""-1"" "]], "0", "0", "\ca\ui\data\cursor_support_ca"],
["Option-1", [2], "", -5, [["expression", "player sidechat ""-1"" "]], "0", "0", "\ca\ui\data\cursor_support_ca"],
["Option 0", [3], "", -5, [["expression", "player sidechat "" 0"" "]], "1", "0", "\ca\ui\data\cursor_support_ca"],
["Option 0", [3], "", -5, [["expression", "player sidechat "" 0"" "]], "1", "0", "\ca\ui\data\cursor_support_ca"],
Line 52: Line 50:
];
];


MY_MENU_inCommunication =  
MY_MENU_inCommunication =
[
[
// First array: "User menu" This will be displayed under the menu, bool value: has Input Focus or not.
// First array: "User menu" This will be displayed under the menu, bool value: has Input Focus or not.
// Note that as to version Arma2 1.05, if the bool value set to false, Custom Icons will not be displayed.
// Note that as to version Template:arma2 1.05, if the bool value set to false, Custom Icons will not be displayed.
["User menu",false],
["User menu", false],
 
// Syntax and semantics for following array elements:
// Syntax and semantics for following array elements:
// ["Title_in_menu", [assigned_key], "Submenu_name", CMD, [["expression",script-string]], "isVisible", "isActive" <, optional icon path> ]
// ["Title_in_menu", [assigned_key], "Submenu_name", CMD, [<nowiki/>["expression",script-string]], "isVisible", "isActive" <, optional icon path>]
// Title_in_menu: string that will be displayed for the player
// Title_in_menu: string that will be displayed for the player
// Assigned_key: 0 - no key, 1 - escape key, 2 - key-1, 3 - key-2, ... , 10 - key-9, 11 - key-0, 12 and up... the whole keyboard
// Assigned_key: 0 - no key, 1 - escape key, 2 - key-1, 3 - key-2, ... , 10 - key-9, 11 - key-0, 12 and up... the whole keyboard
Line 73: Line 72:


showCommandingMenu "#USER:MY_MENU_inCommunication";
showCommandingMenu "#USER:MY_MENU_inCommunication";
</sqf>


// Appendix, list of optional argument strings
Appendix, list of optional argument strings:
HasRadio
{{Columns|4|
CanAnswer
* {{hl|AmmoLow}}
IsLeader
* {{hl|AreActions}}
IsAlone
* {{hl|CanAnswer}}
IsAloneInVehicle
* {{hl|CanDeselectTeamFromBar}}
IsCommander
* {{hl|CanDeselectUnitFromBar}}
VehicleCommander
* {{hl|CanDeselectVehicleFromBar}}
CommandsToGunner
* {{hl|CanSelectTeamFromBar}}
CommandsToPilot
* {{hl|CanSelectUnitFromBar}}
NotEmpty
* {{hl|CanSelectVehicleFromBar}}
NotEmptySoldiers
* {{hl|CommandsToGunner}}
NotEmptyCommanders
* {{hl|CommandsToPilot}}
NotEmptyMainTeam
* {{hl|CursorOnEmptyVehicle}}
NotEmptyRedTeam
* {{hl|CursorOnEnemy}}
NotEmptyGreenTeam
* {{hl|CursorOnFriendly}}
NotEmptyBlueTeam
* {{hl|CursorOnGround}}
NotEmptyYellowTeam
* {{hl|CursorOnGroupMember}}
NotEmptySubgroups
* {{hl|CursorOnGroupMemberSelected}}
NotEmptyInVehicle
* {{hl|CursorOnHoldingFire}}
SelectedTeam
* {{hl|CursorOnNeedFirstAID}}
SelectedUnit
* {{hl|CursorOnNeedHeal}}
FuelLow
* {{hl|CursorOnNotEmptySubgroups}}
AmmoLow
* {{hl|CursorOnVehicleCanGetIn}}
Injured
* {{hl|FormationDiamond}}
Multiplayer
* {{hl|FormationLine}}
AreActions
* {{hl|FuelLow}}
CursorOnGroupMember
* {{hl|HasRadio}}
CursorOnHoldingFire
* {{hl|HCCanDeselectTeamFromBar}}
CursorOnEmptyVehicle
* {{hl|HCCanDeselectUnitFromBar}}
CursorOnVehicleCanGetIn
* {{hl|HCCanSelectTeamFromBar}}
CursorOnFriendly
* {{hl|HCCanSelectUnitFromBar}}
CursorOnEnemy
* {{hl|HCCursorOnIcon}}
CursorOnGround
* {{hl|HCCursorOnIconenemy}}
CanSelectUnitFromBar
* {{hl|HCCursorOnIconSelectable}}
CanDeselectUnitFromBar
* {{hl|HCCursorOnIconSelectableSelected}}
CanSelectVehicleFromBar
* {{hl|HCIsLeader}}
CanDeselectVehicleFromBar
* {{hl|HCNotEmpty}}
CanSelectTeamFromBar
* {{hl|Injured}}
CanDeselectTeamFromBar
* {{hl|IsAlone}}
FormationLine
* {{hl|IsAloneInVehicle}}
FormationDiamond
* {{hl|IsCommander}}
SomeSelectedHoldingFire
* {{hl|IsLeader}}
PlayableLeader
* {{hl|IsSelectedToAdd}}
PlayableSelected
* {{hl|IsTeamSwitch}}
IsWatchCommanded
* {{hl|IsWatchCommanded}}
IsSelectedToAdd
* {{hl|IsXbox}}
HCIsLeader
* {{hl|Multiplayer}}
HCCursorOnIcon
* {{hl|NotEmpty}}
HCCursorOnIconSelectable
* {{hl|NotEmptyBlueTeam}}
HCCanSelectUnitFromBar
* {{hl|NotEmptyCommanders}}
HCCanDeselectUnitFromBar
* {{hl|NotEmptyGreenTeam}}
HCCanSelectTeamFromBar
* {{hl|NotEmptyInVehicle}}
HCCanDeselectTeamFromBar
* {{hl|NotEmptyMainTeam}}
HCNotEmpty
* {{hl|NotEmptyRedTeam}}
PlayerVehicleCanGetIn
* {{hl|NotEmptySoldiers}}
IsXbox
* {{hl|NotEmptySubgroups}}
IsTeamSwitch
* {{hl|NotEmptyYellowTeam}}
CursorOnNotEmptySubgroups
* {{hl|PlayableLeader}}
SomeSelectedHaveTarget
* {{hl|PlayableSelected}}
CursorOnGroupMemberSelected
* {{hl|PlayerOwnRadio}}
HCCursorOnIconSelectableSelected
* {{hl|PlayerVehicleCanGetIn}}
HCCursorOnIconenemy
* {{hl|SelectedTeam}}
PlayerOwnRadio
* {{hl|SelectedUnit}}
CursorOnNeedFirstAID
* {{hl|SomeSelectedHaveTarget}}
CursorOnNeedHeal
* {{hl|SomeSelectedHoldingFire}}
* {{hl|VehicleCommander}}
}}
}}


</pre>
{{Note
<!-- Note Section END -->
|user= SilentSpike
</dl>
|timestamp= 20160723154000
|text= You can combine the argument strings (see the above note) together to create OR conditions.


<h3 style='display:none'>Bottom Section</h3>
Hence {{hl|"HasRadioIsLeader"}} is true when the unit is a leader or has a radio.
[[Category:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
}}
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on July 23, 2016 - 14:40 (UTC)</dd>
<dt class="note">[[User:SilentSpike|SilentSpike]]</dt>
<dd class="note">
You can combine the argument strings (see the above note) together to create OR conditions.
 
Hence <code>"HasRadioIsLeader"</code> is true when the unit is a leader or has a radio.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 19:31, 7 April 2024

Hover & click on the images for description

Description

Description:
Create the commanding menu described by the given config class or menu name. When the name is empty, the current menu is hidden.

If commanding menu has "expression" set up, the expression will receive the following arguments when user activated the menu item:
  • Local variable _target: Object - Target under the cursor. This works in both 3D and 2D (when cursor is over the unit icon on the map).
  • Local variable _pos: Array - Cursor position.
  • Local variable _is3D: Boolean - false if cursor is over the map, otherwise true.
Groups:
Interaction

Syntax

Syntax:
showCommandingMenu name
Parameters:
name: String - class name or user menu name (with "#USER:" prefix and "_#" page number suffix, where # is the page number starting with 0).
Return Value:
Nothing

Examples

Example 1:
showCommandingMenu "";
Example 2:
showCommandingMenu "MyClassName";
Example 3:
showCommandingMenu "#USER:Tag_Menu_myMenu_0";
Example 4:
showCommandingMenu "RscMainMenu";

Additional Information

See also:
commandingMenu Arma 3: Communication Menu BIS_fnc_createMenu

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


LaKing - c
Posted on Jan 25, 2010 - 17:20 (UTC)
// This script will create a custom menu, and display it once. MY_SUBMENU_inCommunication = [ ["User submenu", true], ["Option-1", [2], "", -5, [["expression", "player sidechat ""-1"" "]], "0", "0", "\ca\ui\data\cursor_support_ca"], ["Option 0", [3], "", -5, [["expression", "player sidechat "" 0"" "]], "1", "0", "\ca\ui\data\cursor_support_ca"], ["Option 1", [4], "", -5, [["expression", "player sidechat "" 1"" "]], "1", "CursorOnGround", "\ca\ui\data\cursor_support_ca"] ]; MY_MENU_inCommunication = [ // First array: "User menu" This will be displayed under the menu, bool value: has Input Focus or not. // Note that as to version Template:arma2 1.05, if the bool value set to false, Custom Icons will not be displayed. ["User menu", false], // Syntax and semantics for following array elements: // ["Title_in_menu", [assigned_key], "Submenu_name", CMD, [["expression",script-string]], "isVisible", "isActive" <, optional icon path>] // Title_in_menu: string that will be displayed for the player // Assigned_key: 0 - no key, 1 - escape key, 2 - key-1, 3 - key-2, ... , 10 - key-9, 11 - key-0, 12 and up... the whole keyboard // Submenu_name: User menu name string (eg "#USER:MY_SUBMENU_NAME" ), "" for script to execute. // CMD: (for main menu:) CMD_SEPARATOR -1; CMD_NOTHING -2; CMD_HIDE_MENU -3; CMD_BACK -4; (for custom menu:) CMD_EXECUTE -5 // script-string: command to be executed on activation. (no arguments passed) // isVisible - Boolean 1 or 0 for yes or no, - or optional argument string, eg: "CursorOnGround" // isActive - Boolean 1 or 0 for yes or no - if item is not active, it appears gray. // optional icon path: The path to the texture of the cursor, that should be used on this menuitem. ["First", [0], "", -5, [["expression", "player sidechat ""First"" "]], "1", "1"], ["Second", [2], "", -5, [["expression", "player sidechat ""Second"" "]], "1", "1"], ["Submenu", [3], "#USER:MY_SUBMENU_inCommunication", -5, [["expression", "player sidechat ""Submenu"" "]], "1", "1"] ]; showCommandingMenu "#USER:MY_MENU_inCommunication";
Appendix, list of optional argument strings:
  • AmmoLow
  • AreActions
  • CanAnswer
  • CanDeselectTeamFromBar
  • CanDeselectUnitFromBar
  • CanDeselectVehicleFromBar
  • CanSelectTeamFromBar
  • CanSelectUnitFromBar
  • CanSelectVehicleFromBar
  • CommandsToGunner
  • CommandsToPilot
  • CursorOnEmptyVehicle
  • CursorOnEnemy
  • CursorOnFriendly
  • CursorOnGround
  • CursorOnGroupMember
  • CursorOnGroupMemberSelected
  • CursorOnHoldingFire
  • CursorOnNeedFirstAID
  • CursorOnNeedHeal
  • CursorOnNotEmptySubgroups
  • CursorOnVehicleCanGetIn
  • FormationDiamond
  • FormationLine
  • FuelLow
  • HasRadio
  • HCCanDeselectTeamFromBar
  • HCCanDeselectUnitFromBar
  • HCCanSelectTeamFromBar
  • HCCanSelectUnitFromBar
  • HCCursorOnIcon
  • HCCursorOnIconenemy
  • HCCursorOnIconSelectable
  • HCCursorOnIconSelectableSelected
  • HCIsLeader
  • HCNotEmpty
  • Injured
  • IsAlone
  • IsAloneInVehicle
  • IsCommander
  • IsLeader
  • IsSelectedToAdd
  • IsTeamSwitch
  • IsWatchCommanded
  • IsXbox
  • Multiplayer
  • NotEmpty
  • NotEmptyBlueTeam
  • NotEmptyCommanders
  • NotEmptyGreenTeam
  • NotEmptyInVehicle
  • NotEmptyMainTeam
  • NotEmptyRedTeam
  • NotEmptySoldiers
  • NotEmptySubgroups
  • NotEmptyYellowTeam
  • PlayableLeader
  • PlayableSelected
  • PlayerOwnRadio
  • PlayerVehicleCanGetIn
  • SelectedTeam
  • SelectedUnit
  • SomeSelectedHaveTarget
  • SomeSelectedHoldingFire
  • VehicleCommander
SilentSpike - c
Posted on Jul 23, 2016 - 15:40 (UTC)
You can combine the argument strings (see the above note) together to create OR conditions. Hence "HasRadioIsLeader" is true when the unit is a leader or has a radio.