BIS fnc holdActionAdd: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
(Added page for BIS_fnc_holdActionAdd (Please review))
Line 1: Line 1:
{{Function|= Comments
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________
Line 5: Line 4:
| arma3 |= Game name
| arma3 |= Game name


|1.00|= Game version
|1.62|= Game version
____________________________________________________________________________________________
____________________________________________________________________________________________


| ''N/A'' |= Description
| Adds an action to an object which requires the user to hold a key to perform the action.|= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_holdActionAdd]]; --> |= Syntax
| [target,title,idleIcon,progressIcon,condShow,condProgress,codeStart,codeProgress,codeCompleted,codeInterupted,arguments,duration,priority,removeCompleted,showUncon] [[call]] [[BIS_fnc_holdActionAdd]]; |= Syntax
|p1= |= Parameter 1
 
|p1= target: [[Object]] - Object the action is attached to |= Parameter 1
 
|p2= title: [[String]] - Title of the action shown in the action menu |= Parameter 2
 
|p3= idleIcon: [[String]] - Idle icon shown on screen |= Parameter 3
 
|p4= progressIcon: [[String]] - Progress icon shown on screen |= Parameter 4
 
|p5= condShow: [[String]] - 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)|= Parameter 5


| |= Return value
|p6= condProgress: [[String]] - Condition for the action to progress.If false is returned action progress is halted; arguments passed into it are: _target, _caller, _id, _arguments |= Parameter 6
 
|p7= codeStart: [[Code]] - Code executed when action starts.<br>
                0: [[Object]] - target (_this select 0) - the object which the action is assigned to<br>
1: [[Object]] - caller (_this select 1) - the unit that activated the action<br>
3: [[Number]] - ID (_this select 2) - ID of the activated action (same as ID returned by addAction)<br>
4: [[Array]] - arguments (_this select 3) - arguments given to the script if you are using the extended syntax |= Parameter 7
 
|p8= codeProgress: [[Code]] - Code executed on every progress tick; arguments [target, caller, ID, arguments, currentProgress]; max progress is always 24 |= Parameter 8
 
|p9= codeCompleted: [[Code]] - Code executed on completion; arguments [target, caller, ID, arguments] |= Parameter 9
 
|p10= codeInterupted: [[Code]] - Code executed on interrupted; arguments [target, caller, ID, arguments] |= Parameter 10
 
|p11= arguments: [[Array]] - Arguments passed to the scripts |= Parameter 11
 
|p12= duration: [[Number]] - Action duration; how much time it takes to complete the action |= Parameter 12
 
|p13= priority: [[Number]] - Priority; actions are arranged in descending order according to this value |= Parameter 13
 
|p14= removeCompleted: [[BOOL]] - Remove on completion (default: true) |= Parameter 14
 
|p15= showUncon: [[BOOL]] -Show in unconscious state (default: false)|= Parameter 15
 
|x1= <code>[ [[player]],"Kill","","","[[true]]","[[true]]",{[[hint]] "Started!"},{[[systemChat]] [[str]] (_this select 4)},{[[player]] [[setDamage]] 1},{[[hint]] "Afraid of death?"},[],10,[[nil]],[[true]],[[false]]] [[call]] [[BIS_fnc_holdActionAdd]];</code>
|= Example 1
 
| [[Number]] - Action ID |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________
|x1= <code></code> |=
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
|[[BIS_fnc_holdActionRemove]] |= See also


}}
}}
Line 27: Line 60:
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>


<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: HoldActions|{{uc:holdActionAdd}}]]
[[Category:Function Group: Debug|{{uc:param}}]]
[[Category:Functions|{{uc:holdActionAdd}}]]
[[Category:Functions|{{uc:param}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:holdActionAdd}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:param}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:param}}]]

Revision as of 14:05, 16 July 2016

Hover & click on the images for description

Description

Description:
Adds an action to an object which requires the user to hold a key to perform the action.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[target,title,idleIcon,progressIcon,condShow,condProgress,codeStart,codeProgress,codeCompleted,codeInterupted,arguments,duration,priority,removeCompleted,showUncon] call BIS_fnc_holdActionAdd;
Parameters:
target: Object - Object the action is attached to
title: String - Title of the action shown in the action menu
idleIcon: String - Idle icon shown on screen
progressIcon: String - Progress icon shown on screen
condShow: String - 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 - Condition for the action to progress.If false is returned action progress is halted; arguments passed into it are: _target, _caller, _id, _arguments
codeStart: Code - Code executed when action starts.
0: Object - target (_this select 0) - the object which the action is assigned to
1: Object - caller (_this select 1) - the unit that activated the action
3: Number - ID (_this select 2) - ID of the activated action (same as ID returned by addAction)
4: Array - arguments (_this select 3) - arguments given to the script if you are using the extended syntax
codeProgress: Code - Code executed on every progress tick; arguments [target, caller, ID, arguments, currentProgress]; max progress is always 24
codeCompleted: Code - Code executed on completion; arguments [target, caller, ID, arguments]
codeInterupted: Code - Code executed on interrupted; arguments [target, caller, ID, arguments]
arguments: Array - Arguments passed to the scripts
duration: Number - Action duration; how much time it takes to complete the action
priority: Number - Priority; actions are arranged in descending order according to this value
removeCompleted: BOOL - Remove on completion (default: true)
showUncon: BOOL -Show in unconscious state (default: false)
Return Value:
Number - Action ID

Examples

Example 1:
[ player,"Kill","","","true","true",{hint "Started!"},{systemChat str (_this select 4)},{player setDamage 1},{hint "Afraid of death?"},[],10,nil,true,false] call BIS_fnc_holdActionAdd;

Additional Information

See also:
BIS_fnc_holdActionRemove

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

Notes

Bottom Section