Home   Help Search Login Register  

Author Topic: Giving a name to an empty object you have just spawned.  (Read 1038 times)

0 Members and 1 Guest are viewing this topic.

Offline Gogs

  • Contributing Member
  • **
  • WWIIEC - Gracefully retired boss
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?

srk

  • Guest
Re: Giving a name to an empty object you have just spawned.
« Reply #1 on: 31 May 2006, 17:11:49 »
Isn't _APC its name? To give it a specific direction, simply write:-

_APC setdir direction

Offline Gogs

  • Contributing Member
  • **
  • WWIIEC - Gracefully retired boss
Re: Giving a name to an empty object you have just spawned.
« Reply #2 on: 31 May 2006, 17:16:47 »
I thought that had to be the objects CFGvehichles class? Thats what it said in the command reference. Am investigating...

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: Giving a name to an empty object you have just spawned.
« Reply #3 on: 31 May 2006, 17:44:54 »
Serial Killer is correct. You just baptized your vehicle _APC. That shall forever be its name, from now and until the day it dies.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline Gogs

  • Contributing Member
  • **
  • WWIIEC - Gracefully retired boss
Re: Giving a name to an empty object you have just spawned.
« Reply #4 on: 31 May 2006, 17:47:19 »
Quite right. Tested. Shes a beauty. Thanks a lot boys.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Giving a name to an empty object you have just spawned.
« Reply #5 on: 31 May 2006, 17:52:39 »
Quote
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.
« Last Edit: 31 May 2006, 19:28:40 by bedges »

Offline Gogs

  • Contributing Member
  • **
  • WWIIEC - Gracefully retired boss
Re: Giving a name to an empty object you have just spawned.
« Reply #6 on: 31 May 2006, 19:05:12 »
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?