Jump to content
bangabob

Enemy occupation system (eos)

Recommended Posts

I dont suppose anyone could point me in the right direction as regards where I would find this bit could they :D

Correction other bug :

Group size vehicle:
ligne 110 : _cGroup=[_pos,_bSize,_faction,_side] call EOS_LightVeh;
replace by :
ligne 110 : _cGroup=[_pos,_cSize,_faction,_side] call EOS_LightVeh;

Group size armoured
ligne 124 : _dGroup=[_pos,_bSize,_faction,_side] call EOS_Armour;
replace by :
ligne 124 : _dGroup=[_pos,_dSize,_faction,_side] call EOS_Armour;

Group size mortar
ligne 136 : _eGroup=[_pos,_bSize,_faction,_side] call EOS_spawnStatic;
replace by :
ligne 136 : _eGroup=[_pos,_eSize,_faction,_side] call EOS_spawnStatic;

Share this post


Link to post
Share on other sites
I dont suppose anyone could point me in the right direction as regards where I would find this bit could they :D

Correction other bug :

Group size vehicle:
ligne 110 : _cGroup=[_pos,_bSize,_faction,_side] call EOS_LightVeh;
replace by :
ligne 110 : _cGroup=[_pos,_cSize,_faction,_side] call EOS_LightVeh;

Group size armoured
ligne 124 : _dGroup=[_pos,_bSize,_faction,_side] call EOS_Armour;
replace by :
ligne 124 : _dGroup=[_pos,_dSize,_faction,_side] call EOS_Armour;

Group size mortar
ligne 136 : _eGroup=[_pos,_bSize,_faction,_side] call EOS_spawnStatic;
replace by :
ligne 136 : _eGroup=[_pos,_eSize,_faction,_side] call EOS_spawnStatic;

Download link updated with this fix. Just download it again.

Or look inside EOS\EOS\EOS_core.sqf

Share this post


Link to post
Share on other sites
Download link updated with this fix. Just download it again.

Or look inside EOS\EOS\EOS_core.sqf

Thanks mate.

Might seem like a daft question but do we use the stable build or the dev build now? I'm guessing the dev build still for altis users?

Share this post


Link to post
Share on other sites
Hello look my precedent Post for the spawn center problem.

the bug is caused for the variable "_r"

Correction :

add "_r" in Private for :

Correction spawn infrantery

file : \EOS\SpawnUnits\Spawn_Infantry.sqf

private ["_r","_side","_type","_unitType","_grp", ........

Correction spawn vehicle

file : \EOS\Functions\EOS_Fill_Cargo.sqf

private ["_r","_cargo","_emptySeats","_vehicle", .............

Correction other bug :

Group size vehicle:

ligne 110 : _cGroup=[_pos,_bSize,_faction,_side] call EOS_LightVeh;

replace by :

ligne 110 : _cGroup=[_pos,_cSize,_faction,_side] call EOS_LightVeh;

Group size armoured

ligne 124 : _dGroup=[_pos,_bSize,_faction,_side] call EOS_Armour;

replace by :

ligne 124 : _dGroup=[_pos,_dSize,_faction,_side] call EOS_Armour;

Group size mortar

ligne 136 : _eGroup=[_pos,_bSize,_faction,_side] call EOS_spawnStatic;

replace by :

ligne 136 : _eGroup=[_pos,_eSize,_faction,_side] call EOS_spawnStatic;

Brilliant! The infantry now occupy houses after spawn :D

Share this post


Link to post
Share on other sites
Hi mate

I'm trying this out but can't find which .sqf the "correction other bug" pertains to?

What is the other bug this fixes?

Thanks for your help mate.

Regards

ToM

Hi, sorry i have forgot to mention the file name ^^

Hi mate

Very nice. Thanks for taking the time to let me know.

EOS is a big project and sometimes its as simple as that to fix a large scale problem

ToM

No worries and your script has a future of Arma

Share this post


Link to post
Share on other sites

I'm really liking how this script is coming together. Nice work BangaBob!

Here's something I've noticed - first off I use Massi's A3 African units (and am now able to spawn them for house and foot patrols without a problem). When I spawn Static or vehicles though I notice that those are manned with other units than the ones I selected. In fact they seem to be the ones that normally use the vehicles when manned. For example; B_G_Offroad_01_armed_F comes with Greek units in the driver and gunner position - not my Africans! Worse they are independents and my EAST side Africans open fire on them! I just want to use the vehicles (empty) with crews from the Infantry pool that I have put together (much like how DAC used the pools with Pilots, Crew, Officers, soldiers, etc. etc.).

So it seems to me that the script is taking the vehicle faction into account - which I don't want it to do - I just want to put a crew into it and have it drive around in its area.

Share this post


Link to post
Share on other sites

Hey Bob, is there any way to run script upon clearing a zone (or set of zones)?

Just so I can run something like: ["Attack_Stronghold","SUCCEEDED",true] call BIS_fnc_taskSetState;

Oh and can I spawn civilian groups with weapons?

Edited by mikemhz

Share this post


Link to post
Share on other sites
I'm really liking how this script is coming together. Nice work BangaBob!

Here's something I've noticed - first off I use Massi's A3 African units (and am now able to spawn them for house and foot patrols without a problem). When I spawn Static or vehicles though I notice that those are manned with other units than the ones I selected. In fact they seem to be the ones that normally use the vehicles when manned. For example; B_G_Offroad_01_armed_F comes with Greek units in the driver and gunner position - not my Africans! Worse they are independents and my EAST side Africans open fire on them! I just want to use the vehicles (empty) with crews from the Infantry pool that I have put together (much like how DAC used the pools with Pilots, Crew, Officers, soldiers, etc. etc.).

So it seems to me that the script is taking the vehicle faction into account - which I don't want it to do - I just want to put a crew into it and have it drive around in its area.

I understand. This was something i hoped wouldn't be a problem.

I will look into it soon

---------- Post added at 16:01 ---------- Previous post was at 16:00 ----------

Hey Bob, is there any way to run script upon clearing a zone (or set of zones)?

Just so I can run something like: ["Attack_Stronghold","SUCCEEDED",true] call BIS_fnc_taskSetState;

Oh and can I spawn civilian groups with weapons?

Use

"colorgreen" getmarkercolor "eosMarkerName"

To get the EOS zone cleared.

And you can't spawn civilians with weapons

Share this post


Link to post
Share on other sites
You just have to put this in the eos_init.sqf, line 39 :

_spotFriendlies setTriggerStatements ["{vehicle _x in thisList && isplayer _x&& ((getPosATL _x) select 2) < 10} count allUnits > 0","",""];

As you can see, if the heli isn't under 10m high, ennemies don't spawn!! :yay:

Hi guys

Is there any way to implement the above script in the new look EOS system. This EOS_init file no longer exists from what I can see.

Share this post


Link to post
Share on other sites
Hi guys

Is there any way to implement the above script in the new look EOS system. This EOS_init file no longer exists from what I can see.

Much simpler now. Open EOS\EOS\eos_core.sqf

Find

_Heightlimit = false;

replace with

_Heightlimit = true;

Share this post


Link to post
Share on other sites
Much simpler now. Open EOS\EOS\eos_core.sqf

Find

_Heightlimit = false;

replace with

_Heightlimit = true;

youre-awesome.jpg

Share this post


Link to post
Share on other sites
will be Preset just for heavy armor like T-100,m2a1 slammer?

You can edit the unit pool to only spawn them units By removing the other classnames inside the armour unit pools.

Share this post


Link to post
Share on other sites
You can edit the unit pool to only spawn them units By removing the other classnames inside the armour unit pools.

okay thank for head up :D

edit:

in EOS_unitspool.sqf?

Edited by kanadetachibana0

Share this post


Link to post
Share on other sites

BangaBob

Is this the line that change the despawn delay?

// PLAYER LEFT ZONE

_eosAct=false;

};sleep 0.5;}; changing the 0.5?

Share this post


Link to post
Share on other sites
BangaBob

Is this the line that change the despawn delay?

// PLAYER LEFT ZONE

_eosAct=false;

};sleep 0.5;}; changing the 0.5?

I dont know if it will delay the de-spawn. More likely will break the system.

Can i ask why you want a despawn delay?

Share this post


Link to post
Share on other sites

Because i have a mission with ai on my side and when i die and come back my units are just sitting around bc the enemies will just disappear! And why would it break?

chal00 had made a little change on the 1.8 that would delay the despawn and worked!

Share this post


Link to post
Share on other sites
Because i have a mission with ai on my side and when i die and come back my units are just sitting around bc the enemies will just disappear! And why would it break?

chal00 had made a little change on the 1.8 that would delay the despawn and worked!

You could make the EOS zone activate for AI on your side? So the enemy won't de-spawn while AI on your side are in the zone

Share this post


Link to post
Share on other sites

hi BangaBob,

first i have to say that i love your EOS! :D

With this I'am way closer to my desired mission...

I use your latest dev build 1.9 and changed a few things, so i wanted to let it be known to you.

Here it goes:

in "EOS/EOS/EOS_Core.sqf" you use BIS_fnc_findSafePos which has an tendency to dont find a viable position so i tweaked the parameters a bit and put it into a loop with exit functionality. It's now reliable in crowded towns.

code is now as follows: (only snippet)

_radmen = 30;_radveh = 50;
_cache= if (count _this > 7) then {_this select 7} else {false};

_debug=false;
_heightLimit=false;
_r=_mkrX * 0.8;

switch (_side) do{case EAST:{_strFac="east";_civZone=false;};case WEST:{_strFac="west";_civZone=false;};case INDEPENDENT:{_strFac="GUER";_civZone=false;};case CIVILIAN:{_strFac="civ";_civZone=true;};};
switch (_mA) do {case 0:{_mAH = 1;_mAN = 0.5;};case 1:{_mAH = 0;_mAN = 0;};case 2:{_mAH = 0.5;_mAN = 0.5;};};

// INITIATE ZONE
_trig=format ["EOSTrigger%1",_mkr];

if (!_cache) then {
if ismultiplayer then {
		if (_heightLimit) then 
		{_actCond="{vehicle _x in thisList && isplayer _x && ((getPosATL _x) select 2) < 5} count playableunits > 0";
						}else 
						{_actCond="{vehicle _x in thisList && isplayer _x} count playableunits > 0";
	};}else{
		if (_heightLimit) then 
					{_actCond="{vehicle _x in thisList && isplayer _x && ((getPosATL _x) select 2) < 5} count allUnits > 0";
							}else
								{_actCond="{vehicle _x in thisList && isplayer _x} count allUnits > 0";};};

	_eosActivated = createTrigger ["EmptyDetector",_mPos]; 
	_eosActivated setTriggerArea [(_distance+_mkrX),(_distance+_mkrY),0,true]; 
	_eosActivated setTriggerActivation ["ANY","PRESENT",true];
	_eosActivated setTriggerTimeout [1, 1, 1, true];
	_eosActivated setTriggerStatements [_actCond,"",""];

		server setvariable [_trig,_eosActivated];	
				}else{
			_eosActivated=server getvariable _trig;	
				};

				_mkr setmarkerAlpha _mAN;
					if (!(getmarkercolor _mkr == VictoryColor)) then 	//IF MARKER IS GREEN DO NOT CHANGE COLOUR
						{
					_mkr setmarkercolor hostileColor;
						};

waituntil {triggeractivated _eosActivated};	//WAIT UNTIL PLAYERS IN ZONE
if (!(getmarkercolor _mkr == "colorblack"))then {
if (!(getmarkercolor _mkr == VictoryColor)) then {_mkr setmarkerAlpha _mAH;};

// SPAWN HOUSE PATROLS
_n=0;
_aGrp=[];
	while {_n < _aGrps} do 
	{	
	_n=_n+1;
	if (_cache) then {
			_cacheGrp=format ["HP%1",_n];
			_units=_eosActivated getvariable _cacheGrp;	
					_aSize=[_units,_units];
					_aMin=_aSize select 0;
						if (_debug)then{player sidechat format ["ID:%1,restore - %2",_cacheGrp,_units];};
						};
							if (_aMin > 0) then {
								_pos = [_mPos, _r, random 360] call BIS_fnc_relPos;
								for "_counter" from 0 to 100 do {
									_newpos = [_pos,0,_radmen,0.5,1,20,0] call BIS_fnc_findSafePos;
									if ((_pos distance _newpos) < (_radmen + 1)) exitWith {_pos = _newpos;};
								};

									_aGroup=[_pos,_bSize,_faction,_side] call EOS_spawnPatrol;

										0=[_mPos,units _aGroup,_r,0,[0,4],true] call callHouseScript;
											_aGrp=_aGrp+[_aGroup];sleep 0.1;
					if (_debug) then {hint "Spawning House patrol";0= [_mkr,_n,"House Patrol",getpos (leader _aGroup)] call EOS_debug};
											};
	};

// SPAWN PATROLS
_n=0;
_bGrp=[];
	while {_n < _bGrps} do 
	{	
	_n=_n+1;
	if (_cache) then {
			_cacheGrp=format ["PA%1",_n];
			_units=_eosActivated getvariable _cacheGrp;	
				_bSize=[_units,_units];_bMin=_bSize select 0;
				if (_debug)then{player sidechat format ["ID:%1,restore - %2",_cacheGrp,_units];};
					};
						if (_bMin > 0) then {	
							_pos = [_mPos, _r, random 360] call BIS_fnc_relPos;
							for "_counter" from 0 to 100 do {
								_newpos = [_pos,0,_radmen,0.5,1,20,0] call BIS_fnc_findSafePos;
								if ((_pos distance _newpos) < (_radmen + 1)) exitWith {_pos = _newpos;};
							};
								_bGroup=[_pos,_bSize,_faction,_side] call EOS_spawnPatrol;
									0 = [_bGroup,_r] call EOS_Patrol;
									_bGrp=_bGrp+[_bGroup];sleep 0.1;
						if (_debug) then {PLAYER SIDECHAT "Spawning patrol";0= [_mkr,_n,"patrol",getpos (leader _bGroup)] call EOS_debug};
											};
	};	

//SPAWN LIGHT VEHICLES
_cGrp=[];
	while {(count _cGrp) < _cGrps} do 
	{		
			_pos = [_mPos, _r, random 360] call BIS_fnc_relPos;
			for "_counter" from 0 to 100 do {
				_newpos = [_pos,0,_radveh,5,1,20,0] call BIS_fnc_findSafePos;
				if ((_pos distance _newpos) < (_radveh + 1)) exitWith {_pos = _newpos;};
			};
				_cGroup=[_pos,_bSize,_faction,_side] call EOS_LightVeh;			
				_cGrp=_cGrp+[_cGroup];				
					0 = [(_cGroup select 2),_r] call EOS_Patrol;
					sleep 0.1;
			if (_debug) then {player sidechat format ["Light Vehicle:%1 - r%2",(count _cGrp),_cGrps];0= [_mkr,(count _cGrp),"Light Veh",(getpos leader (_cGroup select 2))] call EOS_debug};
	};			
//SPAWN ARMOURED VEHICLES
_dGrp=[];
	while {(count _dGrp) < _dGrps} do 
	{
		_pos = [_mPos, _r, random 360] call BIS_fnc_relPos;
		for "_counter" from 0 to 100 do {
			_newpos = [_pos,0,_radveh,5,1,20,0] call BIS_fnc_findSafePos;
			if ((_pos distance _newpos) < (_radveh + 1)) exitWith {_pos = _newpos;};
		};
			if (surfaceiswater _mPos) exitwith {};
				_dGroup=[_pos,_bSize,_faction,_side] call EOS_Armour;
				0 = [(_dGroup select 2),_r] call EOS_Patrol;
				_dGrp=_dGrp+[_dGroup];sleep 0.1;
					if (_debug) then {player sidechat format ["Armoured:%1 - r%2",(count _dGrp),_dGrps];0= [_mkr,(count _dGrp),"Armour",(getpos leader (_dGroup select 2))] call EOS_debug};
	};				
//SPAWN STATIC PLACEMENTS
_eGrp=[];
	while {(count _eGrp) < _eGrps} do 
	{	
	if (surfaceiswater _mPos) exitwith {};
		_pos = [_mPos, _r, random 360] call BIS_fnc_relPos;
		for "_counter" from 0 to 100 do {
			_newpos = [_pos,0,_radmen,3,1,20,0] call BIS_fnc_findSafePos;
			if ((_pos distance _newpos) < (_radmen + 1)) exitWith {_pos = _newpos;};
		};
			_eGroup=[_pos,_bSize,_faction,_side] call EOS_spawnStatic;
				_eGrp=_eGrp+[_eGroup];sleep 0.1;
						if (_debug) then {hint "Spawning static Vehicles";0= [_mkr,(count _eGrp),"Static",(getpos leader (_eGroup select 2))] call EOS_debug};
	};	

in "EOS/EOS/SpawnUnits/" "Spawn_Infantry.sqf" i changed the parameter for unit radius to 4 to space the placement a bit out.

_unit = _grp createUnit [_unitType, _pos, [], 4, "FORM"];

in "EOS/EOS/SpawnUnits/" "Spawn_Vehicle.sqf" and "Spawn_Armour.sqf" you could add the afore mentioned "for construct" so the vehicles dont spawn on each other.

Thats my findings so far.

To close i have to say great work and i like to see the finished build!

greetings Na_Palm

Share this post


Link to post
Share on other sites

Hey BangaBob,

I love your script man! nice work! I am running a dedi server and using this for the mission. I am however getting a problem. When the mission first starts all the markers are red. I then go to lobby and come back in and then they are black. They still spawn AI but they only turn red when I actually set foot into the spawn radius. Same thing occurs when I switch teams. Any thoughts? I have been trying to look everywhere in the file but I cannot find where the mess up is.

Thanks!

Share this post


Link to post
Share on other sites

Great script, it may already be possible or maybe an idea for the future but I'd like to be able to spawn civilians and ambient life. There is a great ambient civilian mod already available but its designed for SP. Keep up the great work.

Share this post


Link to post
Share on other sites
Great script, it may already be possible or maybe an idea for the future but I'd like to be able to spawn civilians and ambient life. There is a great ambient civilian mod already available but its designed for SP. Keep up the great work.

CIVILIAN case 3!Its already in there on 1.9...the code is 3 and CIVILIAN.

Share this post


Link to post
Share on other sites
Hey BangaBob,

I love your script man! nice work! I am running a dedi server and using this for the mission. I am however getting a problem. When the mission first starts all the markers are red. I then go to lobby and come back in and then they are black. They still spawn AI but they only turn red when I actually set foot into the spawn radius. Same thing occurs when I switch teams. Any thoughts? I have been trying to look everywhere in the file but I cannot find where the mess up is.

Thanks!

Have you added the server game logic

Share this post


Link to post
Share on other sites

I must be doing something wrong, because I can't seem to be getting v1.9 to do what I want. I placed a game logic called "server" (no quotes in-game) and I was able to make this script function in the previous version.

I placed a 30x50 rectangle marker called "barracks" (no quotes in-game) and have the following set up in OpenMe.sqf:

null = [["barracks"],[3,2],[0,0],[0,0],[0,0],[0,0,0],[0,0,250,EAST]] call EOS_Spawn;

The zone appears to work, but no units spawn and the area just turns green when I enter. Also, I'd like to make it Independent troops, but the ReadMe didn't include which numbers corresponded to which faction. I thought me fiddling with the number to match INDEPENDENT was making it break, so I switched to 'factory default' but to no avail.

I thought maybe the buildings I was trying to occupy weren't functional, so I moved it to another location and still had the same result. The two buildings I'm trying to occupy are a pair of Barracks (Old) at grid 207072 on Altis.

What am I missing?

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

×