BIS fnc objectVar: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\{\{ *codecomment *\| *\/\/ *([^ ]+) *\}\} " to "{{cc|$1}}")
m (revert + fix)
Line 1: Line 1:
{{RV|type=function
{{RV|type=function


| arma3
|game1= arma3


|1.00
|version1= 1.00


|gr1 = Object Manipulation
|gr1= Object Manipulation


| Return a unique object variable. The variable is preserved after unit respawn.
|descr= Return a unique object variable. The variable is preserved after unit respawn.


| [object'', varNameRoot''] call [[BIS_fnc_objectVar]]
|s1= [object, varNameRoot] call [[BIS_fnc_objectVar]]


|p1= object: [[Object]]
|p1= object: [[Object]]
Line 15: Line 15:
|p2= varNameRoot: [[String]] - (Optional, default "bis_o") - variable name root - a number will be added behind it
|p2= varNameRoot: [[String]] - (Optional, default "bis_o") - variable name root - a number will be added behind it


| [[String]] - generated variable name
|r1= [[String]] - generated variable name


|x1= <code>[[hint]] [[str]] ([[player]] [[call]] [[BIS_fnc_objectVar]]); {{cc| "bis_o1"}}[[hint]] [[str]] ([[player]] == ([[missionNamespace]] [[getVariable]] "bis_o1")); {{codecomment|// true}}</code>
|x1= <code>[[hint]] [[str]] ([[player]] [[call]] [[BIS_fnc_objectVar]]); {{cc|"bis_o1"}}
[[hint]] [[str]] ([[player]] == ([[missionNamespace]] [[getVariable]] "bis_o1")); {{cc|true}}</code>


| [[netId]], [[objectFromNetId]], [[setVariable]], [[setVehicleVarName]]
|seealso= [[netId]], [[objectFromNetId]], [[setVariable]], [[setVehicleVarName]]
}}
}}
[[Category:Functions|{{uc:objectVar}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:objectVar}}]]

Revision as of 21:36, 29 January 2021

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:
netIdobjectFromNetIdsetVariablesetVehicleVarName

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