setVehicleVarName: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "Category:Scripting Commands ArmA2" to "Category:Scripting Commands Arma 2")
Line 50: Line 50:
[[Category:Scripting Commands ArmA|SETVEHICLEVARNAME]]
[[Category:Scripting Commands ArmA|SETVEHICLEVARNAME]]
[[Category:VBS2_Command_Group:_Variables|{{uc:{{PAGENAME}}}}]]
[[Category:VBS2_Command_Group:_Variables|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[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}}}}]]

Revision as of 17:24, 10 January 2020

-wrong parameter ("Arma") defined!-1.00
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:
Uncategorised

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

Notes

Bottom Section

Posted on November 4, 2019 - 10:03 (UTC)
DrSova
Doesn't work with simple objects