Talk:setVehicleVarName

From Bohemia Interactive Community

Jump to: navigation, search

AnswerMe

Anyone know what this command is supposed to achieve? If you put this in a vehicles init field:

This SetVehicleVarName "Test" ; Hint Format ["%1",Test]

The format command returns the scalar bool error. If you want to refer to the vehicle via the variable pointer Test in ver 1.05, you have to also call this:

This SetVehicleVarName "test";
This Call Compile Format ["%1=_This","Test"];

Cheers

Maybe I'm missing something here, but wouldn't the second line be the same as Test=This?
I don't quite understand why the _this, and why it needs to be compiled in the first place.
When I tried the "plain" version it worked just fine: --Kronzky 03:45, 4 May 2007 (CEST)
this setVehicleVarName "test";
test=this;
Yeah, the second part is a bad example. For the purposes of understanding how the command is supposed to be used, your simplified version is a much clearer demonstration of the problem.
My original example relates to how I wanted to use the command at the time. The variable names I want to use are all dynamic. Because they are created during the mission, I would not know what they were called. Only I removed all that from the code when I pasted the example here.
I can't help thinking this is a bug with the setVehicleVarName command? As I can't think of any other use for it. UNN 08:29, 4 May 2007 (CEST)

_name = "foobar"; _l = "logic" createvehicle getpos player; _l setvehiclevarname _name; player sidechat str _l; // output is "foobar" This is only use I see. --Doolittle 08:45, 9 August 2007 (CEST)

Personal tools
Buy ArmA now!