Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: createUnit ?  (Read 1259 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