Page MenuHomeFeedback Tracker

BIS_fnc_spawnGroup not working as intended (3rd parameter number)
Closed, ResolvedPublic

Description

The BIS_fnc_spawnGroup function does not work with a number as 3rd parameter, that specifies how many units (of random type) you want.

I tried to debug what happens but I did not understand the function 100%. But my guess is, that it is not able to pick some random unit types on its own and therefore spawns nothing.

The description of the function states for the 3 parameter
_this select 2: can be three different types:

  • list of character types (Array)
  • amount of characters (Number)
  • CfgGroups entry (Config)

This goes for BETA and DEV branch aswell

Details

Legacy ID
1077254000
Severity
None
Resolution
Fixed
Reproducibility
Always
Category
Scripting
Steps To Reproduce
  1. Open up editor
  2. Save mission
  3. Insert a default BLUFOR Rifleman as player.
  4. Create a marker called "1" near the player.
  5. Create init.sqf
  6. Enter: [markerPos "1", west, 5] call BIS_fnc_spawnGroup;
  7. Test mission

-> nothing spawns

Event Timeline

dga edited Steps To Reproduce. (Show Details)Jun 27 2013, 7:37 PM
dga edited Additional Information. (Show Details)
dga set Category to Scripting.
dga set Reproducibility to Always.
dga set Severity to None.
dga set Resolution to Fixed.
dga set Legacy ID to 1077254000.May 7 2016, 3:02 PM
Bohemia added a subscriber: DnA.Jun 27 2013, 7:37 PM

Glad someone posted this. Confirmed it don't work as intended

JQuel added a subscriber: JQuel.May 7 2016, 3:02 PM

Hmm, but it does spawn pre-composed groups - This is an odd one

dga added a subscriber: dga.May 7 2016, 3:02 PM
dga added a comment.Jul 18 2013, 10:12 PM

@JQuel Yeah. I tried to debug it and my guess is, that it fails at picking unit types (groups) on its own.

StevoAU added a subscriber: StevoAU.May 7 2016, 3:02 PM

Still broken and I think I know what is wrong.

In "fn_spawnGroup" it uses (on line 53)

if (_charsType == (typeName 0)) then
{
//Only a count was given, so ask this function for a good composition.
_types = [_side, _chars] call BIS_fnc_returnGroupComposition;
}

When deciding the units that will makeup the group

Looking into "fn_returnGroupComposition" all the units defined are A2 + OA units, eg. "USMC_Soldier_TL" or "TK_Soldier_SL_EP1" instead of the appropriate Arma 3 unit classnames

Nutlink added a subscriber: Nutlink.May 7 2016, 3:02 PM

Just checked, as of 1.40 fn_returnGroupComposition still has Arma 2 classnames.

Please fix this :(

DnA added a comment.Sep 2 2015, 2:10 PM

Fixed: Third parameter of BIS_fnc_spawnGroup as Scalar did not spawn characters (in Dev-Branch soon)

It was as StevoAU wrote of course. I've only substituted the A2 classes with A3 ones (instead of a more advanced system that actually builds a reasonable group based on configs, rather than hard-scripting class names). We're not using this function in this manner ourselves. Sorry it took this long.

You guys rock :)