Jump to content
bangabob

Enemy occupation system (eos)

Recommended Posts

Cheers for this mate, I got it working with help and code customization by/from SPUn!

@BangaBob - Is that the only way to do it or?

Dirty Haz

Yeah. Feel free to adapt the script with more squads but good luck. I've tried that route and things get very weird

Share this post


Link to post
Share on other sites

ill see if I can change it to get it to work with arma 2 this weekend. :D

Share this post


Link to post
Share on other sites
ill see if I can change it to get it to work with arma 2 this weekend. :D

Awesome. If you get it working please share your configs. It will be very useful

Share this post


Link to post
Share on other sites
ill see if I can change it to get it to work with arma 2 this weekend.

Wouldn't this be a matter of changing the classnames for the units in the script, or is there coding specific to Arma3 that

would prevent this script from working for Arma2CO?

Share this post


Link to post
Share on other sites

Yould need to change

_eastHeavyInfantry = ["OIA_InfSquad_Weapons","OIA_InfTeam","OIA_InfTeam_AT"];		
_eastHouseInfantry = ["OIA_InfTeam","OIA_InfTeam_AT"];
_eastMotorisedInfantry = ["O_Ifrit_GMG_F","O_Ifrit_MG_F"]; 

and

	case 0:
{
if (_debugHint) then {Hint "EAST AI selected";};
_heavyInfantry = _eastHeavyInfantry;
_houseInfantry = _eastHouseInfantry;
_motorisedInfantry = _eastMotorisedInfantry; 
_grpType = "OPF_F";
_sideAdjust = East;
_GrpClass = "infantry";
_heavyGrpClass = "infantry";
_aiSide = "EAST"; 
_detectionSide = "WEST";
_eastTanks = "";
}; 

To ARMA 2 commands

so

_grpType = "OPF_F"; 

would be

_grpType = "RU"; 

Share this post


Link to post
Share on other sites

Is it possible to have (best way to describe it sorry) hooks into units that spawn? For instance once the group has spawned from a particular marker is there a way to use a trigger to essentially hook that unit so I can control things like giving them way points and changing their behavior? I was avoiding asking if you could add additional parameters for these things if there was a way for me to do it externally.

Something like what this thread is talking about: http://forums.bistudio.com/showthread.php?152935-Naming-a-group-created-in-a-script-when-you-call-the-script

Edited by JMOxx75

Share this post


Link to post
Share on other sites

how would i set this up to spawn more random group sizes. it seams that the script only spawns 4 guys per square provided you disable reinforcements, vehicles and extra squads. when i added in extra squads they kept spawning and spawning. might have been due to my revive script however, more random group sizes would be nice.

Share this post


Link to post
Share on other sites
Is it possible to have (best way to describe it sorry) hooks into units that spawn? For instance once the group has spawned from a particular marker is there a way to use a trigger to essentially hook that unit so I can control things like giving them way points and changing their behavior? I was avoiding asking if you could add additional parameters for these things if there was a way for me to do it externally.

Something like what this thread is talking about: http://forums.bistudio.com/showthread.php?152935-Naming-a-group-created-in-a-script-when-you-call-the-script

I dont think thats possible. All the group name are private to each marker and i can forsee many problems when trying to 'hook' them

---------- Post added at 14:36 ---------- Previous post was at 14:34 ----------

how would i set this up to spawn more random group sizes. it seams that the script only spawns 4 guys per square provided you disable reinforcements, vehicles and extra squads. when i added in extra squads they kept spawning and spawning. might have been due to my revive script however, more random group sizes would be nice.

You can add more group types to the pools at the top of the script. This will spawn different sized groups. But individually creating units will require a new perspective on the script.

Share this post


Link to post
Share on other sites

I am trying to use this in my mission but am having a problem with it, the marker does not change to green after I kill all the enemy in the zone???

Dirty Haz

Share this post


Link to post
Share on other sites
I am trying to use this in my mission but am having a problem with it, the marker does not change to green after I kill all the enemy in the zone???

Dirty Haz

Any more details?

Share this post


Link to post
Share on other sites

@TheDog88: The 3. Param in the bis_fnc_spawngroup function determines the amount/type of units which are spawned.

http://community.bistudio.com/wiki/BIS_fnc_spawnGroup

So in order to randomise the amount a bit more you'd have to do something like:

_num = random 20; // max amount per group

[getPos aPos, EAST, _num,[],[],[0.25,0.35],[],[],180] call BIS_fnc_spawnGroup; // change 1. param to your desired position


Cheers.

Share this post


Link to post
Share on other sites

I am sorry if I misunderstood something, but how do you limit the area in which the spawned AI operates ?

Thanks. :)

Share this post


Link to post
Share on other sites

Requesting help getting this script to work on dedicated servers! Thanks in advance

Share this post


Link to post
Share on other sites

Banga it appears to be an issue with your Occupation mission and not the EOS script. I can run EOS just fine on my dedicated server.

Share this post


Link to post
Share on other sites
Requesting help getting this script to work on dedicated servers! Thanks in advance

Solved. BangaBob will be releasing the new ver soon...

Dirty Haz

Share this post


Link to post
Share on other sites

Confirmed works on dedicated servers! Thanks

Share this post


Link to post
Share on other sites

Hey,

I'm having some problems with the script.

this is how i call it.

if (IsServer) then {



_grids = [];
_counter = 1;
_amount = 157;

while {_counter < _amount + 1} do {

Call compile format ['

_grids set [_counter, "ins_%1"];', _counter];

_counter = _counter + 1;

};

if (!isMultiplayer) then {
hint "#1 worked";};

//choose random spots



_counter = 1;
_amount = 85;
_InsAreas = [];

while {_counter < _amount + 1} do {

_pick = [_grids call BIS_fnc_selectRandom];

_grids = _grids - _pick;

_InsAreas = _InsAreas + _pick;

_counter = _counter + 1;

};

    if (!isMultiplayer) then {
    hint "#2 worked";
    _test = count _InsAreas;
    hint format ["%1 Areas", _test];
   };


_amount = count _grids;
_counter = 0;

while {_counter < _amount + 1} do {

_mark = _grids select _counter;
_mark setMarkerAlpha 0;
_counter = _counter + 1;
};

if (!isMultiplayer) then {
hint "#3 worked";};

_amount = count _InsAreas;
_counter = 0;

while {_counter < _amount + 1} do {

_mark = _InsAreas select _counter;


Null = [_mark,True,False,350,true,0,true] execVM "EOS.sqf";
_counter = _counter + 1;
};













};













This way it returns an Error in line 113

saying:

_spotfriendlies = [u]#[/u]createTrigger [........];
Error: 0 Elements provided, 3 expected.

I know that the Script doesn't find the markerpos, i just dont know why however.

Ive tried putting _mark into quotation marks (just to make sure) "" but while that didnt cause an error it still retursn [0,0,0] as postion.

EDIT: Alright, solved it ^^

The {_counter < _amount + 1}

was the problem. Sorry for bothering, should've known.

cheers

Edited by mantls

Share this post


Link to post
Share on other sites

Hey BangaBob, great script.

I am using this in conjunction with SHK_pos to get a random number of markers to give a bit of dyanmic range to the mission.

My question is regarding using SHK_buildingpos in your script. The range is 50m (this is fine- I know I can extend if I want to)

Hhow do I make the units patrol if they don't find a building within range?

I don't like them just standing there 'waiting to be shot'

thanks.

Share this post


Link to post
Share on other sites
Hey BangaBob, great script.

I am using this in conjunction with SHK_pos to get a random number of markers to give a bit of dyanmic range to the mission.

My question is regarding using SHK_buildingpos in your script. The range is 50m (this is fine- I know I can extend if I want to)

Hhow do I make the units patrol if they don't find a building within range?

I don't like them just standing there 'waiting to be shot'

thanks.

That would be something to do with SHK_buildingpos script. Maybe edit that to get units which can't be placed anywhere to default into a patrol.

Share this post


Link to post
Share on other sites

is there a way to stop the the enemy spawn if a helo fly over the zones thanks as I found it activite all the zones when there fly over them, I would like the zones to be active by bluefor infantry only ,thanks in advances

Edited by Lightninguk

Share this post


Link to post
Share on other sites
is there a way to stop the the enemy spawn if a helo fly over the zones thanks as I found it activite all the zones when there fly over them, I would like the zones to be active by bluefor infantry only ,thanks in advances

Yeah, you have to add a height check in all the triggers. Although why don't you want a helicopter to spawn the zones

Share this post


Link to post
Share on other sites

it just a missions I am working so how would I make that height check work in the triggers

Share this post


Link to post
Share on other sites

Find _spotFriendlies trigger. Replace

_spotFriendlies setTriggerStatements ["this","",""];

with

_spotFriendlies setTriggerStatements ["this && {((getPosATL _x) select 2) < 5} count thislist > 0 ","",""];

Share this post


Link to post
Share on other sites

Is it just me, or is the skill of 'spawned' AI a lot higher than what we've set at as in the options. Spawned Enemy AI will have close to 90% accuracy, whereas enemy that is placed manually within the editor will have a noticeably lower accuracy level. I've noticed this not only with EOS, but with the any other script that spawns AI (including the 'site' modules within the editor).

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

×