Jump to content
bobby budnick

Populate/garrison buildings without any mods?

Recommended Posts

I was hoping to keep mods to a minimum and find a way to populate buildings with people or order a group to garrison a building.

 

When using the bases in the sites module, one of the options is to adjust the probability of units spawning in a building.  All units spawn outdoors and do not move unfortunately.

 

When ordering groups around, there are several waypoint options that look relevant.  When dismissing units they do not go inside buildings and when using other waypoints like "sentry" or "guard" they also do not seem to go indoors.

 

I could envision a script that searches for structures in an area and adds units to the structure but I thought there might be a built in way to do the same thing?

Share this post


Link to post
Share on other sites
if (isServer) then 
{
	_units = units group this; 
	_house = nearestBuilding this; 
	_house = _house buildingPos -1;
	_house = _house call BIS_fnc_arrayShuffle; 
	if (count _units > count _house) then {_units resize (count _house);};
	{
		_x disableAI "PATH";
		_x setUnitPos selectRandom ["UP","UP","MIDDLE"];
		_x setPos (_house select _forEachIndex);
		_x addEventHandler["Fired",{params ["_unit"];_unit enableAI "PATH";_unit setUnitPos "AUTO";_unit removeEventHandler ["Fired",_thisEventHandler];}];
	} foreach _units; 
}; 

There are many ways to accomplish what you want. Pasting the above code into the leader of a units init field should work.  It will pick the closest building and move the group there. *Untested* 

 

-k 

 

---

 

edit:  I realise now that what I responded with was not entirely what you were asking for. There are however some dynamically spawning mission systems out there-- EOS like @Tobur linked is one.  I have also made some, but they generally rely on mods to a lesser or greater extent. 

 

 

-k 

Edited by nkenny
  • Like 1
  • Thanks 2

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

×