Jump to content
bangabob

Enemy occupation system (eos)

Recommended Posts

Make sure each marker has their own parameters. For example:

WRONG

null = [["mkr1","mkr2","mkr3"],[5,1,100],[2,2,100],[1,3,20],[2,30],[2,20],[1,2,30],[2,0,500,INDEPENDENT,FALSE]] call EOS_Spawn;

CORRECT

null = [["mkr1"],[5,1,100],[2,2,100],[1,3,20],[2,30],[2,20],[1,2,30],[2,0,500,INDEPENDENT,FALSE]] call EOS_Spawn;

null = [["mkr2"],[5,1,100],[2,2,100],[1,3,20],[2,30],[2,20],[1,2,30],[2,0,500,INDEPENDENT,FALSE]] call EOS_Spawn;

null = [["mkr3"],[5,1,100],[2,2,100],[1,3,20],[2,30],[2,20],[1,2,30],[2,0,500,INDEPENDENT,FALSE]] call EOS_Spawn;

Share this post


Link to post
Share on other sites

Thank you! However , it did not work , I created the same mission in editor from scratch, saved the mission in single player. unfortunately it did the same thing , I killed around 550 AI, captured around 28 EOS zones and the Ai does not spawn any more in other zones , all that spawns is empty vehicles.

Its got to be some kind of limit in EOS scripting , unfortunately I was unable to identify the problem , I searched the EOS script for hours and I could not find anything to help me . its been literary a decade since I had anything to do with scripting and modding , I use to work with Operation flash point lol , so my skills are rusty.

I definitely need some help, I would appreciate any help I can get!

Edited by Beqanyc

Share this post


Link to post
Share on other sites

geez dude, thank you. this will help me a lot. i'll give it a shot in a bit here and get back to you. thank you again!

Share this post


Link to post
Share on other sites
Thank you! However , it did not work , I created the same mission in editor from scratch, saved the mission in single player. unfortunately it did the same thing , I killed around 550 AI, captured around 28 EOS zones and the Ai does not spawn any more in other zones , all that spawns is empty vehicles.

Its got to be some kind of limit in EOS scripting , unfortunately I was unable to identify the problem , I searched the EOS script for hours and I could not find anything to help me . its been literary a decade since I had anything to do with scripting and modding , I use to work with Operation flash point lol , so my skills are rusty.

I definitely need some help, I would appreciate any help I can get!

Sounds like the 144 groups limit had been breached, preventing spawning of any more units for that side.

Spawn a thread like this on the machine that the AI are being created on:

if (!isServer) exitWith {};
[] spawn {
BEQ_groupsPurge = TRUE;
while {BEQ_groupsPurge} do {
	diag_log format ['All Groups Count: %1',count allGroups];
	{
		if ((count (units _x)) isEqualTo 0) then {
			diag_log format ['Deleting group: %1',_x];
			deleteGroup _x;
		};
	} count allGroups;
	sleep 60;
};
};

Will go through and prune empty groups.

Often I had encountered this issue last year as a server admin where my curators (Zeus-equipped players) were spawning too many AI (and thus too many groups). The result was that the scripted objectives had no enemy because there weren't any available groups. The solution was a small meeting where I let them know the issue and to utilize less groups, and also tweaking the frequency of the empty groups deleter in the cleanup script to account for more enemy/groups being spawned due to Curator/Zeus activities.

Share this post


Link to post
Share on other sites
Sounds like the 144 groups limit had been breached, preventing spawning of any more units for that side.

Spawn a thread like this on the machine that the AI are being created on:

if (!isServer) exitWith {};
[] spawn {
BEQ_groupsPurge = TRUE;
while {BEQ_groupsPurge} do {
	diag_log format ['All Groups Count: %1',count allGroups];
	{
		if ((count (units _x)) isEqualTo 0) then {
			diag_log format ['Deleting group: %1',_x];
			deleteGroup _x;
		};
	} count allGroups;
	sleep 60;
};
};

Will go through and prune empty groups.

Often I had encountered this issue last year as a server admin where my curators (Zeus-equipped players) were spawning too many AI (and thus too many groups). The result was that the scripted objectives had no enemy because there weren't any available groups. The solution was a small meeting where I let them know the issue and to utilize less groups, and also tweaking the frequency of the empty groups deleter in the cleanup script to account for more enemy/groups being spawned due to Curator/Zeus activities.

MDCCLXXVI , Thank you very much!! , I will give it a try and post the result, it my take me 2-3 days to test it though, because of my university and work schedule. So do you know if this 144 group limit is EOS script or Game itself? and I'm putting the code you provided in an INIT file of my mission right?

Share this post


Link to post
Share on other sites
Yes put it in your server initialisation file

MDCCLXXVI , I just tested it , Everything worked perfectly, apparently I only need 10 minutes lol . You have no idea how many hours Iv spend searching information on this problem, I did not know that arma 3 was restricting 144 groups per side. Thanks again!!

Share this post


Link to post
Share on other sites
Make sure each marker has their own parameters. For example:

WRONG

null = [["mkr1","mkr2","mkr3"],[5,1,100],[2,2,100],[1,3,20],[2,30],[2,20],[1,2,30],[2,0,500,INDEPENDENT,FALSE]] call EOS_Spawn;

CORRECT

null = [["mkr1"],[5,1,100],[2,2,100],[1,3,20],[2,30],[2,20],[1,2,30],[2,0,500,INDEPENDENT,FALSE]] call EOS_Spawn;

null = [["mkr2"],[5,1,100],[2,2,100],[1,3,20],[2,30],[2,20],[1,2,30],[2,0,500,INDEPENDENT,FALSE]] call EOS_Spawn;

null = [["mkr3"],[5,1,100],[2,2,100],[1,3,20],[2,30],[2,20],[1,2,30],[2,0,500,INDEPENDENT,FALSE]] call EOS_Spawn;

in the default OpenMe.sqf in the EOS files, the examples listed include this:

EXAMPLE CALL - EOS
null = [["MARKERNAME","MARKERNAME2"],[2,1,70],[0,1],[1,2,30],[2,60],[2],[1,0,10],[1,0,250,WEST]] call EOS_Spawn;

which is incorrect, according to your post that i quoted?

Share this post


Link to post
Share on other sites

It is an incorrect example, at least when using more than a few markers. I tried using it with over 60 markers back when I first started using EOS and it started to have issues spawning units or activating at all after about 27 or so markers, if I remember correctly.

Besides, my "correct" way of doing it allows you to customize the amount of units that spawn in each marker more uniquely, as well as the percentage chances. So far in my insurgency mission on Altis, I have almost 300 markers using it my way and it works fine as intended.

Share this post


Link to post
Share on other sites
It is an incorrect example, at least when using more than a few markers. I tried using it with over 60 markers back when I first started using EOS and it started to have issues spawning units or activating at all after about 27 or so markers, if I remember correctly.

Besides, my "correct" way of doing it allows you to customize the amount of units that spawn in each marker more uniquely, as well as the percentage chances. So far in my insurgency mission on Altis, I have almost 300 markers using it my way and it works fine as intended.

cool stuff. just wanted to clarify that, as im starting to understand all of this a bit better -- mainly thanks to you mate!

Share this post


Link to post
Share on other sites

im seeming to have the same issue.

as an example, im just trying to work out if this will work in the zones near Gravia.

OpenMe.sqf:

// GRAVIA
// light square: 2x House (2,4)
null = [["EOS_Gravia_1","EOS_Gravia_3","EOS_Gravia_4"],[2,1,90],[2,1,90],[0],[0],[0],[0],[5,0,500,EAST,FALSE]] call EOS_Spawn;
// square 2 is heavy. house group + patrol group
null = [["EOS_Gravia_2"],[1,1,90],[1,1,90],[0,0,],[0],[0],[0],[5,0,500,EAST,FALSE]] call EOS_Spawn;

UnitPools.sqf:

private ["_tempArray","_InfPool","_MotPool","_ACHPool","_CHPool","_uavPool","_stPool","_shipPool","_diverPool","_crewPool","_heliCrew","_ArmPool"];
_faction=(_this select 5);
_type=(_this select 0);
_tempArray=[];

later on down the code, in the first ADD CLASSNAMES chunk:

// EAST INSURGENT FACTION
if (_faction==5) then {
_InfPool=	["CAF_AG_ME_T_AK47","CAF_AG_ME_T_AK74","CAF_AG_ME_T_GL","CAF_AG_ME_T_PKM","CAF_AG_ME_T_RPG","CAF_AG_ME_T_RPK74","CAF_AG_ME_T_SVD"];	
_ArmPool=	[];
_MotPool=	["CAF_AG_ME_T_Offroad","CAF_AG_ME_T_Offroad_armed_01","CAF_AG_ME_T_van_01"];
_ACHPool=	[];
_CHPool=	[];
_uavPool=	[];
_stPool=	[];
_shipPool=	[];
_diverPool= [];
_crewPool=	[];
_heliCrew=	[];

};

And I get nothing spawning in Gravia.

Now, also, how is

_type

used, exactly? It seems that further down in UnitPools.sqf there's some code about what _type can be set to, but it's confusing me.

if (_type==0) then {
	for "_i" from 0 to 5 do{
	_unit=_InfPool select (floor(random(count _InfPool)));
	_tempArray set [count _tempArray,_unit];};
					};

if (_type==1) then {_tempArray=_diverPool};

If i'm reading that correctly, does _type==0 mean that InfPools will be spawned? Because at the very top, where you declare your faction, there's a _type right underneath it.

_faction=(_this select 5);
_type=(_this select 0);
_tempArray=[];

I don't really understand what i'm doing wrong. Or if there's something im missing.

Share this post


Link to post
Share on other sites

Noticed this issue with the arrays right away. I used to make this mistake too, but fixed it by doing this:

WRONG

null = [["EOS_Gravia_1","EOS_Gravia_3","EOS_Gravia_4"],[2,1,90],[2,1,90],[0],[0],[0],[0],[5,0,500,EAST,FALSE]] call EOS_Spawn;

CORRECT

null = [["EOS_Gravia_1","EOS_Gravia_3","EOS_Gravia_4"],[2,1,90],[2,1,90],[0,0,0],[0,0],[0,0],[0,0,0],[5,0,500,EAST,FALSE]] call EOS_Spawn;

Your problem is that you did not include the full arrays in your line. Even if you don't want tanks to spawn, for example, you need to set the amount and chance to spawn both to [0,0] rather than just [0]. If it's an array that also wants size, such as patrols or light vehicles, you'd put [0,0,0] instead of [0]. Hope that makes sense.

I also wouldn't recommend having your markers all be called from the same array/line and more like the way I had shown before, but if it works for you, no problem.

Share this post


Link to post
Share on other sites
Noticed this issue with the arrays right away. I used to make this mistake too, but fixed it by doing this:

WRONG

null = [["EOS_Gravia_1","EOS_Gravia_3","EOS_Gravia_4"],[2,1,90],[2,1,90],[0],[0],[0],[0],[5,0,500,EAST,FALSE]] call EOS_Spawn;

CORRECT

null = [["EOS_Gravia_1","EOS_Gravia_3","EOS_Gravia_4"],[2,1,90],[2,1,90],[0,0,0],[0,0],[0,0],[0,0,0],[5,0,500,EAST,FALSE]] call EOS_Spawn;

Your problem is that you did not include the full arrays in your line. Even if you don't want tanks to spawn, for example, you need to set the amount and chance to spawn both to [0,0] rather than just [0]. If it's an array that also wants size, such as patrols or light vehicles, you'd put [0,0,0] instead of [0]. Hope that makes sense.

I also wouldn't recommend having your markers all be called from the same array/line and more like the way I had shown before, but if it works for you, no problem.

oh! alright. I'll give that a shot.

and i plan on moving my markers to their own arrays -- just wanted to make some progress on this first, figuring it wasn't causing too much issue. i'll get to that today.

and i probably would have just a few tanks spawn, in some rare instances, if the CAF Aggressors pack had any i could spawn for the faction im trying to use.

Edited by ironxbay
note about CAF aggressors faction without armor

Share this post


Link to post
Share on other sites

As an additional tidbit of information that was never provided in EOS, if you set the helicopter array parameters to [1,0,100] (as an example), that would have a 100% chance to spawn an Attack Helicopter -- not a Transport Helicopter. The "0" represents the size of the group the helicopter will be transporting. At most, that number should be "3", which would spawn a Transport Helicopter with a squad of 8 to 12 soldiers to be dropped off.

Hope that makes sense.

[EDIT]:

Also note that transport helicopters will spawn in and transport its troop cargo inside of the active marker it spawned for and then fly away. Attack helicopters without troop cargo will fly in and either patrol around the air or hover in place somewhere within the marker radius.

Share this post


Link to post
Share on other sites

im still not having any luck.

OpenMe.sqf

// GRAVIA
// light square: 2x House (2,4)
null = [["EOS_Gravia_1"],[2,1,90],[2,1,90],[0,0,0],[0,0],[0,0],[0,0,0],[5,0,500,EAST,FALSE]] call EOS_Spawn;
null = [["EOS_Gravia_3"],[2,1,90],[2,1,90],[0,0,0],[0,0],[0,0],[0,0,0],[5,0,500,EAST,FALSE]] call EOS_Spawn;
null = [["EOS_Gravia_4"],[2,1,90],[2,1,90],[0,0,0],[0,0],[0,0],[0,0,0],[5,0,500,EAST,FALSE]] call EOS_Spawn;
// square 2 is heavy. house group + patrol group
null = [["EOS_Gravia_2"],[2,1,90],[1,2,90],[1,1,90],[0,0,0],[0,0],[0,0],[5,0,500,EAST,FALSE]] call EOS_Spawn;

UnitPools.sqf

private ["_tempArray","_InfPool","_MotPool","_ACHPool","_CHPool","_uavPool","_stPool","_shipPool","_diverPool","_crewPool","_heliCrew","_ArmPool"];
_faction=(_this select 5);
_type=(_this select 1);
_tempArray=[];

...

};
// EAST INSURGENT FACTION
if (_faction==5) then {
_InfPool=	["CAF_AG_ME_T_AK47","CAF_AG_ME_T_AK74","CAF_AG_ME_T_GL","CAF_AG_ME_T_PKM","CAF_AG_ME_T_RPG","CAF_AG_ME_T_RPK74","CAF_AG_ME_T_SVD"];	
_ArmPool=	[];
_MotPool=	["CAF_AG_ME_T_Offroad","CAF_AG_ME_T_Offroad_armed_01","CAF_AG_ME_T_van_01"];
_ACHPool=	[];
_CHPool=	[];
_uavPool=	[];
_stPool=	[];
_shipPool=	[];
_diverPool=[];
_crewPool=	[];
_heliCrew=	[];

};

I filled in the areas in the code that should be filled with 0 even if they're not being used in any way. still nothing. no units spawning in. im beginning to wonder if i'm using the right classnames of the units, or if the CAF Aggressors factions add-on just doesn't want to work with this. i'm stumped. and frustrated.

Share this post


Link to post
Share on other sites

That last marker's helicopter array is missing an extra 0. Should be [0,0,0] instead of [0,0]. Also, something I just noticed even with my own EOS OpenMe.sqf is I forgot to add an additional false parameter to each array, because the two last parameters are HEIGHTLIMIT (If you want players in the air to activate markers also) and DEBUG. For example:

null = [["mkr0"],[2,1,100],[2,2,100],[1,3,30],[1,30],[1,30],[0,0,0],[2,0,500,INDEPENDENT,FALSE,[b]FALSE[/b]]] call EOS_Spawn; // 2315 2175

Aside from that, I'm not quite sure. Make sure your comments aren't in the same line as the code that you actually want to be executed. (Hard to tell how you space stuff since the php example up there is all on the same line)

It also helps if you use Notepad ++ with the SQF stuff for it.

Edited by Phronk

Share this post


Link to post
Share on other sites

Well Phronk, I appreciate all of your help so far. I'm thinking i'll just shelf this little project for now. I have higher prioritized stuff to work on for my mission, it's supposed to be an Insurgency game mode. and CSAT always spaws in correctly, but none of the addon factions i've tried do.

sigh.

Edit: someone mentioned that I should try using a different add-on faction. so i'll get on that.

Edited by ironxbay

Share this post


Link to post
Share on other sites

Are the markers red or black when the mission initializes? Maybe you didn't include it in the init.sqf properly?

Share this post


Link to post
Share on other sites
Are the markers red or black when the mission initializes? Maybe you didn't include it in the init.sqf properly?

i did run into the issue in the past with the markers spawning in black, but ive since fixed that. they start red now.

however, no units spawn inside of these markers -- and when i move my character inside them, they instantly turn green.

Share this post


Link to post
Share on other sites

Some other little things you can do that might help solve the issue. I'm not exactly sure what it is.

1. Create a game logic named "server" (without quotes) in your mission. This has solved some issues I've had with unrelated stuff in the past.

2. Make sure you didn't accidentally type any extra letters or symbols anywhere in the OpenMe.sqf or UnitPools.sqf. I once accidentally typed a letter at the top of the beginning of the script which messed it all up and didn't find it for like 20 minutes.

3. Make sure the CAF Aggressors mod is enabled, of course. Once you get in-game, at the Main Menu go to "Configure" and then "Expansions." If you don't see CAF Aggressors, there's your problem.

4. Make sure the EOS folder is located in the mission's directory. In other words, don't put the EOS folder inside of another folder in your mission. I don't think this is it though.

5. Try enabling the debug parameter in the last array for the marker. It should be the last parameter of the last array for that marker.

6. If all else fails, try to use a default faction instead. If it still doesn't work, something is messed up in one of the scripts. Probably a typo or accidental deletion of code, in that case.

PS: You should assign some CAF infantry units to the "crew" array in UnitPools.sqf. That will be used to assign drivers and such to spawned vehicles.

Edited by Phronk

Share this post


Link to post
Share on other sites
Some other little things you can do that might help solve the issue. I'm not exactly sure what it is.

1. Create a game logic named "server" (without quotes) in your mission. This has solved some issues I've had with unrelated stuff in the past.

2. Make sure you didn't accidentally type any extra letters or symbols anywhere in the OpenMe.sqf or UnitPools.sqf. I once accidentally typed a letter at the top of the beginning of the script which messed it all up and didn't find it for like 20 minutes.

3. Make sure the CAF Aggressors mod is enabled, of course. Once you get in-game, at the Main Menu go to "Configure" and then "Expansions." If you don't see CAF Aggressors, there's your problem.

4. Make sure the EOS folder is located in the mission's directory. In other words, don't put the EOS folder inside of another folder in your mission. I don't think this is it though.

5. Try enabling the debug parameter in the last array for the marker. It should be the last parameter of the last array for that marker.

6. If all else fails, try to use a default faction instead. If it still doesn't work, something is messed up in one of the scripts. Probably a typo or accidental deletion of code, in that case.

PS: You should assign some CAF infantry units to the "crew" array in UnitPools.sqf. That will be used to assign drivers and such to spawned vehicles.

#1 that's been on the mission for a while -- needed it for other things.

#2 checked -- no issues.

#3 CAF Aggressors is enabled; i can easily throw them down in Editor and fight them. Their equipment also shows up in Arsenal.

#4 EOS works, refer to #6

#5 Haven't tried this yet but I can if we really can't figure this out.

#6 -- CSAT always works. Always. So the script itself works -- it's simply the introduction of attempting to spawn a different faction where things have begun to just go haywire. I'll try these in a bit, i'm also juggling ASR_AI and our first Headless Client at the same time on very little sleep.

#7 -- hadn't done that yet. i'll give it a try before sending you the mission file.

Edited by ironxbay
wanted to fill out this whole list, sorry for just putting #6 down before.

Share this post


Link to post
Share on other sites

PM me the mission and I'll take a deeper look at it.

Share this post


Link to post
Share on other sites
PM me the mission and I'll take a deeper look at it.

im working on finishing the code clean up, and then i'll send you the mission with a link to the CAF Aggressors pack, because of all the OPFOR packs out there at the moment that's the one i'd really like to get to work.

---------- Post added at 14:41 ---------- Previous post was at 13:13 ----------

okay -- almost finished.

something that's confused me from the start is, when I have the faction set to 0 (CSAT) and the type set to 1, it works. CSAT spawns and its all good. (on a side note: I haven't tested using 0 as the faction, and simply typing in 0 for _type).

but, when i look further down the code in UnitPools.sqf, it says this:

if (_type==0) then {
	for "_i" from 0 to 5 do{
	_unit=_InfPool select (floor(random(count _InfPool)));
	_tempArray set [count _tempArray,_unit];};
					};

if (_type==1) then {_tempArray=_diverPool};

If im reading that right, i'm somehow declaring the types of units i want to spawn as divers?

But, when I boot it up with faction == 0, type == 1 (code shown below refers to the very top of the code in UnitPools.sqf)

private ["_tempArray","_InfPool","_MotPool","_ACHPool","_CHPool","_uavPool","_stPool","_shipPool","_diverPool","_crewPool","_heliCrew","_ArmPool"];
[color="#00FF00"]_faction=(_this select 0)[/color];
[color="#00FFFF"]_type=(_this select 1)[/color];
_tempArray=[];

The code simply spawns in CSAT units that make sense. Infantry, light vehicles, armor, etc.

I guess I don't understand how _type works in this code. At all.

Or, does _type refer to each one of the data sets within these brackets?

null=[["M1"],[HOUSE GROUPS,SIZE OF GROUPS,PROBABILITY],[PATROL GROUPS,SIZE OF GROUPS,PROBABILITY],[LIGHT VEHICLES,SIZE OF CARGO,PROBABILITY],[ARMOURED VEHICLES,PROBABILITY], [sTATIC VEHICLES,PROBABILITY],[HELICOPTERS,SIZE OF HELICOPTER CARGO,PROBABILITY],[FACTION,MARKERTYPE,DISTANCE,SIDE,HEIGHTLIMIT,DEBUG]] call EOS_Spawn;

Share this post


Link to post
Share on other sites
im working on finishing the code clean up, and then i'll send you the mission with a link to the CAF Aggressors pack, because of all the OPFOR packs out there at the moment that's the one i'd really like to get to work.

---------- Post added at 14:41 ---------- Previous post was at 13:13 ----------

okay -- almost finished.

something that's confused me from the start is, when I have the faction set to 0 (CSAT) and the type set to 1, it works. CSAT spawns and its all good. (on a side note: I haven't tested using 0 as the faction, and simply typing in 0 for _type).

but, when i look further down the code in UnitPools.sqf, it says this:

if (_type==0) then {
	for "_i" from 0 to 5 do{
	_unit=_InfPool select (floor(random(count _InfPool)));
	_tempArray set [count _tempArray,_unit];};
					};

if (_type==1) then {_tempArray=_diverPool};

If im reading that right, i'm somehow declaring the types of units i want to spawn as divers?

But, when I boot it up with faction == 0, type == 1 (code shown below refers to the very top of the code in UnitPools.sqf)

private ["_tempArray","_InfPool","_MotPool","_ACHPool","_CHPool","_uavPool","_stPool","_shipPool","_diverPool","_crewPool","_heliCrew","_ArmPool"];
[color="#00FF00"]_faction=(_this select 0)[/color];
[color="#00FFFF"]_type=(_this select 1)[/color];
_tempArray=[];

The code simply spawns in CSAT units that make sense. Infantry, light vehicles, armor, etc.

I guess I don't understand how _type works in this code. At all.

Or, does _type refer to each one of the data sets within these brackets?

null=[["M1"],[HOUSE GROUPS,SIZE OF GROUPS,PROBABILITY],[PATROL GROUPS,SIZE OF GROUPS,PROBABILITY],[LIGHT VEHICLES,SIZE OF CARGO,PROBABILITY],[ARMOURED VEHICLES,PROBABILITY], [sTATIC VEHICLES,PROBABILITY],[HELICOPTERS,SIZE OF HELICOPTER CARGO,PROBABILITY],[FACTION,MARKERTYPE,DISTANCE,SIDE,HEIGHTLIMIT,DEBUG]] call EOS_Spawn;

Type refers to the unit which is been selected. House groups, patrol groups, motorised groups, armoured groups, attach helicopter groups, transport helicopter groups.

Share this post


Link to post
Share on other sites
Type refers to the unit which is been selected. House groups, patrol groups, motorised groups, armoured groups, attach helicopter groups, transport helicopter groups.

yeah, after hitting myself in the head a few times i actually realized the obvious. lol

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

×