Home   Help Search Login Register  

Author Topic: createUnit ?  (Read 1049 times)

0 Members and 1 Guest are viewing this topic.

Offline supershooter

  • Members
  • *
  • 2+2=4
createUnit ?
« on: 18 Aug 2006, 15:23:50 »
Hi

Well I am trying my hand at mission making and I want to try the createUnit command. Any pointers in what I'd write if I want to create an empty BMP2 at a marker called 'tank'.

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re: createUnit ?
« Reply #1 on: 18 Aug 2006, 15:26:05 »
Lifted straight from a working script:

Code: [Select]
_bemu = "BMP" createVehicle getmarkerpos "ruskibase"
...so in the script from now on, you can handle that BMP using local variable _bemu (can be global too, of course).

Replace the classname "BMP" with the one you want to use. In multiplayer, make sure you run createVehicle command only on one computer, it will then create the vehicle on others too.

Use createUnit for soldiers:

Code: [Select]
"FDF_russianMedic" createUnit [getmarkerpos "ruskibase", geoutrom, "medic2 = this;removeallweapons this"]
...from now on this medic could be handled with a global variable medic2. You need to create soldiers into an existing group and in this example that group is geoutrom.
« Last Edit: 18 Aug 2006, 15:30:36 by Baddo »

Offline supershooter

  • Members
  • *
  • 2+2=4
Re: createUnit ?
« Reply #2 on: 18 Aug 2006, 15:32:14 »
Thanks. Works nicely.
And, I presume the names:

bmp2
m4a1
t80
t70

will all work?

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re: createUnit ?
« Reply #3 on: 18 Aug 2006, 15:34:06 »
Check cfgVehicles in the comref.

Offline supershooter

  • Members
  • *
  • 2+2=4
Re: createUnit ?
« Reply #4 on: 18 Aug 2006, 17:36:59 »
Actually, one more thing. Is it possible to creat a building to a certain marker. For example a fuel station. If so jow?

Thanks