From Bohemia Interactive Community
Hover & click on the images for description
Description
- Description:
- Adds an action to an object which requires the user to hold a key to perform the action.
- Execution:
- call
- Groups:
- Uncategorised
Syntax
- Syntax:
- [target, title, idleIcon, progressIcon, conditionShow, conditionProgress, codeStart, codeProgress, codeCompleted, codeInterrupted, arguments, duration, priority(, removeCompleted, showUnconscious)] call BIS_fnc_holdActionAdd
- Parameters:
- target: Object - Object the action is attached to
- title: String - Title of the action shown in the action menu
- idleIcon: String - Path of the idle icon shown on screen. See notes for a full list of vanilla icons.
- progressIcon: String - Path of the progress icon shown on screen
- conditionShow: String - Condition for the action to be shown.
Special arguments passed to the code: _target (action-attached object), _this (caller/executing unit)
- conditionProgress: String - Condition for the action to progress; if false is returned action progress is paused.
Special arguments passed to the code: _target, _caller, _id, _arguments
- codeStart: Code - Code executed when action starts. Special arguments:
- _this select 0: Object - the object which the action is assigned to
- _this select 1: Object - the unit that activated the action
- _this select 2: Number - ID of the activated action (same as ID returned by addAction)
- _this select 3: Array - arguments given to the function
- codeProgress: Code - Code executed on every progress tick. Special arguments:
- _this select 0: Object - the object which the action is assigned to
- _this select 1: Object - the unit that activated the action
- _this select 2: Number - ID of the activated action (same as ID returned by addAction)
- _this select 3: Array - arguments given to the function
- _this select 4: Number - currentProgress; progress goes from 1 to 24
- _this select 5: Number - max progress (24)
- codeCompleted: Code - Code executed on completion; arguments [target, caller, ID, arguments]
- codeInterrupted: Code - Code executed on interrupted; arguments [target, caller, ID, arguments]
- arguments: Array - Arguments passed to the scripts
- duration: Number - Action duration; how much time it takes to complete the action
- priority: Number - Priority; actions are arranged in descending order according to this value
- removeCompleted (Optional, default: true): Boolean - Remove on completion
- showUnconscious (Optional, default: false): Boolean - Show in unconscious state
- Return Value:
- Number - Action ID
Examples
- Example 1:
[player, "Kill", "", "", "true", "true", { hint "Started!" }, { systemChat str (_this select 3) }, { player setDamage 1 }, { hint "Afraid of death?" }, [], 10, nil, true, false] call BIS_fnc_holdActionAdd;
- Example 2:
[
_myLaptop,
"Hack Laptop",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 3",
"_caller distance _target < 3",
{},
{},
{ _this call MY_fnc_hackingCompleted },
{},
[],
12,
0,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", [0,2] select isDedicated, _myLaptop];
Additional Information
- See also:
- BIS_fnc_holdActionRemoveBIS_fnc_holdKey
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 November 4, 2017 - 13:40 (UTC)
- Lou Montana
-
A list of all official icons so far (v1.76):
- "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa"
- "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_forceRespawn_ca.paa"
- "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_hack_ca.paa"
- "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa"
- "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_reviveMedic_ca.paa"
- "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa"
- "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_takeOff1_ca.paa"
- "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_takeOff2_ca.paa"
- "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_unbind_ca.paa"