VN_fnc_holdActionAdd

From Savage Game Design Wiki
Revision as of 23:29, 5 January 2021 by Lou Montana (talk | contribs) (Page filling)
Jump to navigation Jump to search
← back to Functions Introduced in S.O.G. Prairie Fire v1.00
by Jiri Wainar, edited by Ethan Johnson
Argument(s): global
Effect(s): local

Description

Add a hold action. If the hold actions are not initialized yet, initialize the system first. See BIS_fnc_holdActionAdd.

Syntax

Syntax
[target, title, iconIdle, iconProgress, condShow, condProgress, codeStart, codeProgress, codeCompleted, codeInterrupted, arguments, duration, priority, removeCompleted, showUnconscious, showWindow] call VN_fnc_holdActionAdd
Parameters
target: Object - (Optional, default objNull) object action is attached to
title: String - (Optional, default "MISSING TITLE") action title text shown in action menu
iconIdle: String or Code - (Optional, default "\A3\Ui_f\data\IGUI\Cfg\HoldActions\holdAction_revive_ca.paa") idle icon shown on screen; if Code is used, it needs to return the path to icon
iconProgress: String or Code - (Optional, default "\A3\Ui_f\data\IGUI\Cfg\HoldActions\holdAction_revive_ca.paa") progress icon shown on screen; if Code is used, it needs to return the path to icon
condShow: String - (Optional, default "true") condition for the action to be shown; special variables passed to the script code are _target (unit to which action is attached to) and _this (caller/executing unit)
condProgress: String - (Optional, default "true") condition for the action to progress; if false is returned action progress is halted; arguments passed into it are: _target, _caller, _id and _arguments
codeStart: Code - (Optional, default {}) code executed on start; arguments passed via the _this variable are [target, caller, ID, arguments]:
  • target: Object - (_this select 0) the object which the action is assigned to
  • caller: Object - (_this select 1) the unit that activated the action
  • id: Number - (_this select 2) id of the activated action (same as ID returned by addAction)
  • arguments: Array - (_this select 3) - arguments given to the script if the extended syntax is used
codeProgress: Code - (Optional, default {}) code executed on every progress tick; arguments [target, caller, ID, arguments, currentProgress]; max progress is always 24
codeCompleted: Code - (Optional, default {}) code executed on completion; arguments [target, caller, ID, arguments]
codeInterrupted: Code - (Optional, default {}) code executed on interrupted; arguments [target, caller, ID, arguments]
Return value
Number - action id that can be used for removal or referencing from other functions

Examples

Example 1
[ player, "Don't hold this action!", nil, nil, nil, nil, "hint 'please don't...", nil, { hint 'I -told- you!'; player setDamage 1 }, { hint "phew, you didn't."; (_this select 0) removeAction (_this select 2) }, nil, 6 ] call VN_fnc_holdActionAdd