setVehicleVarName: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
Line 55: Line 55:
[[Category:VBS2_Command_Group:_Variables|{{uc:{{PAGENAME}}}}]]
[[Category:VBS2_Command_Group:_Variables|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{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 12:06, 25 March 2013

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

Description

Description:
Sets the name of the variable which contains a reference to this object. It is necessary in MP to change the variable content after a respawn. When you only use 'myVar = <vehicle>', you'll just have a normal variable, when you use this command as well, 'myVar' will be the name for the vehicle, i.e. if you have other variables containing the vehicle, they'll now return 'myVar' and not WEST ... Note: This command does not set 'myVar' to contain the vehicle, this has to be done separately.
Groups:
Uncategorised

Syntax

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

Examples

Example 1:
player setVehicleVarName "aP"
Example 3:
//Assign a variable to an object and be able to refer to that

//object using the variable, in both single and multi player.

_Object="M1A1" CreateVehicle (GetPos Player); _VarName="MYTANK"; _Object SetVehicleVarName _VarName; _Object Call Compile Format ["%1=_This ; PublicVariable ""%1""",_VarName];

Additional Information

See also:
vehicleVarNameisValidVarName (VBS2)

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