BIS_fnc_holdActionAdd
Jump to navigation
Jump to search
Description
- Description:
-
Adds an action to an object which requires the user to hold a key to perform the action.
Available official icons as of 2.10:
- Execution:
- call
- Groups:
- Interaction
Syntax
- Syntax:
- [target, title, idleIcon, progressIcon, conditionShow, conditionProgress, codeStart, codeProgress, codeCompleted, codeInterrupted, arguments, duration, priority, removeCompleted, showUnconscious, showWindow] call BIS_fnc_holdActionAdd
- Parameters:
- target: Object - object the action is attached to
- title: String - title of the action shown in the action menu.It can contain Structured Text tags, such as
<t color='#FFAA00'>text</t>
- idleIcon: String - (Optional, default "\A3\Ui_f\data\IGUI\Cfg\HoldActions\holdAction_revive_ca.paa") path of the idle icon shown on screen
- progressIcon: String - (Optional, default "\A3\Ui_f\data\IGUI\Cfg\HoldActions\holdAction_revive_ca.paa") path of the progress icon shown on screen
- conditionShow: String - (Optional, default "true") condition for the action to be shown.
Special arguments passed to the code: _target (action-attached object), _this (caller/executing unit) - conditionProgress: String - (Optional, default "true") condition for the action to progress; if false is returned action progress is paused.
Special arguments passed to the code: _target, _caller, _actionId, _arguments - codeStart: Code - (Optional, default {}) code executed when action starts.
Special arguments passed to the code: _target, _caller, _actionId, _arguments
Passed arguments are: - codeProgress: Code - (Optional, default {}) code executed on every progress tick.
Special arguments passed to the code: _target, _caller, _actionId, _arguments, _frame
Passed arguments are:- target: Object - the object which the action is assigned to
- caller: Object - the unit that activated the action
- actionId: Number - ID of the activated action (same as ID returned by addAction)
- arguments: Array - arguments given to the function
- frame: Number - current progress, goes from 1 to 24
- maxFrame: Number - maximum progress (24)
- codeCompleted: Code - (Optional, default {}) code executed on completion.
Special arguments passed to the code: _target, _caller, _actionId, _arguments
Passed arguments are: - codeInterrupted: Code - (Optional, default {}) code executed on interrupted.
Special arguments passed to the code: _target, _caller, _actionId, _arguments
Passed arguments are: - arguments: Array - (Optional, default []) arguments passed to codeStart, codeProgress, codeCompleted and codeInterrupted (max 10) in format:
params [ "_a0", "_a1", "_a2", "_a3", "_a4", "_a5", "_a6", "_a7", "_a8", "_a9", // custom arguments "_target", "_title", "_iconIdle", "_iconProgress", "_condShow", "_condProgress", "_codeStart", "_codeProgress", "_codeCompleted", "_codeInterrupted", "_duration", "_removeCompleted" ];
- duration: Number - (Optional, default 10) action duration, i.e. how much time it takes to complete the action
- priority: Number - (Optional, default 1000) priority value; actions are arranged in descending order according to this value
- removeCompleted: Boolean - (Optional, default true) remove on completion
- showUnconscious: Boolean - (Optional, default false) show in unconscious state
- showWindow: Boolean - (Optional, default true) show on screen; if false action needs to be selected from action menu to appear on screen
- Return Value:
- Number - action ID
Examples
- Example 1:
- Example 2:
- // adds the action to every client and JIP, but also adds it when it was already removed. E.g., Laptop has already been hacked by a player [ _myLaptop, // Object the action is attached to "Hack Laptop", // Title of the action "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Idle icon shown on screen "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Progress icon shown on screen "_this distance _target < 3", // Condition for the action to be shown "_caller distance _target < 3", // Condition for the action to progress {}, // Code executed when action starts {}, // Code executed on every progress tick { _this call MY_fnc_hackingCompleted }, // Code executed on completion {}, // Code executed on interrupted [], // Arguments passed to the scripts as _this select 3 12, // Action duration in seconds 0, // Priority true, // Remove on completion false // Show in unconscious state ] remoteExec ["BIS_fnc_holdActionAdd", 0, _myLaptop]; // MP-compatible implementation
Additional Information
- See also:
- BIS_fnc_holdActionRemove BIS_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
- Posted on Apr 01, 2021 - 23:44 (UTC)
- A repository with icons: