setVehicleVarName: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ |()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}") |
(formatting and cleanup) |
||
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 | ||
| 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: | |descr= 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: | ||
<code>[[hint]] [[str]] _offroad; //MyFerrari</code> | <code>[[hint]] [[str]] _offroad; //MyFerrari</code><br> | ||
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. | 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 [[{{PAGENAME}}#Example_1|Example 1]]. | ||
{{Feature|arma3|This does not work with [[Arma 3: Simple Objects]].}} | |||
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. | |||
|mp= 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. | |||
| object''' setVehicleVarName''' name | |s1= object '''setVehicleVarName''' name | ||
|p1= object: [[Object]] | |p1= object: [[Object]] | ||
Line 26: | Line 41: | ||
|p2= name: [[String]] | |p2= name: [[String]] | ||
| [[Nothing]] | |r1= [[Nothing]] | ||
|x1= <code>[[player]] [[setVehicleVarName]] "aP"; | |x1= <code>[[player]] [[setVehicleVarName]] "aP";{{cc|Change the string representation and assign it to a variable to work with}} | ||
aP = [[player]];</code> | aP = [[player]];</code> | ||
|x2= <code>_offroad [[setVehicleVarName]] ""; {{cc|Reset string representation to the default value}}</code> | |||
|seealso= [[vehicleVarName]] [[BIS_fnc_objectVar]] | |||
}} | |||
Revision as of 10:39, 28 March 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