vehicleVarName: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(64 intermediate revisions by 16 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|VEHICLEVARNAME]]
{{RV|type=command
[[Category:Scripting Commands ArmA|VEHICLEVARNAME]]


|game1= arma1
|version1= 1.00


|game2= arma2
|version2= 1.00


|game3= arma2oa
|version3= 1.50


|game4= tkoh
|version4= 1.00


<h2 style="color:#000066">''' vehicleVarName ''object'''''</h2>
|game5= arma3
|version5= 0.50


|arg= global


'''Operand types:'''
|gr1= Object Manipulation


'''object:''' [[Object]]
|descr= Returns the variable name that contains a primary editor reference to this object. This is the variable given in the ''Insert Unit dialog / name field'' in the editor. It can be changed using [[setVehicleVarName]].


'''Type of returned value:'''
{{Feature|informative|Respawned unit will have the same vehicleVarName as the corpse left behind, however actual [[missionNamespace]] variable of the same name will only contain respawned unit.}}


[[String]]
|s1= [[vehicleVarName]] object


'''Compatibility:'''
|p1= object: [[Object]]


Version 2.91 required.
|r1= [[String]] - variable name, if none was set, an empty string is returned


'''Description:'''
|x1= <sqf>hint vehicleVarName player;</sqf>


Returns the name of the variable which contains a primary edtitor reference to this object.
|seealso= [[setVehicleVarName]] [[BIS_fnc_objectVar]]
}}


This is the variable given in the ''Insert Unit / name field'', in the editor.
{{Note
|user= Killzone_Kid
|timestamp= 20150419084500
|text= To get variable names referencing an object in mission namespace:
<sqf>
KK_fnc_objectVarNames = {
private "_names";
_names = [];
{
if (missionNamespace getVariable _x isEqualTo _this) then {
_names pushBack _x;
};
} forEach allVariables missionNamespace;
_names
};


It can be changed using [[setVehicleVarName]].
// Example
myGroup = group player;
aGroup = group player;
hint str (group player call KK_fnc_objectVarNames); // ["agroup", "mygroup"]
</sqf>
}}

Latest revision as of 20:33, 28 February 2024

Hover & click on the images for description

Description

Description:
Returns the variable name that contains a primary editor reference to this object. This is the variable given in the Insert Unit dialog / name field in the editor. It can be changed using setVehicleVarName.
Respawned unit will have the same vehicleVarName as the corpse left behind, however actual missionNamespace variable of the same name will only contain respawned unit.
Groups:
Object Manipulation

Syntax

Syntax:
vehicleVarName object
Parameters:
object: Object
Return Value:
String - variable name, if none was set, an empty string is returned

Examples

Example 1:
hint vehicleVarName player;

Additional Information

See also:
setVehicleVarName BIS_fnc_objectVar

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
Killzone_Kid - c
Posted on Apr 19, 2015 - 08:45 (UTC)
To get variable names referencing an object in mission namespace:
KK_fnc_objectVarNames = { private "_names"; _names = []; { if (missionNamespace getVariable _x isEqualTo _this) then { _names pushBack _x; }; } forEach allVariables missionNamespace; _names }; // Example myGroup = group player; aGroup = group player; hint str (group player call KK_fnc_objectVarNames); // ["agroup", "mygroup"]