setVehicleVarName: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(formatting and cleanup)
m (Text replacement - "|game3= arma2oa |version3= 1.51 " to "|game3= arma2oa |version3= 1.50 ")
Line 11: Line 11:
|game3= arma2oa
|game3= arma2oa


|version3= 1.51
|version3= 1.50


|game4= tkoh
|game4= tkoh

Revision as of 17:52, 27 April 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. In scripts an extra step is needed to achieve the same effect. See Example 1.
Arma 3
This does not work with Arma 3: Simple Objects.
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

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

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