Difference between revisions of "VN fnc holdActionAdd"
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " |e=" to " |a= |e=") |
Lou Montana (talk | contribs) (Page filling) |
||
Line 1: | Line 1: | ||
− | |||
{{Function | {{Function | ||
|v= 1.00 | |v= 1.00 | ||
− | |author= Jiri Wainar | + | |author= Jiri Wainar, edited by Ethan Johnson |
− | |a= | + | |a= global |
− | |e= | + | |e= local |
|g1= vn_hold_functions | |g1= vn_hold_functions | ||
− | |d= < | + | |d= Add a hold action. If the hold actions are not initialized yet, initialize the system first. See {{Biki|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= {{Biki|objNull}} | ||
+ | |||
+ | |p2n= title | ||
+ | |p2t= string | ||
+ | |p2d= action title text shown in action menu | ||
+ | |p2v= "MISSING TITLE" | ||
+ | |||
+ | |p3n= iconIdle | ||
+ | |p3t= {{Biki|String}} or {{Biki|Code}} | ||
+ | |p3d= idle icon shown on screen; if {{Biki|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= {{Biki|String}} or {{Biki|Code}} | ||
+ | |p4d= progress icon shown on screen; if {{Biki|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 <tt>_target</tt> (unit to which action is attached to) and <tt>_this</tt> (caller/executing unit) | ||
+ | |p5v= "true" | ||
+ | |||
+ | |p6n= condProgress | ||
+ | |p6t= string | ||
+ | |p6d= condition for the action to progress; if {{Biki|false}} is returned action progress is halted; arguments passed into it are: <tt>_target</tt>, <tt>_caller</tt>, <tt>_id</tt> and <tt>_arguments</tt> | ||
+ | |p6v= "true" | ||
+ | |||
+ | |p7n= codeStart | ||
+ | |p7t= code | ||
+ | |p7d= code executed on start; arguments passed ''via'' the <tt>_this</tt> variable are <tt>[target, caller, ID, arguments]</tt>: | ||
+ | * target: {{Biki|Object}} - (_this select 0) the object which the action is assigned to | ||
+ | * caller: {{Biki|Object}} - (_this select 1) the unit that activated the action | ||
+ | * id: {{Biki|Number}} - (_this select 2) id of the activated action (same as ID returned by {{Biki|addAction}}) | ||
+ | * arguments: {{Biki|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 <tt>[target, caller, ID, arguments, currentProgress]</tt>; max progress is always 24 | ||
+ | |p8v= {} | ||
− | + | |p9n= codeCompleted | |
− | + | |p9t= code | |
+ | |p9d= code executed on completion; arguments <tt>[target, caller, ID, arguments]</tt> | ||
+ | |p9v= {} | ||
− | + | |p10n= codeInterrupted | |
− | + | |p10t= code | |
− | + | |p10d= code executed on interrupted; arguments <tt>[target, caller, ID, arguments]</tt> | |
− | + | |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= {{Biki|true}} | ||
− | | | + | |p15n= showUnconscious |
− | | | + | |p15t= boolean |
− | | | + | |p15d= show in unconscious state |
− | | | + | |p15v= {{Biki|false}} |
− | | | + | |p16n= showWindow |
− | | | + | |p16t= boolean |
− | | | + | |p16d= show on screen; if false action needs to be selected from action menu to appear on screen |
− | | | + | |p16v= {{Biki|true}} |
− | |r1t= | + | |r1t= number |
− | |r1d= | + | |r1d= action id that can be used for removal or referencing from other functions |
− | |x1= <code>-</code> | + | |x1= <code>[ |
+ | 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 | ||
+ | </code> | ||
}} | }} |
Revision as of 23:29, 5 January 2021
← back to Functions | Introduced in S.O.G. Prairie Fire v1.00 by Jiri Wainar, edited by Ethan Johnson |
|
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