Jump to content
bangabob

Enemy occupation system (eos)

Recommended Posts

And what about this Bangabob ? what do you think ?

Its a logical and good idea. However, adding new features isn't my current focus. I want to get the current ones working well before expanding EOS again.

Share this post


Link to post
Share on other sites

AFAIK bis_fnc_findesafePos returns the middle of the map if no suitable location is found. Maybe increase the radius and repeat if the returned position is too far away (middle of map)?

Share this post


Link to post
Share on other sites

Hello.

Thank you for the script.

Bug : House Patrol no spawn.

Correction :

file EOS\EOS\EOS_Core.sqf

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

replace by : _aGroup=[_pos,_aSize,_faction,_side] call EOS_spawnPatrol;

Share this post


Link to post
Share on other sites
Hello.

Thank you for the script.

Bug : House Patrol no spawn.

Correction :

file EOS\EOS\EOS_Core.sqf

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

replace by : _aGroup=[_pos,_aSize,_faction,_side] call EOS_spawnPatrol;

Excellent. Thanks for sharing. Download link updated with this fix

Share this post


Link to post
Share on other sites

Noticed in the dev branch that the patrols were only patrolling an area of about 20m.

Within EOS/Functions/shk_patrol.sqf

found this line, which i think is causing the problem.

_slack = _dst / 5.5;

if (_slack < 20) then {_slack = 20};

I changed it too

_slack = _dst / 5.5;

if (_slack < 50) then {_slack = 250};

and found much better results.

Anyone else having the same issue? Does this solve your problem too?

Share this post


Link to post
Share on other sites
Noticed in the dev branch that the patrols were only patrolling an area of about 20m.

Within EOS/Functions/shk_patrol.sqf

found this line, which i think is causing the problem.

_slack = _dst / 5.5;

if (_slack < 20) then {_slack = 20};

I changed it too

_slack = _dst / 5.5;

if (_slack < 50) then {_slack = 250};

and found much better results.

Anyone else having the same issue? Does this solve your problem too?

I didnt write SHK_patrol so im not sure what the slack means. I will try asking on his thread

Share this post


Link to post
Share on other sites
I didnt write SHK_patrol so im not sure what the slack means. I will try asking on his thread

I've used SHK_patrol in the past, and if i recall correctly, the script is called from an init/trigger etc.

"nul = [grpA,300] execVM "shk_patrol.sqf";"

"300" being the distance you would define, but how EOS works, this is not a definable variable it's fixed within shk_patrol.sqf.

"// Handle parameters

private ["_grp","_dst"];

_dst = 250;" //I've set mine to 250

IDk if any of that info helps or not.

Share this post


Link to post
Share on other sites

It seems that the BIS_fnc_findSafePos is quite picky about the positions and even with fairly large slack (max position search range), it still won't always find a suitable position. In that case, it defaults to some center position and if you use a small slack and/or the location is not favorable, the WP positions can all fail and the center is used, thus it seems that units only patrol tiny area.

I've now uploaded a new version, which doesn't bother trying to find safe positions as with decent completion radius, units should be able to reach their WPs even if they happen to be placed in a difficult location. I also put back in the debug marker code so everyone can easily see what's going on.

Share this post


Link to post
Share on other sites
It seems that the BIS_fnc_findSafePos is quite picky about the positions and even with fairly large slack (max position search range), it still won't always find a suitable position. In that case, it defaults to some center position and if you use a small slack and/or the location is not favorable, the WP positions can all fail and the center is used, thus it seems that units only patrol tiny area.

I've now uploaded a new version, which doesn't bother trying to find safe positions as with decent completion radius, units should be able to reach their WPs even if they happen to be placed in a difficult location. I also put back in the debug marker code so everyone can easily see what's going on.

SafePos function seems to be the cause of several issues. As far as i know there is no real alternative without making my own. :confused:

Thanks Shuko. You're scripts really simplify my life when it comes to EOS

Share this post


Link to post
Share on other sites

Hello.

New bug ^^

Spawn 3 group.

1 group : randon spawn in the marker ... it's OK

2 and 3 group : spawn center marker .... it's NO OK :/

The bug is caused by the variable _r in the file EOS\SpawnUnits\Spawn_Infantry.sqf

Explication :

Create Marker rectangle 100x100

file EOS\EOS\EOS_Core.sqf

...

ligne 16 : _r = _mkrX * 0.8; <<------ here _r return 80

...

...

test ligne 73 or 96 : hint format["_r = %1", _r]; <<------ here _r return 80

ligne 74 or 97 : _bGroup=[_pos,_bSize,_faction,_side] call EOS_spawnPatrol;

test ligne 75 or 98 : hint format["_r = %1", _r]; <<------ here _r return _r of the function EOS_spawnPatrol

file \EOS\SpawnUnits\Spawn_Infantry.sqf

...

ligne 13 : _r = floor(random _d);

Correction :

file \EOS\SpawnUnits\Spawn_Infantry.sqf

add _r in Private

private ["_r", "_side","_type","_unitType","_grp","_unit","_pool","_n","_grpMax","_grpMin","_grpSize","_debug","_pos","_faction"];

With this correction the shk_patrol.sqf works correctly :)

Edited by TittErS

Share this post


Link to post
Share on other sites

Hey Thanks for the tip on the getting marker color it works great now I just have to find out how I can use it to activate or create spawn points but thanks for your help.

On a different note.

As per my understanding HOUSE GROUP is house patrol. in 1.8 it works great but in 1.9 they dont go in the house in fact they dont do anything except stand in a line.

and about armor if i am using this script in a city area then any amount more than 1 in armored vehicles will result in blowing them up probably because they all spawn in the same area.

Great going and Thanks to TittErS for fixing the House no spawn bug fix.

Share this post


Link to post
Share on other sites
I didnt write SHK_patrol so im not sure what the slack means. I will try asking on his thread

It's seems that "_slack" is the maximum distance from the center position! So no need to set it at "250" :

=> if (_slack < 20) then {_slack = 20}; <=> it's just to have a maximum distance > or = 20 !!

I found something in the Shk_patrol.sqf :

_p = [_p, 0, _slack, 6, 0, 50 * (pi / 180), 0, [color="#FF0000"][b][][/b][/color]] call BIS_fnc_findSafePos;

:confused:

I will download now the fixed script to see within!

EDIT : finally i launched my game; and this is what ther's in function viewer! :

File: findSafePos.sqf

Author: Joris-Jan van 't Land

Description:

Function to retrieve and dynamic position in the world according to several parameters.

Parameter(s):

_this select 0: center position (Array)

Note: passing [] (empty Array), the world's safePositionAnchor entry will be used.

_this select 1: minimum distance from the center position (Number)

_this select 2: maximum distance from the center position (Number)

Note: passing -1, the world's safePositionRadius entry will be used.

_this select 3: minimum distance from the nearest object (Number)

_this select 4: water mode (Number)

0: cannot be in water

1: can either be in water or not

2: must be in water

_this select 5: maximum terrain gradient (average altitude difference in meters - Number)

_this select 6: shore mode (Number):

0: does not have to be at a shore

1: must be at a shore

_this select 7: (optional) blacklist (Array of Arrays):

(_this select 7) select X: Top-left and bottom-right coordinates of blacklisted area (Array)

_this select 8: (optional) default positions (Array of Arrays):

(_this select 8) select 0: default position on land (Array)

(_this select 8) select 1: default position on water (Array)

Note : if you wanted to have a maximum terrain gradient <50°, you should put "sin 50" = 0,76604444311897803520239265055542 (because it seems to be in meters!)

In the script, the returned value is = 0,87266462599716478846184538424431 !!

Edited by chal00

Share this post


Link to post
Share on other sites

Is it possible to disable a near by zone IF the zone is captured? Similar to:

"If zone1 captured then disable zone2, zone3."

EDIT: It seams that if you using a helo when entering a AO all troops seams to spawn at the center of the marker.

EDIT2: Dose the distance value also count as spawn aria?

Edited by Cold Evil

Share this post


Link to post
Share on other sites

HI ;)

I wanted to tell you what i put in the script!

In EOS\EOS\EOS_core.sqf, line 76 :

0=[_mPos,units _aGroup,_r,0,[],false] call callHouseScript;

and line 98 :

0=[_bGroup, _pos, _r, 7, "MOVE", "AWARE", "YELLOW", "NORMAL", "STAG COLUMN", "", [8,12,16]] call CBA_fnc_taskPatrol;

In EOS\EOS_UnitPools.sqf :

// EAST CSAT FACTION
_InfPool=	["O_SoldierU_SL_F","O_soldierU_repair_F","O_soldierU_medic_F","O_sniper_F","O_Soldier_A_F","O_Soldier_AA_F","O_Soldier_AAA_F","O_Soldier_AAR_F","O_Soldier_AAT_F","O_Soldier_AR_F","O_Soldier_AT_F","O_soldier_exp_F","O_Soldier_F","O_engineer_F","O_engineer_U_F","O_medic_F","O_recon_exp_F","O_recon_F","O_recon_JTAC_F","O_recon_LAT_F","O_recon_M_F","O_recon_medic_F","O_recon_TL_F"];	
_ArmPool=	["O_APC_Tracked_02_cannon_F","O_APC_Wheeled_02_rcws_F","O_MBT_02_cannon_F"];
_MotPool=	["O_MRAP_02_gmg_F","O_MRAP_02_hmg_F"];

I didn't test everything, but until now, everything seems to be OK :bounce3:

Just House patrol, having sometimes troubles, but ...

Share this post


Link to post
Share on other sites

Version 1.8 worked fine, however 1.9 appears to be having some issues with House Patrol. At first the house patrols weren't spawning at all, until I found this fix:

Hello.

Thank you for the script.

Bug : House Patrol no spawn.

Correction :

file EOS\EOS\EOS_Core.sqf

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

replace by : _aGroup=[_pos,_aSize,_faction,_side] call EOS_spawnPatrol;

The house patrols are now spawning, but they're not spawning/occupying the houses as they used to. Instead the just walk around outside the houses.

Anyone else having these issues?

Share this post


Link to post
Share on other sites

Hi guys

Has a solution been found yet to the vehicles all spawning and exploding in the centre of the zone and the soldiers not really patrolling?

I've been reading all the discussion but can't see anyone definetively fixing it yet. No problem if that's the case but really want to use this and at the moment it is a little bit broken :)

Share this post


Link to post
Share on other sites
Hi guys

Has a solution been found yet to the vehicles all spawning and exploding in the centre of the zone and the soldiers not really patrolling?

I've been reading all the discussion but can't see anyone definetively fixing it yet. No problem if that's the case but really want to use this and at the moment it is a little bit broken :)

No solution yet. Need a function that finds safe positions properly. Plus im too busy right now to spend time fixing the problem. Id recommend using several smaller markers instead of one large marker

Share this post


Link to post
Share on other sites
No solution yet. Need a function that finds safe positions properly. Plus im too busy right now to spend time fixing the problem. Id recommend using several smaller markers instead of one large marker

_newPos = _pos findEmptyPosition [0,_maxDistance,typeof _vehicle];
if (count _newPos > 0) then { _pos = _newPos };

Share this post


Link to post
Share on other sites
No solution yet. Need a function that finds safe positions properly. Plus im too busy right now to spend time fixing the problem. Id recommend using several smaller markers instead of one large marker

Okay, I'll temporarily redesign the map to use another system for now.

No rush though sir, real life takes precident.

Regards

ToM

Share this post


Link to post
Share on other sites
No solution yet. Need a function that finds safe positions properly. Plus im too busy right now to spend time fixing the problem. Id recommend using several smaller markers instead of one large marker

I think it's not the housepatrol script, because in the v1.8, everything was good! then perhaps we should shearch in variables included in housepatrol array!!..

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;

Edited by TittErS

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;

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

Share this post


Link to post
Share on other sites

The spawn infantry and spawn vehicle changes appear to have worked a treat and they are indeed patrolling now and appear to be spawn properly with no explosions.

Not sure what I'm supposed to do with the other group changes. I can't even find where that script is LOL

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;

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

Share this post


Link to post
Share on other sites

I love how helpful the arma community can be! Also thanks for this wonderful script BangaBob, i love making sandbox missions for my friends using this!

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

×