OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Gogs on 31 May 2006, 17:02:17
-
Suppose I'd just spawned an empty vehichle
_APC = "classname" createVehicle getmarkerpos "marker"
or whatever.
Now I want to give this unit an editor name, specifically so that I can set it to a specific heading using setdir. However, I don't have its name, because it hasn't got one, so I can't. Any suggestions?
-
Isn't _APC its name? To give it a specific direction, simply write:-
_APC setdir direction
-
I thought that had to be the objects CFGvehichles class? Thats what it said in the command reference. Am investigating...
-
Serial Killer is correct. You just baptized your vehicle _APC. That shall forever be its name, from now and until the day it dies.
-
Quite right. Tested. Shes a beauty. Thanks a lot boys.
-
You just baptized your vehicle _APC. That shall forever be its name, from now and until the day it dies.
or until the end of the script, surely? _APC is a local variable, so referencing it within the same script will work just fine. outside the script however, it won't be recognised. use APC without the underscore, that makes it a global variable recognised throughout the mission.
-
Yep yep. That bits easy. I'd already made that assumption. Once again, cheers boys. Anyone know if there is going to be a solved button for this sort of thread on the new forums?