setVehicleVarName: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<h3 style="display:none">Bottom Section</h3> " to "")
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 |MParg=
|arg= global


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


|gr1= Object Manipulation |GROUP1=
|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:  
| 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:  
Line 18: Line 18:
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. <br>
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. <br>
To reset [[vehicleVarName]] and [[str]] representation of the object to original form set [[vehicleVarName]] to an empty string:
To reset [[vehicleVarName]] and [[str]] representation of the object to original form set [[vehicleVarName]] to an empty string:
<code>_offroad [[setVehicleVarName]] "";</code> |DESCRIPTION=
<code>_offroad [[setVehicleVarName]] "";</code>


| object''' setVehicleVarName''' name |SYNTAX=
| object''' setVehicleVarName''' name


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


|p2= name: [[String]] |PARAMETER2=
|p2= name: [[String]]


| [[Nothing]] |RETURNVALUE=
| [[Nothing]]
   
   
|x1= <code>[[player]] [[setVehicleVarName]] "aP";
|x1= <code>[[player]] [[setVehicleVarName]] "aP";
aP = [[player]];</code> |EXAMPLE1=
aP = [[player]];</code>
| mp= Execute on every client
| mp= Execute on every client
| [[vehicleVarName]] |SEEALSO=
| [[vehicleVarName]]


}}
}}

Revision as of 12:11, 18 January 2021

Hover & click on the images for description

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. vehicleVarName on the other hand is only string representation of the object. So if you want to refer to the actual object by its vehicleVarName, an extra step needed to assign the object to a variable of the same name. For example to see and refer to offroad as myFerrari: _offroad setVehicleVarName "MyFerrari"; MyFerrari = _offroad; 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.
To reset vehicleVarName and str representation of the object to original form set vehicleVarName to an empty string: _offroad setVehicleVarName "";
Multiplayer:
Execute on every client
Groups:
Object Manipulation

Syntax

Syntax:
object setVehicleVarName name
Parameters:
object: Object
name: String
Return Value:
Nothing

Examples

Example 1:
player setVehicleVarName "aP"; aP = player;

Additional Information

See also:
vehicleVarName

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 November 4, 2019 - 10:03 (UTC)
DrSova
Doesn't work with simple objects