Home   Help Search Login Register  

Author Topic: Spawning New Groups  (Read 964 times)

0 Members and 1 Guest are viewing this topic.

m21man

  • Guest
Spawning New Groups
« on: 24 Dec 2003, 19:44:08 »
When spawning new units, do you need to assign them to an existing group or can you spawn completely independant groups?

deaddog

  • Guest
Re:Spawning New Groups
« Reply #1 on: 24 Dec 2003, 20:25:04 »
They have to be spawned to an existing group name.  Just place a unit, put this in the init line:

mygroup=group this;deletevehicle this

Now you have a valid group name with no units.  Spawn your new units into this group.

 :)

m21man

  • Guest
Re:Spawning New Groups
« Reply #2 on: 25 Dec 2003, 07:39:22 »
So the following wouldn't work :-\ ?

Code: [Select]
#TDF_Scout
"BAS_GovernmentScout" createunit [_marker,grpnull,"ds1=this",.7,"lieutenant"]
_scoutgrp = group ds1
"BAS_GovernmentScout" createunit [_marker,_scoutgrp,"ds2=this",.7,"sergeant"]
"BAS_GovernmentScout" createunit [_marker,_scoutgrp,"ds3=this",.7,"corporal"]
"BAS_GovernmentScout" createunit [_marker,_scoutgrp,"ds4=this",.7,"corporal"]
"BAS_GovernmentScout" createunit [_marker,_scoutgrp,"ds5=this",.6,"private"]
"BAS_GovernmentScout" createunit [_marker,_scoutgrp,"ds6=this",.6,"private"]
{_x addeventhandler [{Killed},{_this exec {delete.sqs}}]} foreach (units _scoutgrp)
_scoutgrp move _pos
exit

deaddog

  • Guest
Re:Spawning New Groups
« Reply #3 on: 25 Dec 2003, 14:45:31 »
I've never tried it like that.  Does it work now?

The problem I see with it is that the first guy is assigned to grpnull, which doesn't exist (or does it?). Assigning someone to grpnull does not make them not be in a group.  Every unit has to be part of a group and there can only be 63 groups per side.

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:Spawning New Groups
« Reply #4 on: 25 Dec 2003, 22:54:33 »
"[unit_1] join grpNull" works, OpF generates a new group for you. But there's only a limited amount of groupnames. If you get over the barrier the above command will try to join a soldier to the 1st group. If this group is full, the unit can't be created.

That's what i found out during making my SpawnManagers.  You may download them from the EditorsDepot, under "Units and Groups" --> http://www.ofpec.com/editors/browse.php?browsewhat=2&category=2_6