vehicleVarName: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<dl class="command_description"> <dd class="notedate">" to "<dl class="command_description"> <dt></dt> <dd class="notedate">") |
Killzone Kid (talk | contribs) No edit summary |
||
(20 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
|game1= arma1 | |game1= arma1 | ||
|version1= 1.00 | |version1= 1.00 | ||
|game2= arma2 | |game2= arma2 | ||
|version2= 1.00 | |version2= 1.00 | ||
|game3= arma2oa | |game3= arma2oa | ||
|version3= 1.50 | |||
|version3= 1. | |||
|game4= tkoh | |game4= tkoh | ||
|version4= 1.00 | |version4= 1.00 | ||
|game5= arma3 | |game5= arma3 | ||
|version5= 0.50 | |version5= 0.50 | ||
|arg= global | |arg= global | ||
| | |gr1= Object Manipulation | ||
| | |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]]. | ||
| | {{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.}} | ||
| | |s1= [[vehicleVarName]] object | ||
| | |p1= object: [[Object]] | ||
| | |r1= [[String]] - variable name, if none was set, an empty string is returned | ||
|x1= <sqf>hint vehicleVarName player;</sqf> | |||
|x1= < | |||
|seealso= [[setVehicleVarName]] [[BIS_fnc_objectVar]] | |seealso= [[setVehicleVarName]] [[BIS_fnc_objectVar]] | ||
}} | }} | ||
{{Note | |||
|user= Killzone_Kid | |||
|timestamp= 20150419084500 | |||
|text= To get variable names referencing an object in mission namespace: | |||
<sqf> | |||
To get variable names referencing an object in mission namespace: | KK_fnc_objectVarNames = { | ||
< | private "_names"; | ||
_names = []; | |||
_names | |||
{ | { | ||
if (missionNamespace getVariable _x isEqualTo _this) then { | |||
_names | _names pushBack _x; | ||
}; | }; | ||
} | } forEach allVariables missionNamespace; | ||
_names | _names | ||
}; | }; | ||
// Example | |||
myGroup | myGroup = group player; | ||
aGroup | aGroup = group player; | ||
hint str (group player call KK_fnc_objectVarNames); // ["agroup", "mygroup"] | |||
</ | </sqf> | ||
}} |
Latest revision as of 20:33, 28 February 2024
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.
- 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:
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 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"]
Categories:
- Scripting Commands
- Introduced with Armed Assault version 1.00
- ArmA: Armed Assault: New Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Object Manipulation