Casso 10 Posted June 18, 2013 Hi, I am wondering if it is possible to get the name of a unit within a script. I suppose getVariable might do the trick, but I do not know the "default" variable list every object has. Could someone perhaps point out such a list? I am modifying the Xeno domination a bit, and I want to modify the x_helirespawn script a bit. I want some choppers (lift, wrecklift) to respawn pretty much instantly and others to respawn after 10 minutes. So I want to make a switch based on the unit name. Share this post Link to post Share on other sites
XSOF - Toxx 10 Posted June 18, 2013 Here are all scripting commands: http://community.bistudio.com/wiki/Category:Scripting_Commands_ArmA2 I guess what you are searching for is simply the keyword "name": http://community.bistudio.com/wiki/name Share this post Link to post Share on other sites
Casso 10 Posted June 18, 2013 I dont think that is it. I want the name of the unit given in the editor, like chopper1, not the name of the unit given through the setIdentity function. Share this post Link to post Share on other sites
XSOF - Toxx 10 Posted June 18, 2013 You're right, sorry. vehicleVarName does the trick: x = vehicleVarName this; hint format ["%1", x]; http://community.bistudio.com/wiki/vehicleVarName http://community.bistudio.com/wiki/setVehicleVarName But there might be a problem, when the unit respawns. In setVehicleVarName it says: "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.". Share this post Link to post Share on other sites
Casso 10 Posted June 18, 2013 _name = _vehicle getVariable "vec_name"; if ((_name == 301) || (_name == 302) || (_name == 304)) then { sleep 0.5; } else { sleep 600; }; solved... every time the new vehicle is created (respawned), its name is set by _vehicle setVariable ["vec_name", _number_v, true]; Share this post Link to post Share on other sites