OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: SafetyCatch on 27 Aug 2002, 12:40:55

Title: Join command
Post by: SafetyCatch on 27 Aug 2002, 12:40:55
does anyone know how i make a unit join another unit using a script - i know this is pretty basic but ive forgotten how to do it  :(
thanks  :)
sc
Title: Re:Join command
Post by: KTottE on 27 Aug 2002, 12:45:13
Unit1 Join Unit2
Title: Re:Join command
Post by: Tactician on 27 Aug 2002, 12:46:46
First you need a group to join.  Type something like this in the group leader's init field..

GroupA = group this

Now his group will be GroupA.  To have a unit join this group, use this.

[unitname] join GroupA

You can also add multiple units at once like this.

[unit1, unit2, unit3] join GroupA

The tricky thing is, you have to use brackets [] even with a single unit.  The 'join' function will give you an error if you pass it anything besides an array.

To make one group join another, you can also use something like this.

(units GroupB) join GroupA

The 'units' function always returns an array of the group's members, so it's safe to use.
Title: Re:Join command
Post by: KTottE on 27 Aug 2002, 12:47:49
Ah, do I feel like a dummy. My brain isn't working right ATM. It's early for christs sake  ;D