vehicleVarName: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "wasn't" to "was not")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...)
Line 1: Line 1:
{{Command|Comments=
{{Command


| arma1 |Game name=
| arma1


|1.00|Game version=
|1.00


|arg= global
|arg= global


|eff= local |Multiplayer Effects=
|eff= local


|gr1= Object Manipulation |GROUP1=
|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>
| 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>
If ''object'' refers to a vehicle that was not given a name in the editor, the return value is an empty string, "".
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. |DESCRIPTION=
<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 |SYNTAX=
| '''vehicleVarName''' object


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


| [[String]] |RETURNVALUE=
| [[String]]
   
   
|x1= <code>[[hint]] [[vehicleVarName]] [[player]];</code> |EXAMPLE1=
|x1= <code>[[hint]] [[vehicleVarName]] [[player]];</code>




| [[setVehicleVarName]] |SEEALSO=
| [[setVehicleVarName]]


}}
}}

Revision as of 12:42, 18 January 2021

Hover & click on the images for description

Description

Description:
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.
If object refers to a vehicle that was not given a name in the editor, the return value is an empty string, "".
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

Examples

Example 1:
hint vehicleVarName player;

Additional Information

See also:
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
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"]