Jump to content

Recommended Posts

Hi there,

 

Using the following code I've been able to spawn groups of AI, easy enough. However, I want to remove the randomness and spawn specific groups, ie. HAF_InfSquad. I've never been able to get it to work, even though according to all the forum topics and BIS own wiki pages, I should be able to do it.

 

if(!isServer) exitWith {};

//========

_groups = "True" configClasses (configFile >> "cfgGroups" >> "Indep" >> "IND_F" >> "Infantry");

//========

systemChat str "inf_script_3 working";

for [{_i=0}, {_i<1}, {_i=_i+1}] do
{
	_randomgroup = selectRandom _groups;	

	_grp = [getMarkerPos "spawn_marker_4", INDEPENDENT, _randomgroup] call BIS_fnc_spawnGroup;

	{
	_x unassignItem "NVGoggles_INDEP";
	_x removeItem "NVGoggles_INDEP";
	_x removeWeapon "launch_I_Titan_F";
	_x addPrimaryWeaponItem "acc_flashlight";
	_x enableGunLights "forceOn";
	} forEach units _grp;

	_grp addWaypoint [getpos REAPER, 150];
}; 

 

What I want to be able to do is this code, but whenever I use this the script runs, and no errors are thrown, but nothing happens:

 

if(!isServer) exitWith {};

//========

systemChat str "inf_script_3 working";

for [{_i=0}, {_i<1}, {_i=_i+1}] do
{
	_randomgroup = selectRandom _groups;	

	_grp = [getMarkerPos "spawn_marker_4", INDEPENDENT, (configFile >> "cfgGroups" >> "Indep" >> "IND_F" >> "Infantry" >> "HAF_InfSquad")] call BIS_fnc_spawnGroup;

	{
	_x unassignItem "NVGoggles_INDEP";
	_x removeItem "NVGoggles_INDEP";
	_x removeWeapon "launch_I_Titan_F";
	_x addPrimaryWeaponItem "acc_flashlight";
	_x enableGunLights "forceOn";
	} forEach units _grp;

	_grp addWaypoint [getpos REAPER, 150];
}; 

 

Share this post


Link to post
Share on other sites

Edit: I got your second script working by removing the "_randomgroup = selectRandom _groups;" because it gave error saying _groups is not defined.

 

 

Edited by gc8

Share this post


Link to post
Share on other sites

Thanks mate, I'll give it a go, though I think I've already done it like that before.

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

×