BIS fnc counter: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Some wiki formatting)
 
(37 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= tkoh
____________________________________________________________________________________________
|version1= 1.00


| tkoh |= Game name
|game2= arma3
|version2= 0.50


|1.00|= Game version
|arg= global
____________________________________________________________________________________________
|eff= local


| <pre>/*
|gr1= Systems


Description:
|descr= Modify the given counter, create it if does not exist.
Modify the given counter (create it if doesn't exist)
{{Feature|important|It is '''not''' possible to broadcast the counter (like [[setVariable]] does) with this function.}}


Parameter(s):
|s1= [varName, add, modulo] call [[BIS_fnc_counter]]
_this select 0:
STRING - variable name of counter
ARRAY in format [variableName,nameSpace], where nameSpace can be object, group or missionNameSpace/uiNameSpace
_this select 1 (Optional): NUMBER - added value
_this select 2 (Optional): NUMBER - modulo value


Returns:
|p1= varName: [[String]] or [[Array]] format [varName, namespace] - default namespace is [[missionNamespace]]
NUMBER - counter's value
*/


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|p2= add: [[Number]] - (Optional, default 0) the value to be added
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_counter]]; --> |= Syntax
|p3= modulo: [[Number]] - (Optional, default -1) the [[mod]]ulo to use for counter cycle, applied after the addition


|p1= |= Parameter 1
|r1= [[Number]] the new counter value


| |= Return value
|x1= <sqf>[["TAG_Score", player], 1] call BIS_fnc_counter;</sqf>
____________________________________________________________________________________________
 
|x1= <code></code> |=
____________________________________________________________________________________________
 
| |= See also


|seealso= [[BIS_fnc_deleteCounter]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Misc|{{uc:counter}}]]
[[Category:Functions|{{uc:counter}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:counter}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:counter}}]]

Latest revision as of 16:43, 11 April 2024

Hover & click on the images for description

Description

Description:
Modify the given counter, create it if does not exist.
It is not possible to broadcast the counter (like setVariable does) with this function.
Execution:
call
Groups:
Systems

Syntax

Syntax:
[varName, add, modulo] call BIS_fnc_counter
Parameters:
varName: String or Array format [varName, namespace] - default namespace is missionNamespace
add: Number - (Optional, default 0) the value to be added
modulo: Number - (Optional, default -1) the modulo to use for counter cycle, applied after the addition
Return Value:
Number the new counter value

Examples

Example 1:
[["TAG_Score", player], 1] call BIS_fnc_counter;

Additional Information

See also:
BIS_fnc_deleteCounter

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