setVehicleVarName: Difference between revisions
Jump to navigation
Jump to search
(formatting and cleanup) |
Lou Montana (talk | contribs) m (Text replacement - "|game3= arma2oa |version3= 1.51 " to "|game3= arma2oa |version3= 1.50 ") |
||
Line 11: | Line 11: | ||
|game3= arma2oa | |game3= arma2oa | ||
|version3= 1. | |version3= 1.50 | ||
|game4= tkoh | |game4= tkoh |
Revision as of 17:52, 27 April 2021
Description
- Description:
- Sets string representation of an object to a custom string. For example it is possible to return "MyFerrari" instead of default "ce06b00# 164274: offroad_01_unarmed_f.p3d" when querying object as string:
hint str _offroad; //MyFerrari
When a vehicle is created and named in the editor, the name becomes both the variable containing the vehicle object and the string representation of the vehicle object. In scripts an extra step is needed to achieve the same effect. See Example 1. - Multiplayer:
- In multiplayer environment setVehicleVarName has to be executed on every PC if you want the custom name to be known everywhere. If vehicle is created and named in the editor, the vehicle name will be known globally automatically.
- Groups:
- Object Manipulation
Syntax
Examples
- Example 1:
player setVehicleVarName "aP";// Change the string representation and assign it to a variable to work with aP = player;
- Example 2:
_offroad setVehicleVarName ""; // Reset string representation to the default value
Additional Information
- See also:
- vehicleVarName 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
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
- Scripting Commands: Local Effect