OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: supershooter 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'.
-
Lifted straight from a working script:
_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:
"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.
-
Thanks. Works nicely.
And, I presume the names:
bmp2
m4a1
t80
t70
will all work?
-
Check cfgVehicles (http://www.ofpec.com/COMREF/vehicles.html) in the comref.
-
Actually, one more thing. Is it possible to creat a building to a certain marker. For example a fuel station. If so jow?
Thanks