vehicleVarName: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ |()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}")
(formatting)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma1
|game1= arma1


|1.00
|version1= 1.00
 
|game2= arma2
 
|version2= 1.00
 
|game3= arma2oa
 
|version3= 1.51
 
|game4= tkoh
 
|version4= 1.00
 
|game5= arma3
 
|version5= 0.50


|arg= global
|arg= global
Line 11: Line 27:
|gr1= Object Manipulation
|gr1= Object Manipulation


| Returns the name of the variable which 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]]. <br>
|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]]. <br>
If ''object'' refers to a vehicle that was not given a name in the editor, the return value is an empty string, "".
<br>Since it is possible to [[setVehicleVarName]] individually on each PC, the value of [[vehicleVarName]] returned will be [[local]] to the PC on which command is executed.


| '''vehicleVarName''' object
|mp= Since it is possible to [[setVehicleVarName]] individually on each PC, the value of [[vehicleVarName]] returned will be [[local]] to the PC on which command is executed.
 
|s1= '''vehicleVarName''' object


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


| [[String]]
|r1= [[String]] - Variable name, if none was set, {{ic|""}} is returned
   
   
|x1= <code>[[hint]] [[vehicleVarName]] [[player]];</code>
|x1= <code>[[hint]] [[vehicleVarName]] [[player]];</code>
Line 26: Line 42:
}}
}}


{{GameCategory|arma1|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}
<!-- CONTINUE Notes -->
<dl class="command_description">
<dl class="command_description">
<dd class="notedate">Posted on April 19, 2015 - 08:45 (UTC)</dd>
<dd class="notedate">Posted on April 19, 2015 - 08:45 (UTC)</dd>
Line 51: Line 58:
};
};


 
{{cc|Example}}
//example
myGroup <nowiki>=</nowiki> [[group]] [[player]];
myGroup <nowiki>=</nowiki> [[group]] [[player]];
aGroup <nowiki>=</nowiki> [[group]] [[player]];
aGroup <nowiki>=</nowiki> [[group]] [[player]];
Line 58: Line 64:
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 10:42, 28 March 2021

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.
Multiplayer:
Since it is possible to setVehicleVarName individually on each PC, the value of vehicleVarName returned will be local to the PC on which command is executed.
Groups:
Object Manipulation

Syntax

Syntax:
vehicleVarName object
Parameters:
object: Object
Return Value:
String - Variable name, if none was set, "" 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
Posted on April 19, 2015 - 08:45 (UTC)
Killzone Kid
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"]