Jump to content
bangabob

Enemy occupation system (eos)

Recommended Posts

Hey Guys maybe someone can help me here.

 

Im trying to build a Mission like a insurgency but i have a problem and didnt find a solution for days. The Enemy units are spawning so this works but the big problem is that the units spawn on the Server and didnt get switched to the Headless Client who is also connected on the Server.

 

I already tried the AceX HC Mover but i didnt work, also i tried some other moving scripts but still no succes.

 

Anyone has some solutions for my problem

 

Greets

Share this post


Link to post
Share on other sites
1 hour ago, frostie12345 said:

Hey Guys maybe someone can help me here.

 

Im trying to build a Mission like a insurgency but i have a problem and didnt find a solution for days. The Enemy units are spawning so this works but the big problem is that the units spawn on the Server and didnt get switched to the Headless Client who is also connected on the Server.

 

I already tried the AceX HC Mover but i didnt work, also i tried some other moving scripts but still no succes.

 

Anyone has some solutions for my problem

 

Greets

 

https://www.reddit.com/r/armadev/comments/2wm2xs/roundrobin_load_balancing_of_ai_across_up_to/

 

https://github.com/Phantomsmedia/Wavelength/tree/master/WL.VR/f/headlessclient

 

https://www.reddit.com/r/arma/comments/33q838/simple_headless_client_script/

 

http://www.armaholic.com/page.php?id=28917

 

Share this post


Link to post
Share on other sites

hi,

 

does Bastion work for anybody on a dedicated Server? Timers and Killcounters don't show, the Zone does not change to red, when Enemies are in it and it does not get reset after the last player died. Works without Problems in the Editor. Any Idea how to fix this ?

 

thx

Edited by urumbl

Share this post


Link to post
Share on other sites
On 28.1.2017 at 4:21 PM, urumbl said:

hi,

 

does Bastion work for anybody on a dedicated Server? Timers and Killcounters don't show, the Zone does not change to red, when Enemies are in it and it does not get reset after the last player died. Works without Problems in the Editor. Any Idea how to fix this ?

 

thx

 

works fine for me.

 

I added the Russian RHS units to my unitpool and it turns out that many BTR's, BMD's and some tanks have tons of crew "gunner" seats defined on top of it. For example some BTR's have more than 12 defined "gunner" seats.

 

So i didnt want to have like BTR's with 10 crew members on top.

This is how i fixed it (there is still 0 to 2 crew members on top, but i like that):

//eos_spawnVehicle.sqf

_position=(_this select 0);
_side=(_this select 1);
_faction=(_this select 2);
_type=(_this select 3);
_special = if (count _this > 4) then {_this select 4} else {"CAN_COLLIDE"};

_vehicleType=[_faction,_type] call eos_fnc_getunitpool;
	_grp = createGroup _side;

	_vehPositions=[(_vehicleType select 0)] call BIS_fnc_vehicleRoles;
	_vehicle = createVehicle [(_vehicleType select 0), _position, [], 0, _special];

//FIX START for RHS  by Johnny Drama
if ((_vehicleType select 0) in ["rhs_bmp1p_msv", "rhs_bmp1_msv", "rhs_bmp1d_msv", "rhs_bmp1k_msv", "rhs_bmp2e_msv", "rhs_bmp2_msv", "rhs_bmp2d_msv", "rhs_bmp2k_msv", "rhs_bmp3_msv", "rhs_bmp3_late_msv", "rhs_bmp3m_msv", "rhs_bmp3mera_msv", "rhs_brm1k_msv", "rhs_btr60_vdv", "rhs_btr70_vdv", "rhs_btr80_vmf", "rhs_btr80a_vdv", "rhs_Ob_681_2", "rhs_prp3_msv", "rhs_bmd1", "rhs_bmd1k", "rhs_bmd1p", "rhs_bmd1pk", "rhs_bmd1r", "rhs_bmd2", "rhs_bmd2k", "rhs_bmd2m", "rhs_bmd4_vdv", "rhs_bmd4m_vdv", "rhs_bmd4ma_vdv", "rhs_sprut_vdv", "rhs_t72ba_tv", "rhs_t72bb_tv", "rhs_t72bc_tv", "rhs_t72bd_tv", "rhs_t80", "rhs_t80a", "rhs_t80b", "rhs_t80bk", "rhs_t80bv", "rhs_t80bvk", "rhs_t80u", "rhs_t80u45m", "rhs_t80ue1", "rhs_t80uk", "rhs_t80um", "rhs_t90_tv", "rhs_t90a_tv"])	then {

_a2 = [["Turret",[3]],["Turret",[4]],["Turret",[5]],["Turret",[6]],["Turret",[7]],["Turret",[8]],["Turret",[9]],["Turret",[10]],["Turret",[11]]];
_vehPositions = _vehPositions - _a2; 
};
//FIX END


_vehCrew=[];

		{
	_currentPosition=_x;

...

...

 

  • Like 1

Share this post


Link to post
Share on other sites

Was wondering, we want to use this on our Wasteland Australia server. We use to use it some time ago on a Altis Wasteland whenever we only used Opfor and Blufor but now we use all three; Blufor, Opfor and Indy. How can I give the Civilians weapons and such? Has anybody modified this addon to give Civilians weapons? In Wasteland Civilians are everybody's enemy, that is how the missions are setup.

Share this post


Link to post
Share on other sites
14 hours ago, whatsupdoc_1_27 said:

Has anybody modified this addon to give Civilians weapons?

Hey man...I'm using a modified version (by Dub) of COS to give civis RANDOM weapons and transform them in insurgent....maybe you can use it for EOS?..hope it helps.

 

Put this on the addScript_Unit.sqf file in the COS folder.


/*
Add Script to individual units spawned by COS.
_unit = unit. Refer to Unit as _unit.
*/

_unit =(_this select 0);

/************************Make random civs rebels: Created by Dub*******************************/
_randomCivs = floor(random 10);

if(_randomCivs == 3 ||_randomCivs == 7|| _randomCivs == 10) then {
 
_whichGun = floor(random 3);

//find the closet marker and the color
_nearestMarker = [allMapMarkers, _unit] call BIS_fnc_nearestPosition;
_color = getMarkerColor _nearestMarker;
//_meters = _unit distance _nearestMarker; //commented out, but here if you want to add it to the if statement to check the distance too

//RED = CSAT, GREEN = INDEPENDENTS
if (_color == "ColorRed" ) then {

	switch (true) do {

   		 case (_whichGun == 1): {_weapon = [_unit, "rhs_weap_ak74m_folded", 4, 1] call BIS_fnc_addWeapon;};
   		 case (_whichGun == 2): {_weapon = [_unit, "LOP_Weap_LeeEnfield", 4, 1] call BIS_fnc_addWeapon;};
   		 case (_whichGun == 3): {_weapon = [_unit, "rhs_weap_M590_8RD", 4, 1] call BIS_fnc_addWeapon;};
   		 default {_weapon = [_unit, "rhs_weap_ak74m_2mag", 4, 1] call BIS_fnc_addWeapon;};

	};   

		//set the civ to rebel side
		[_unit] join createGroup independent;
		(units group _unit) join createGroup independent;

		//set the mode
		_unit setBehaviour "COMBAT";


	};

};
///_unit addAction ["Hello", {hint "Open AddScript_Unit.sqf to apply pedestrian scripts"}];// EXAMPLE SCRIPT
enableSaving[false,false];enableTeamswitch false;////Comment: Not relevant line

 

Share this post


Link to post
Share on other sites

With Bastion, is there a way to specify the starting location of the attacking AI? An example of what I'm after:

 

YNae1vL.png

 

At the moment the enemy will spawn in at random positions around the bastion marker.

Share this post


Link to post
Share on other sites
13 hours ago, zagor64bz said:

Hey man...I'm using a modified version (by Dub) of COS to give civis RANDOM weapons and transform them in insurgent....maybe you can use it for EOS?..hope it helps.

 

Put this on the addScript_Unit.sqf file in the COS folder.



/*
Add Script to individual units spawned by COS.
_unit = unit. Refer to Unit as _unit.
*/

_unit =(_this select 0);

/************************Make random civs rebels: Created by Dub*******************************/
_randomCivs = floor(random 10);

if(_randomCivs == 3 ||_randomCivs == 7|| _randomCivs == 10) then {
 
_whichGun = floor(random 3);

//find the closet marker and the color
_nearestMarker = [allMapMarkers, _unit] call BIS_fnc_nearestPosition;
_color = getMarkerColor _nearestMarker;
//_meters = _unit distance _nearestMarker; //commented out, but here if you want to add it to the if statement to check the distance too

//RED = CSAT, GREEN = INDEPENDENTS
if (_color == "ColorRed" ) then {

	switch (true) do {

   		 case (_whichGun == 1): {_weapon = [_unit, "rhs_weap_ak74m_folded", 4, 1] call BIS_fnc_addWeapon;};
   		 case (_whichGun == 2): {_weapon = [_unit, "LOP_Weap_LeeEnfield", 4, 1] call BIS_fnc_addWeapon;};
   		 case (_whichGun == 3): {_weapon = [_unit, "rhs_weap_M590_8RD", 4, 1] call BIS_fnc_addWeapon;};
   		 default {_weapon = [_unit, "rhs_weap_ak74m_2mag", 4, 1] call BIS_fnc_addWeapon;};

	};   

		//set the civ to rebel side
		[_unit] join createGroup independent;
		(units group _unit) join createGroup independent;

		//set the mode
		_unit setBehaviour "COMBAT";


	};

};
///_unit addAction ["Hello", {hint "Open AddScript_Unit.sqf to apply pedestrian scripts"}];// EXAMPLE SCRIPT
enableSaving[false,false];enableTeamswitch false;////Comment: Not relevant line

 

 

 

Okay man I will give it a try thanks...

  • Like 1

Share this post


Link to post
Share on other sites

Can someone help me with this

This doesn't work. Not sure why. 

 

 

_marker1 =  createMarker ["Marker1", getMarkerPos "marker_1"];
_marker1 setMarkerShape "RECTANGLE";
_marker1 setMarkerSize [100,100];


null = [["Marker1"],[3,1],[2,3,75],[0,0],[0],[0],[0,0],[0,0,350,EAST,TRUE]] call EOS_Spawn;

 

I am trying to create marker on random position and then EOS  Spawn there. What do I need to do.

I apologize in advance if this was answered in this thread I couldn't find it. 

Share this post


Link to post
Share on other sites
3 hours ago, stconstantine0 said:

Can someone help me with this

This doesn't work. Not sure why. 

 

 

_marker1 =  createMarker ["Marker1", getMarkerPos "marker_1"];
_marker1 setMarkerShape "RECTANGLE";
_marker1 setMarkerSize [100,100];


null = [["Marker1"],[3,1],[2,3,75],[0,0],[0],[0],[0,0],[0,0,350,EAST,TRUE]] call EOS_Spawn;

 

I am trying to create marker on random position and then EOS  Spawn there. What do I need to do.

I apologize in advance if this was answered in this thread I couldn't find it. 

Try adding "marker_1"  marker to your array? null = [["Marker_1"],[3,1]   etc. 

  • Like 1

Share this post


Link to post
Share on other sites

Hello

Thanks for the script, it works flawless and easy to configure.

is there a way to simulate koth-style continuous combat between factions? I've managed to edit unit pool and swap choppers with hummingbirds, edited the soldiers etc but as you know unless I leave the area and re-activate it, units will not respawn. Is there a way to make continuous respawns and limiting them?

 

Lets say, I need a spawn of transport helicopter when occupation get low as 10 by EAST,

spawning patrol group when occupation is 20

do not spawn anything unless EAST occupiers at area higher than 30

you get the idea hopefully? is this doable with this script?

thanks.

Share this post


Link to post
Share on other sites
5 hours ago, archibald tutter said:

Hello

Thanks for the script, it works flawless and easy to configure.

is there a way to simulate koth-style continuous combat between factions? I've managed to edit unit pool and swap choppers with hummingbirds, edited the soldiers etc but as you know unless I leave the area and re-activate it, units will not respawn. Is there a way to make continuous respawns and limiting them?

 

Lets say, I need a spawn of transport helicopter when occupation get low as 10 by EAST,

spawning patrol group when occupation is 20

do not spawn anything unless EAST occupiers at area higher than 30

you get the idea hopefully? is this doable with this script?

thanks.

i dont think eos would be what you want, since it spawns ai on a marker and caches the ai when you leave the area. i think you want the script made by spunfin militarize script or which ever one.  http://steamcommunity.com/sharedfiles/filedetails/?id=905524040 you can check out my mission of koth if you want. you could also download the pboviewer and extract the mission files to view it in the editor

  • Like 1

Share this post


Link to post
Share on other sites

Hi, I need help. I would like to make a "mission complete" trigger that is activated once all markers have been cleared. Is this possible? If so, Would someone please show me how it is done? Thank you for your help and thank you Bangabob for a great script. 

 

EDIT: I found a solution already posted. Due to my limited knowledge of scripting I didn't realize it the first time I read it. In a trigger Condition field I put:  (getMarkerColor "X" == "ColorGreen");    "X" is the name of the marker. In the On Activation field I put:    ["Mission Complete",True] call BIS_fnc_endMission;     This works. However I have a new problem. I make missions with hundreds of EOS markers. Is there any way to group the markers together to be represented by the variable X in the expression:    (getMarkerColor "X" == "ColorGreen");  if so, please show me how to do this. I will write out  (getMarkerColor "X" == "ColorGreen") &&   hundreds of times if I have to, but I don't want to. Please help. Thank you.

Share this post


Link to post
Share on other sites

Sure, count all the markers and set the count and set public variable on mission start. Then fire off a function or something when a zone is captured that counts the markers based on victory color and when the count equals the victory count call endmission. If you need more help I can put together a basic eos mission ad an example tomorrow.

Share this post


Link to post
Share on other sites
16 hours ago, thedubl said:

Sure, count all the markers and set the count and set public variable on mission start. Then fire off a function or something when a zone is captured that counts the markers based on victory color and when the count equals the victory count call endmission. If you need more help I can put together a basic eos mission ad an example tomorrow.

Hi, thank you for responding so quickly. Again, due to my lack of scripting knowledge, I am going to need to see the example mission to get what you're saying. Thank you for offering to help. I'm just going to add that i totally just wrote a file with (getMarkerColor "X" == "ColorGreen") a thousand times. numbered from marker_0 to marker_1000. However, I'm scared that if i put that beast into the condition field, in the eden trigger, its going to break arma.

Share this post


Link to post
Share on other sites

I use this with the ravage mod and all works quite well. 

 

The ravage mod has a random load out function

 

0 = rvg_fnc_equip 

 

I was wondering how/where I could put this to make the units in EoS spawn with the random ravage loot. 

 

Thanks 

Share this post


Link to post
Share on other sites

Does anyone know how you can define the init of the units spawned by EOS?

 

ALiVE has (or had) a similar array style spawning method and i did it in that before but i got a new computer since then and don't have my old HDD with the script i made on it :(

Share this post


Link to post
Share on other sites

Carl Brutananadilewski,

Sorry for delay. I have not had time over the past few days so I quick finished this while drinking some coffee at work (shhhh). Below is a quick example.  *****Please note, I have not had time to test this....I hope to get around to it tonight or tomorrow. There is a url with the example too you can download at the bottom of the post.

 

1.Create file in the root of the mission folder called initServer.sqf and add the following. I was going to count the markers, but for testing purposes the public var is define as 3. We also setup the scripted event handler.

//~284 eos_core
[missionNameSpace, "EOS_ZONE_VICTORY", { _this call dub_fnc_endMissionMarkerCount}] call BIS_fnc_addScriptedEventHandler;

 

2. In the description.ext define the function that we will call to check the counts and add the following and save. 

class CfgFunctions {
	 
	
	//dub functions
	#include "dub\CfgFunctions.hpp"

		
};

 

3. Create a folder in the root of the mission folder called "dub" and create file within the folder called "cfgFunctions.hpp" and add the following to the file and save

 

class dub
        {
	tag = "dub";
	class dub
	{
		file = "dub";	
		class endMissionMarkerCount {};
		
	};
};

4. Create a file call with in the folder called dub  "fn_endMissionMarkerCount.sqf " and add the following to the file  and save.

 

private["_ClearedZones","_AllZones"];

_debug = true; // set this to false once tested and live.
_EosMarkers = server getVariable "EOSmarkers";


_AllZones = count _EosMarkers; 
_ClearedZones = { if ( getMarkerColor ( _x select 0 ) == VictoryColor) then { true }else{ false };} count _EosMarkers; 

if (_debug) then {
					hint format ["All Count %1, Cleared Count %2",_AllZones, _ClearedZones ]; sleep 2;
				  };

/*************************************************************************
End if the marker count equals the victory markers
************************************************************************/

if(_AllZones  == _ClearedZones) 

		then { 

			"ENDVictory" remoteExec ["BIS_fnc_endMission",0];

		     };

 

5. In the "eosCore.sqf" file at line ~266, you will see the "if" statement that sets the color to Victory or Hostile. At line ~284 in the "else" when the color is set to Victory, call the scripted event handler to check it.

 

if (_debug) then {hint "Zone Lost";};
										}else{
											_mkr setmarkercolor VictoryColor;
											_mkr setmarkerAlpha _mAN;

											//captured fire, added by dub
											[ missionNamespace, "EOS_ZONE_VICTORY", [ _mkr ] ] call BIS_fnc_callScriptedEventHandler;

											if (_debug) then {hint "Zone Captured";};
								    };

 Again, this has not been tested. Just import the mission and go the zone.  I have already adjusted the openMe.sqf to spawn one zone with not enemy.  I have been busy and I hope to get back to later, but if you or someone else gives it a go let me know so I can adjust this post if need be in the meantime.

 

Adjusted EOS 1.98

https://drive.google.com/file/d/0B2VpkmbGnVybRVBQMnplX0xDOGc/view?usp=sharing

 

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, thedubl said:

Carl Brutananadilewski,

Sorry for delay. I have not had time over the past few days so I quick finished this while drinking some coffee at work (shhhh). Below is a quick example.  *****Please note, I have not had time to test this....I hope to get around to it tonight or tomorrow. There is a url with the example too you can download at the bottom of the post.

 

1.Create file in the root of the mission folder called initServer.sqf and add the following. I was going to count the markers, but for testing purposes the public var is define as 3. We also setup the scripted event handler.


//~284 eos_core
[missionNameSpace, "EOS_ZONE_VICTORY", { _this call dub_fnc_endMissionMarkerCount}] call BIS_fnc_addScriptedEventHandler;

 

2. In the description.ext define the function that we will call to check the counts and add the following and save. 


class CfgFunctions {
	 
	
	//dub functions
	#include "dub\CfgFunctions.hpp"

		
};

 

3. Create a folder in the root of the mission folder called "dub" and create file within the folder called "cfgFunctions.hpp" and add the following to the file and save

 


class dub
        {
	tag = "dub";
	class dub
	{
		file = "dub";	
		class endMissionMarkerCount {};
		
	};
};

4. Create a file call with in the folder called dub  "fn_endMissionMarkerCount.sqf " and add the following to the file  and save.

 


private["_ClearedZones","_AllZones"];

_debug = true; // set this to false once tested and live.
_EosMarkers = server getVariable "EOSmarkers";


_AllZones = count _EosMarkers; 
_ClearedZones = { if ( getMarkerColor ( _x select 0 ) == VictoryColor) then { true }else{ false };} count _EosMarkers; 

if (_debug) then {
					hint format ["All Count %1, Cleared Count %2",_AllZones, _ClearedZones ]; sleep 2;
				  };

/*************************************************************************
End if the marker count equals the victory markers
************************************************************************/

if(_AllZones  == _ClearedZones) 

		then { 

			"ENDVictory" remoteExec ["BIS_fnc_endMission",0];

		     };

 

5. In the "eosCore.sqf" file at line ~266, you will see the "if" statement that sets the color to Victory or Hostile. At line ~284 in the "else" when the color is set to Victory, call the scripted event handler to check it.

 


if (_debug) then {hint "Zone Lost";};
										}else{
											_mkr setmarkercolor VictoryColor;
											_mkr setmarkerAlpha _mAN;

											//captured fire, added by dub
											[ missionNamespace, "EOS_ZONE_VICTORY", [ _mkr ] ] call BIS_fnc_callScriptedEventHandler;

											if (_debug) then {hint "Zone Captured";};
								    };

 Again, this has not been tested. Just import the mission and go the zone.  I have already adjusted the openMe.sqf to spawn one zone with not enemy.  I have been busy and I hope to get back to later, but if you or someone else gives it a go let me know so I can adjust this post if need be in the meantime.

 

Adjusted EOS 1.98

https://drive.google.com/file/d/0B2VpkmbGnVybRVBQMnplX0xDOGc/view?usp=sharing

 

WOW! thank you very much. I am going to get on this, hopefully it happens without to much trouble. If I do have any problems, I know where I going to ask for help :) Again, thank you for your help.

Share this post


Link to post
Share on other sites

Quick question, does the percentage chance apply to each group in the array or the entire array?

Eg. If I set 4 patrol groups to spawn and have the percentage chance set to 50 does that mean each group has a 50% chance to spawn, or does that mean there's a 50/50 chance I'm  going to see either 4 or 0 patrol groups?

Share this post


Link to post
Share on other sites

Hi,

i have a problem. i created a mission with this script and when i start a server it works fine. But when i load the mission to my game server the circles stay gray and no enemys spawn. 

 

thx 

Share this post


Link to post
Share on other sites
On 1/22/2017 at 0:33 PM, hansson0728 said:

not really done, but something like this maybe for veh patrol, it should be quite easy on CPU also..

 


// // Debug
 _group =[getPos player, WEST, 4] call BIS_fnc_spawnGroup; 

_start  =	[player,[0,50],random 360,0,[1,100]] call SHK_pos;		// Starting location
_range  = 	100;													// Maximum range
_amount = 	13;														// Amount of waypoints
_unit   =	leader _group;											// Unit that should patrol

_Positions = [];
_SadSwitch = 0;
_grp = group _unit;
 
 // First position
_pos = [_start,[50,70],random 360,0,[1,_range]] call SHK_pos;
_Positions = _Positions + [_pos];
_i = 1;
while { _i < _amount} do {
 
		while {(_Pos in _Positions)} do 
		{
			_pos = [_start,[random 30,random 100],random 360,0,[1,_range]] call SHK_pos;
        };
		_wp = _grp addWaypoint [ _pos , 1, _i ];
 
        if ( _SadSwitch == 0 ) then 
		{
                [_grp, _i] setWaypointType 			"MOVE";
				[_grp, _i] setWaypointSpeed 		"LIMITED";
				[_grp, _i] setWaypointBehaviour 	"SAFE";
                [_grp, _i] setWaypointCombatMode 	"WHITE";
                [_grp, _i] setWaypointFormation 	"COLUMN";
				[_grp, _i] setWaypointTimeout 		[0, 1, 0];
        };
		
		if ( _SadSwitch == 3) then
		{
		    [_grp, _i] setWaypointType 			"SAD";
			[_grp, _i] setWaypointSpeed 		"LIMITED";
			[_grp, _i] setWaypointBehaviour 	"AWARE";
            [_grp, _i] setWaypointCombatMode 	"RED";
            [_grp, _i] setWaypointFormation 	"COLUMN";
			
			_SadSwitch = 0;
			
		} else
		{
			_SadSwitch = _SadSwitch + 1;
		};
       // Debug Marker
        _string = format["%1",_i];
        _marker = createMarker [ _string, _pos ];
        _string setMarkerColor "ColorBlue";
        _string setMarkerType "mil_dot";
        _string setMarkerText _string;
 
        _i = _i + 1;
		_Positions = _Positions + [_pos];
};
 
_wp = _grp addWaypoint [_start,0,_amount];
[_grp, _amount] setWaypointType "CYCLE";

 

I finish it then test is out. TY for starting it. :D

Share this post


Link to post
Share on other sites

Ran into a bug with one of my large missions using EOS. Mission will freeze up and create massive lag as if the server itself was disconnected. Watching ai just not load in with full uniforms or be stuck in place running, cannot use any objects, etc. Now when I go through and check what it says in debug this appears: 

Qs47cgy.png

 

I do not know if this is why my mission over a short period of time just lags up and pretty much crashes. It is the only error I have been able to find. 

 

UPDATE: Was able to figure it out. Had to do with the crews for vehicles being too high.

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

×