BIS fnc objectVar: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "= <code>([^<{]+)<\/code>" to "= <sqf>$1</sqf>")
 
(29 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Function|= Comments
{{RV|type=function
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|version1= 1.00


|1.00|= Game version
|gr1= Object Manipulation
____________________________________________________________________________________________


| <pre>/*
|descr= Return a unique object variable. The variable is preserved after unit respawn.


Description:
|s1= [object, varNameRoot] call [[BIS_fnc_objectVar]]
Return an unique object variable.
The variable is preserved after unit respawn.


Parameter(s):
|p1= object: [[Object]]
0: OBJECT
1 (Optional): STRING - variable name (number will be added behind it)


Returns:
|p2= varNameRoot: [[String]] - (Optional, default "bis_o") - variable name root - a number will be added behind it
STRING
*/


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|r1= [[String]] - generated variable name
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_objectVar]]; --> |= Syntax
|x1= <sqf>hint str (player call BIS_fnc_objectVar); // "bis_o1"
 
hint str (player == (missionNamespace getVariable "bis_o1")); // true</sqf>
|p1= |= Parameter 1
 
| |= Return value
____________________________________________________________________________________________
 
|x1= <code>[[hint]] [[str]] ([[player]] [[call]] [[BIS_fnc_objectVar]]; //"BIS_fnc_objectVar_obj1"<br>[[hint]] [[str]] ([[player]] == ([[missionNamespace]] [[getVariable]] "BIS_fnc_objectVar_obj1")); //true</code> |=
____________________________________________________________________________________________
 
| [[netId]], [[objectFromNetId]]|= See also


|seealso= [[netId]] [[objectFromNetId]] [[setVariable]] [[setVehicleVarName]]
}}
}}
<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: Objects|{{uc:objectVar}}]]
[[Category:Functions|{{uc:objectVar}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:objectVar}}]]

Latest revision as of 17:00, 13 July 2022

Hover & click on the images for description

Description

Description:
Return a unique object variable. The variable is preserved after unit respawn.
Execution:
call
Groups:
Object Manipulation

Syntax

Syntax:
[object, varNameRoot] call BIS_fnc_objectVar
Parameters:
object: Object
varNameRoot: String - (Optional, default "bis_o") - variable name root - a number will be added behind it
Return Value:
String - generated variable name

Examples

Example 1:
hint str (player call BIS_fnc_objectVar); // "bis_o1" hint str (player == (missionNamespace getVariable "bis_o1")); // true

Additional Information

See also:
netId objectFromNetId setVariable setVehicleVarName

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