Revision as of 11:02, 18 January 2021 by Lou Montana(talk | contribs)(Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects? in MP|Multiplayer Effects(...)
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 - Path of the idle icon shown on screen
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
[
_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 [s]
0, // Prioritytrue, // Remove on completionfalse// Show in unconscious state
] remoteExec ["BIS_fnc_holdActionAdd", 0, _myLaptop]; // MP compatible implementation
Keep in mind that 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.
All the incoming parameters are also mutually shared with codeStart, codeProgress, codeCompleted and codeInterrupted as they all running in the same scope. The full list of params shared:
_arguments params [
"_a0",
"_a1",
"_a2",
"_a3",
"_a4",
"_a5",
"_a6",
"_a7",
"_a8",
"_a9",
"_target",
"_title",
"_iconIdle",
"_iconProgress",
"_condShow",
"_condProgress",
"_codeStart",
"_codeProgress",
"_codeCompleted",
"_codeInterrupted",
"_duration",
"_removeCompleted"
];
Where _a0-_a9 are actual range of params coming from arguments inputted in BIS_fnc_holdActionAdd function call.