VN fnc holdActionAdd

From Savage Game Design Wiki
Jump to navigation Jump to search


|v= 1.00

|author= Jiri Wainar, edited by Ethan Johnson

|a= global

|e= local

|g1= vn_hold_functions

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

|s= [target, title, iconIdle, iconProgress, condShow, condProgress, codeStart, codeProgress, codeCompleted, codeInterrupted, arguments, duration, priority, removeCompleted, showUnconscious, showWindow] call VN_fnc_holdActionAdd

|p1n= target |p1t= object |p1d= object action is attached to |p1v= objNull

|p2n= title |p2t= string |p2d= action title text shown in action menu |p2v= "MISSING TITLE"

|p3n= iconIdle |p3t= String or Code |p3d= idle icon shown on screen; if Code is used, it needs to return the path to icon |p3v= "\A3\Ui_f\data\IGUI\Cfg\HoldActions\holdAction_revive_ca.paa"

|p4n= iconProgress |p4t= String or Code |p4d= progress icon shown on screen; if Code is used, it needs to return the path to icon |p4v= "\A3\Ui_f\data\IGUI\Cfg\HoldActions\holdAction_revive_ca.paa"

|p5n= condShow |p5t= string |p5d= 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) |p5v= "true"

|p6n= condProgress |p6t= string |p6d= condition for the action to progress; if false is returned action progress is halted; arguments passed into it are: _target, _caller, _id and _arguments |p6v= "true"

|p7n= codeStart |p7t= code |p7d= 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

|p7v= {}

|p8n= codeProgress |p8t= code |p8d= code executed on every progress tick; arguments [target, caller, ID, arguments, currentProgress]; max progress is always 24 |p8v= {}

|p9n= codeCompleted |p9t= code |p9d= code executed on completion; arguments [target, caller, ID, arguments] |p9v= {}

|p10n= codeInterrupted |p10t= code |p10d= code executed on interrupted; arguments [target, caller, ID, arguments] |p10v= {}

|p11n= arguments |p11t= array |p11d= arguments passed to the scripts |p11v= []

|p12n= duration |p12t= number |p12d= action duration; how much time it takes to complete the action |p12v= 10

|p13n= priority |p13t= number |p13d= actions are arranged in descending order according to this value |p13v= 1000

|p14n= removeCompleted |p14t= boolean |p14d= remove on completion |p14v= true

|p15n= showUnconscious |p15t= boolean |p15d= show in unconscious state |p15v= false

|p16n= showWindow |p16t= boolean |p16d= show on screen; if false action needs to be selected from action menu to appear on screen |p16v= true

|r1t= number |r1d= action id that can be used for removal or referencing from other functions

|x1= [ 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 }}