Home   Help Search Login Register  

Author Topic: Join command  (Read 1318 times)

0 Members and 1 Guest are viewing this topic.

Offline SafetyCatch

  • Members
  • *
  • War...it's fantastic!
Join command
« 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

Offline KTottE

  • Former Staff
  • ****
Re:Join command
« Reply #1 on: 27 Aug 2002, 12:45:13 »
Unit1 Join Unit2
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"

Tactician

  • Guest
Re:Join command
« Reply #2 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.

Offline KTottE

  • Former Staff
  • ****
Re:Join command
« Reply #3 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
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"