Home   Help Search Login Register  

Author Topic: "name"  (Read 496 times)

0 Members and 1 Guest are viewing this topic.

Babalon

  • Guest
"name"
« on: 24 May 2003, 00:59:30 »
I'm makeing a script for one of my missions, and I am looking right now for something that will retrieve a units name.

I came across "name" in my command reference, and have two questions.

1) What does "name" do?

2) If it doesn't do what I need, is there a command that does?

IE: Lets say * is the name of the command I'm looking for.  The name of the vehicle is Tank1.

  *  = vehicle

So now in the script vehicle = Tank1.

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:"name"
« Reply #1 on: 24 May 2003, 01:36:46 »
putting...

tank1 = this

...in a tank's init feild doesn't make the tanks name "tank1". It makes the tanks ID tank1. The ID is what you can use to reference that tank later in scripts, like so..

tank1 move (getpos player)

Name's that are retrived by the "name" command are either defined by the mission maker in description.ext file, by your player profile, or assigned randomly by the game.

Every unit (AI or human) is assigned a name. Inaminate objects don't get names assigned to them.

To display your name ont he screen you use the name command like so...

_myname = name player
hint format["Hello %1",_myname]

or you could just do it like this...

hint format["Hello %1",name player]


"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.