vehicleVarName: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) (cleaned up, mp params, example) |
Killzone Kid (talk | contribs) No edit summary |
||
Line 45: | Line 45: | ||
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]] | ||
<!-- CONTINUE Notes --> | |||
<dl class="command_description"> | |||
<dd class="notedate">Posted on April 19, 2015 - 08:45 (UTC)</dd> | |||
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt> | |||
<dd class="note"> | |||
To get variable names referencing an object in mission namespace: | |||
<code>KK_fnc_objectVarNames <nowiki>=</nowiki> { | |||
[[private]] "_names"; | |||
_names <nowiki>=</nowiki> []; | |||
{ | |||
[[if]] ([[missionNamespace]] [[getVariable]] _x [[isEqualTo]] _this) [[then]] { | |||
_names [[pushBack]] _x; | |||
}; | |||
} [[forEach]] [[allVariables]] [[missionNamespace]]; | |||
_names | |||
}; | |||
//example | |||
myGroup <nowiki>=</nowiki> [[group]] [[player]]; | |||
aGroup <nowiki>=</nowiki> [[group]] [[player]]; | |||
[[hint]] [[str]] ([[group]] [[player]] [[call]] KK_fnc_objectVarNames); //["agroup","mygroup"]</code> | |||
</dd> | |||
</dl> | |||
<!-- DISCONTINUE Notes --> |
Revision as of 09:45, 19 April 2015
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 wasn't 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:
- Uncategorised
Syntax
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
Notes
Bottom Section
- 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"]