Jump to content
Sign in to follow this  
ColonelSandersLite

[unit] join grpNull in arma

Recommended Posts

In old ofp, [unit] join grpNull was the prefered method of spawning a whole group from scratch.

This still works in arma, but:

When you hit the group limit, it assigns them to one of the preexisting groups. This may cause you problems!

When using the create group command, any groups you attempt to create after the group limit has been hit will simply not be created. This may also cause you errors if you try this kind of thing after the group limit has been reached:

_mygroup = createGroup west

[unit] join _mygroup

since _myGroup will be a null value, it can do one of two things (not tested):

1: It could be the same as passing a [unit] join grpNull command.

2: It could error. (My gut tells me this is the one)

Share this post


Link to post
Share on other sites

If you have OFP installed still, you may want to test it in OFP also. IIRC in my initial test with groups in OFP, I saw unit groups get recycled.

I am having a hard time remembering, but when I tried using CreateUnit 65+ times it either stopped working completely (no unit was created) or the units were grouped with pre-existing groups. In your case, since the units is already created I tend to believe #1.

However, I have no way to test

*cough* *cough* hint hint nudge nudge

Share this post


Link to post
Share on other sites

I'm thinking that doing the join grpNull stopped working after the grouplimit had been hit. Since you couldn't spawn units without a group, you would create them in a preexisting (usually dummy) group, they would keep creating until the group was filled, then that was it.

As to me having ofp installed or not, well, it hasn't left my harddrive in all these years since it was released, so it can stay. Call it a place of honor if you will.

Well, except for a fair period of time recently where I was running an old crap machine since gaming machine died. Even then, it was on what was left of the totaled HD of my gaming machine, and while I tried it on the old crap machine, it just didn't run.

I'm going to run a test though. Since you're "hinting" with all the subtlety of a hemroid here crash biggrin_o.gif.

Share this post


Link to post
Share on other sites

Test done. Results:

In ofp, [unit] join grpNull, creates new groups until it can't anymore, and continues to createunits in the placeholder group until it can't anymore. Then stops. No Errors.

For anyone who's interested (perhaps you need to work on converting your spawning scripts to arma or such), here's the mission and script I used to do it.

Intro island, mission.sqm:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

version=11;

class Mission

{

randomSeed=4976131;

class Intel

{

};

class Groups

{

items=2;

class Item0

{

side="WEST";

class Vehicles

{

items=1;

class Item0

{

position[]={9591.622070,29.834999,3843.971436};

id=0;

side="WEST";

vehicle="SoldierWB";

player="PLAYER COMMANDER";

leader=1;

skill=0.600000;

};

};

};

class Item1

{

side="CIV";

class Vehicles

{

items=1;

class Item0

{

position[]={9681.222656,29.834999,4039.171387};

id=1;

side="CIV";

vehicle="Civilian";

leader=1;

skill=0.600000;

text="dummy";

};

};

};

};

class Markers

{

items=1;

class Item0

{

position[]={9985.221680,26.730000,4029.570801};

name="spawnPos";

text="spawnPos";

type="Flag";

};

};

class Sensors

{

items=1;

class Item0

{

position[]={9847.622070,26.730000,3872.770752};

a=0.000000;

b=0.000000;

activationBy="ALPHA";

age="UNKNOWN";

expActiv="CSL_spawnGarrisonTemp = player; [] exec ""test.sqs""";

class Effects

{

};

};

};

};

class Intro

{

randomSeed=4905475;

class Intel

{

};

};

class OutroWin

{

randomSeed=7590403;

class Intel

{

};

};

class OutroLoose

{

randomSeed=6909955;

class Intel

{

};

};

test.sqs

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

; place holder group

_spawnGroup = group dummy

_spawnCounter = 0

; this loop spawns the units

#spawnGarrisonSquad

; pick the spawn location for this man

_spawnLocation = [getMarkerPos "spawnPos" select 0, getMarkerPos "spawnPos" select 1, 0]

; build the init string

_initString = format["this setPos %1; this setDIR 0; CSL_spawnGarrisonTemp = this", _spawnLocation]

; create the unit

"Civilian" createunit [[10000,10000,10000], _spawnGroup, _initString, 0.60, "SERGEANT"]

; move the unit information from the temporary holding variable into something internal

_currentUnit = CSL_spawnGarrisonTemp

; if it's the first unit, create a new group, and set the new group to spawn to

[_currentUnit] join grpNull

_currentUnit setPos (getPos leader group _currentUnit)

; increment the counter

_spawnCounter = _spawnCounter + 1

; if there's still units to spawn, keep going

? _spawnCounter < 100 : goto "spawnGarrisonSquad"

Share this post


Link to post
Share on other sites

I had the same problem with a zombie script, and there's no real way to get around it without odd ai pathfinding problems I think. Havn't tried it since 1.0 though so maybe it's fixed.

I basically went

ZGroup = creategroup resistance

(createuinit to zgroup); deletegroup Zgroup; Zgroup = group newman; group newman selectleader newman

try experimenting around with that.

Share this post


Link to post
Share on other sites

I'm not saying this is a real problem. It'll just take me (or someone) writing a script that cleans up dead/empty groups using the deleteGroup command and allow exemptions.

I'm just posting to alert the community that this is a potential problem they may face.

The behaviour is far better now, IMO. So, I'm happy with it.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×