Jump to content
jandrews

Site module opfor units

Recommended Posts

Anyway to edit the units spawned with site modules? For example from standard opfor to urban opfor?

Share this post


Link to post
Share on other sites

Depending on what you want to change, you can modify the spawned objects by detecting them dynamically:

{
    if ((alive _x) && {(side _x) == east}) then {
        _x forceAddUniform "<...>";
    };
} forEach ((getPosATL OpforSite) nearEntities [["Man"], 100]);

Just put whatever uniform you want in there, change OpforSite to the name of the module, and tweak 100 to whatever distance includes all the units.

Share this post


Link to post
Share on other sites

Depending on what you want to change, you can modify the spawned objects by detecting them dynamically:

{    if ((alive _x) && {(side _x) == east}) then {	    _x forceAddUniform "<...>";    };} forEach ((getPosATL OpforSite) nearEntities [["Man"], 100]);
Just put whatever uniform you want in there, change OpforSite to the name of the module, and tweak 100 to whatever distance includes all the units.

Nice I presume I could use _x forceaddhelmet and backpack the same way too . and this goes in the initserver.sqf thanks

Share this post


Link to post
Share on other sites

All groups that are spawned with a site are kept in a variable on the site called 'garrison'. So instead of near entities use...

One site named myOpforSite

//Only run on server
if !( isServer ) exitWith {};
//Wait for sites to finish initialising
waitUntil { !isNil "BIS_initSitesDone" };
//foreach group
{
	//foreach unit of the group
	{
		_x forceAddUniform "###";
		//Whatever else needs doing to each unit
	}forEach units _x;
}forEach ( myOpforSite getVariable [ "garrison", [] ] );

A couple of options if you need todo more than one site..

Mulitple sites called myOpforSite, myOpforSite2 and myOpforSite3

//Only run on server
if !( isServer ) exitWith {};
//Wait for sites to finish initialising
waitUntil { !isNil "BIS_initSitesDone" };
{
	//foreach group
	{
		//foreach unit of the group
		{
			_x forceAddUniform "###";
			//Whatever else needs doing to each unit
		}forEach units _x;
	}forEach ( _x getVariable [ "garrison", [] ] );
}forEach [ myOpforSite, myOpforSite2, myOpforSite3 ];

For all sites currently on the map

//Only run on server
if !( isServer ) exitWith {};
//Wait for sites to finish initialising
waitUntil { !isNil "BIS_initSitesDone" };
{
	//foreach group
	{
		//foreach unit of the group
		{
			_x forceAddUniform "###";
			//Whatever else needs doing to each unit
		}forEach units _x;
	}forEach ( _x getVariable [ "garrison", [] ] );
}forEach ( BIS_missionScope getVariable "sites" );
Either execVM/spawn these from the init.sqf or place in your initServer.sqf or could be execVM/spawn from a sites init line.

There are also ways to add your own factions to the site modules but is a little more involved see HERE for details, and can make it possible to rewrite the site module to do pretty much anything you want.

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

×