Jump to content
Sign in to follow this  
pcc

Respawn warfare resistance opposition patrol teams

Recommended Posts

At the beginning of the warfare game resistance patrol teams are spawned at depot, but only once. 

I'm want them to spawn repeatedly even after they lose the location to west or east.

I've tried adding [Resistance,_location] Spawn BIS_WF_UpdateTownPatrols; in Server_UpdateTownVirtualDefenses.sqf

//Reinforce garrison.
	if (time >= _timeNextUpdate) then
	{
		_timeNextUpdate = time + 300;
		_location SetVariable[Format["%1GarrisonCommand",_sideText],VGCOMMANDREINFORCE];
				
		[Resistance,_location] Spawn BIS_WF_UpdateTownPatrols;
				
	};

But they stop spawning after the location is captured by west or east. 

Share this post


Link to post
Share on other sites

Town patrols are only managed for the owning side.  What you want done would have to be a custom server update script.  You would build it from scratch.

 

1) Build a starter script, something not very complicated.  It will become the compiled function.

It's an update function so give it some starter stuff, and finish with a "while {!gameOver} do {looped code}" which has a sleep delay and uses the starter stuff.

 

2) If you're running a custom server init script copied from Warfare, you can add it into the mix there to compile and spawn it; or you could add something like this to a WF custom common init:

if (isServer) then 
{
	// use spawn so mission won't hang during loading due to the 'waitUntil'.
	_niv = [] spawn
	{
		PCC_ResistanceTownSpawnFunc = Compile PreprocessFileLineNumbers ("Server\Functions\Server_ResistanceTownSpawns.sqf");
		waitUntil {gameInitialized};
		[] Spawn PCC_ResistanceTownSpawnFunc;
	};
};

If adding to a WF server script, only the lines 6 (compile preprocess) and 8 (spawn) would get added into the mix.  Compile it with the other functions and spawn it after teams and towns get initialized.

 

3)  Test run and edit as needed to make sure the simple compiled function is running properly.

 

4)  Then edit the function as much as you want until it finally does what you want it to do.  Be sure cleanup of the spawned units is included when killed or no players are around.

 

  • Like 1

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  

×