OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: merby1 on 08 Jan 2006, 04:46:11

Title: CreateUnit damn you!!!
Post by: merby1 on 08 Jan 2006, 04:46:11
Hey, sorry for the amazingly stupid question but...
I've refered to the comm ref and the tutorials about spawning units but cannot get the damn thing to create.
I've tried inserting marker: "rus1"
_chaser1 = "JAM_EBOfficer" createVehicle getmarkerpos "rus1"
and
"JAM_EBOfficer" createUnit [getmarkerpos "rus1"]

but i still cant find him.
Can u create units in your cut scenes?
Sorry I have no idea why this isnt working.
Mark
Title: Re:CreateUnit d**n you!!!
Post by: Fragorl on 08 Jan 2006, 06:36:33
From the comref: CreateUnit (http://www.ofpec.com/editors/comref.php?letter=C#createUnit)

type createUnit unitInfo

"Format of unitInfo is: [pos (Position),group (Group), init (String), skill (Number), rank (String)] Note: init, skill, and rank are optional"

Quote
Backoff  November 01, 2002, 08:12
The Group parameter MUST be an existing group or the unit won't be created.

To create a unit, you must first have a reference to an existing group. You cannot create new groups; this group must already exist at the beginning of this mission.

The easiest way to do this is to place a soldier in the editor, probability of presence = 0, and in his init field put something like "Spawn_group = group this"

In your script put

"JAM_EBOfficer" createUnit [getmarkerpos "rus1", Spawn_group ]
Title: Re:CreateUnit d**n you!!!
Post by: macguba on 08 Jan 2006, 14:10:46
createVehicle is a badly worded command.   Although in OFP "vehicle" usually includes soldiers, in this case it does not.    Use this command if you want to create an empty tank, car, etc. somewhere.

Use camCreate if you want to create an object such as a table.

Use createUnit if you want to create a soldier.
Title: Re:CreateUnit d**n you!!!
Post by: penguinman on 08 Jan 2006, 20:38:52
ok, I have a very simmaler problem.

Im trying to create a BMP1 at a gamelogic. it wont work,
im trying

bmp1 = "BMP1" createvehicle getpos g1

nothing happens.

thanks
Title: Re:CreateUnit d**n you!!!
Post by: Planck on 08 Jan 2006, 22:37:47
Try:

bmp1 = "BMP" createvehicle getpos g1


Planck