Jump to content
Sign in to follow this  
kyfohatl

How to specify the FACTION of BIS_fnc_spawnGroup?

Recommended Posts

The title says it all pretty much. Here's what I'm trying to do:

waitUntil {!isNil "BIS_fnc_init"};
_Patrolgrp1 = [position player, WEST, (configFile >> "CfgGroups" >> "West" >> "CDF")] call BIS_fnc_spawnGroup;

So basically, I want to create CDF patrol groups, not USMC ones. The code above doesn't work, but that's what I can understand from the wiki.

Any help would be greatly appreciated.

EDIT: Here's the wiki page:

http://community.bistudio.com/wiki/BIS_fnc_spawnGroup

Maybe you can figure it out. Kylania has put some good info up there, but I can't figure out how to do this (I don't know why what I'm doing already doesn't work).

Edited by kyfohatl

Share this post


Link to post
Share on other sites

(configFile >> "CfgGroups" >> "West" >> "CDF")

is not a group

(configFile >> "CfgGroups" >> "West" >> "CDF" >> "Infantry" >> "CDF_InfSquad")

probably is

CfgGroups

Share this post


Link to post
Share on other sites
(configFile >> "CfgGroups" >> "West" >> "CDF")

is not a group

(configFile >> "CfgGroups" >> "West" >> "CDF" >> "Infantry" >> "CDF_InfSquad")

probably is

CfgGroups

Oh yeah... actually I looked at that page. But doesn't this means that the function will spawn CDF_InfSquad, which is a specific infantry squad I think, every time? I would like to take advantage of the fact that the function spawns a random group (e.g. AT group or AA group), but if I specify the group (say CDF_InfSquad), wouldn't that mean only one type of group is spawned? (I'd like to specify the faction, but I'd like the group type to be random).

...or am I wrong and "CDF_InfSquad" is a general group class which spawns a random group type?

Thanks for the help by the way.

Share this post


Link to post
Share on other sites

waitUntil {!isNil "BIS_fnc_init"};
_g = ["CDF_InfSquad","CDF_InfSquad_Weapons","CDF_InfSection_AT"] call BIS_fnc_selectRandom;
_Patrolgrp1 = [position player, WEST, (configFile >> "CfgGroups" >> "West" >> "CDF" >> "Infantry" >> _g)] call BIS_fnc_spawnGroup;

Obviously, if you really want to have a chance to encounter a tank platoon etc, you need to switch the infantry part as well.

Share this post


Link to post
Share on other sites
waitUntil {!isNil "BIS_fnc_init"};
_g = ["CDF_InfSquad","CDF_InfSquad_Weapons","CDF_InfSection_AT"] call BIS_fnc_selectRandom;
_Patrolgrp1 = [position player, WEST, (configFile >> "CfgGroups" >> "West" >> "CDF" >> "Infantry" >> _g)] call BIS_fnc_spawnGroup;

Obviously, if you really want to have a chance to encounter a tank platoon etc, you need to switch the infantry part as well.

Your the man shk! Thanks very much

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  

×