Jump to content
Sign in to follow this  
TRexian

BIS_fnc_spawngroup won't do civilians

Recommended Posts

Ok, I've been chasing this issue for about 3 hours (over a couple days).

_cargo = [position player, west, 5,[],[],[],[],[5,0], 10] call BIS_fnc_spawnGroup;

Spawns 5 west units.

_cargo = [position player, civilian, 5,[],[],[],[],[5,0], 10] call BIS_fnc_spawnGroup;

Spawns nothing. Hinting it up shows that it creates a group, but no units.

_cargo = [position player, CIVILIAN, ["Assistant", "Citizen4", "Profiteer2", "Functionary1", "Functionary2"],[],[],[],[],[5,0], 10] call BIS_fnc_spawnGroup;

Spawns 5 units, randomly, from those types.

And.... I couldn't figure out how to get it to check a cfgGroups entry for civilians.

Any help would be appreciated. :)

Share this post


Link to post
Share on other sites

I found this in ambientcombat.fsm, might be useful

//Create database of groups from CfgGroups to base spawned groups on.
private ["_db"];
_db = [];
private ["_cfgGroups", "_cfgWest", "_cfgEast", "_cfgGuerilla"];
_cfgGroups = configFile >> "CfgGroups";
_cfgWest = _cfgGroups >> "West";
_cfgEast = _cfgGroups >> "East";
_cfgGuerilla = _cfgGroups >> "Guerrila";
//Extract all groups for all factions.
{
private ["_cfgFaction", "_grpsFaction"];
_cfgFaction = _x;
_grpsFaction = [];

//Find all groups defined for various subtypes.
{
 private ["_cfgType", "_groups"];
 _cfgType = _cfgFaction >> _x;
 _groups = [];
 for "_i" from 0 to ((count _cfgType) - 1) do 
 {
  private ["_class"];
  _class = _cfgType select _i;

  //Only take actual classes.
  if (isClass (_class)) then 
  {
   _groups = _groups + [_class];
  };
 };

 _grpsFaction = _grpsFaction + [_groups];
} 
forEach ["Infantry", "Motorized", "Mechanized", "Armored", "Air"];

_db = _db + [_grpsFaction];
} 
forEach [_cfgWest >> "USMC", _cfgWest >> "CDF", _cfgEast >> "RU", _cfgEast >> "INS", _cfgGuerilla >> "GUE"];
//Store database in the ACM.
_acm setVariable ["dbGroups", _db];

Share this post


Link to post
Share on other sites

Good catch.

I bet that's what it is getting choked on.

BTW- this may be related, but lately I've been getting fsm errors with regard to some respect attribute. Probably civs that get killed by other civs... some civs just shouldn't be allowed to have AKs.... ;) :D

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  

×