Jump to content

A3 Epoch Headless Clients : Walkthrough UPDATED:Dec 22nd


hogscraper

Recommended Posts

Updated Dec 22nd:
 
I have created a repo on Github with this code to make setting it up a little easier. The repo contains the bare essentials to
get this up and running but has a crippled AI system. When I put that in the code below, it was crap and was only
intended as a generic stand in so server admins would know how to get other AI mission systems up and running. What I overlooked
was the lack of any decent ones being out when I first posted this. To force the issue I went ahead and deleted most of what was in
the AI_Init code so it still spawns a few AI, but that's it. I want to take the focus in this thread from the AI aspect and stay with just the
HC stuff. This repo is still being put together, but it has what you need to reference so you can get your server up and running a little
easier.
 
 
Updated Dec 10th:
I added a section below on processor affinity and how to set this up with multiple instances of Arma.
thanks for the heads up axeman!
 
This isn't for the light of heart. If you feel confident in your ability to follow simple instructions, hopefully
this tutorial will help you out. If you get to a point and have to ask yourself, "well how do I do that?" you need
to use google. There are tons of tutorials out there on any instruction I give below and they are out of the scope
of this tutorial. I had a friend and fellow server admin run through this on a basic A3 and Epoch install on his
box and he was able to get it up and running no problems, (other than the BEFilters mentioned below).
 
SECTION 1: SETTING UP A HEADLESS CLIENT:
 
This has become so much easier lately as BI have recently included HC tech inside A3. It really is a much easier process
than it ever has been in the past. Because of this, I will be redirecting you to a tutorial they made to get you started.
You can use 127.0.0.1 wherever you find an ip address, (xxx.xxx.xxx.xxx on the tutorial page), if your sever is local to 
the headless client. The best part is, you no longer need another cd key for a headless client in A3.
Read this, and when you are done, I will fill in the blanks with what's relevant to Epoch:
 
At this point you will have an edited mission.sqm with a new unit called headlesshogs_01, (or whatever you called yours). I added a number
to my name so I have the option to create more than one at a later date if I need it. You can reference your headless
client later to add even more to it by referencing the name you gave it. In most cases, AI systems are built so you only 
need to fire and forget but its worth noting if you wish to take this concept further.
 
Create a new text file in your A3 base folder and rename it Headless_Client_01.bat
Inside that file paste this line:
 
arma3server.exe -client -connect=127.0.0.1 -mod="@epoch";
 
This bat file will create a new, dedicated client and connect it to your server, joining the first free headless client slot it can find.
If you use a master bat file to run your server you will want to have this code called after BEC has loaded. If you are running them
manually, the order is
Redis-(wait for load to complete)
server launch
BEC launch(waits on its own for server launch to complete before running)
HC launch(best to wait until BEC is completely loaded before running)
 
 
Processor Affinity:
 
I'm a Windows user so these instructions are valid for that system. Before you begin, you should have some
background knowledge about the processor you are running your server on. How many cores it has, which
cores if any are hyperthreading cores, etc. This information will help you determine which cores you want to 
run which processes so that you have a better idea on what to substitute for the generic values in this tutorial.
 
When you run multiple instances of any Arma product on the same box, its always best to assign each process
to a separate cpu core. This can help get ahead of bottlenecks when the server and the HC are both running code
at the same time. You can manually adjust these values through Task Manager but its much easier to just add the
information directly to your batch files. If you edit your batch file you only need to edit the beginning of the line:
 
start /AFFINITY # "arma3server.exe" ... the rest of your start parameters as they already are
 
The # above are the cpu cores you want to utilize but its a little tricky determining, as its a hex value of a binary number.
Your processors need to be arranged with the highest number first. So eight cores would be written down as
87654321
and four cores would be
4321
 
Once you have written the number of cores you have in that format you will need to create a binary number using
the cores you want to run on. If we wanted this process to use cores 8,6,4 and 2 we would utilize the binary like:
 
87654321
10101010
 
Just mark a 1 under any core number you want to use and a zero under any that you don't. This new binary number
needs to be converted into a hexadecimal value. A quick way to do that is open windows calculator. Click View and choose
 
Programmer
 
Click the radio button for Bin, (putting the calculator into binary mode), and enter the number you obtained above. After
you hit the last digit you can click the radio button for Hex and it will convert the number. So, for the above 10101010
we would get AA as the hex value to substitute for #:
 
start /AFFINITY AA arma3server.exe  ...  the rest of your start parameters as they already are
 
With the server assigned to the cores we wanted the headless client can be done the same way. If the HC only needs
to be run on core 3, 
87654321
00000100
 
You get a hex value of 4 and our HC batch line becomes:
 
start /AFFINITY 4 arma3server.exe  ...  the rest of your start parameters as they already are
 
You can verify that the OS is running the process on the correct cores by opening Task Manager, right click the process
in question and choose Set Affinity. The list it shows you has them ordered with cpu0, (first core) at the top and the list
descending to the last core.
 
Ensure you are using values that you determine are proper for you setup. On my test machine I run the server on 
4,3 and 2 and the HC on 1 but haven't noticed much difference whether I give each process one, two or three cpus.
This is part of the tutorial where you will need to look at what you have and figure out what's going to work best for
you.
 
Now we have a headless client that will connect to our server so we need to create an init.sqf to handle the HC.
Head into your MPMissions folder and find which mission you are calling from within your config.cfg. The default
is Epoch.Altis.pbo. You will need to depbo the file and it will create a folder called epoch.Altis with a mission.sqm
and a description.ext inside. If you edit the mission.sqm and it is code instead of plain text you depbo'd the file 
incorrectly. PBO manager will do this incorrectly so you need Mikero's tools to get a proper unpbo in many cases.
 
In your new mission folder, you need to create a file named init.sqf.
Inside that file place:
if !(hasInterface or isServer) then {

  HeadlessVariable = true;

  publicVariable "HeadlessVariable";

execVm "AI_Init.sqf";

};
 
"GlobalHint" addPublicVariableEventHandler
{
private ["_GHint"];
_GHint = _this select 1;
hint parseText format["%1", _GHint];
};
 
The called file above, (AI_Init.sqf), is whatever init file you use to get your AI started. At this point, your server will 
have a headless client that will run any AI scripts you would like. The added bit is so the headless client can
communicate with the players and let them know when a new AO spawns. The added benefit to this system
is that, if the headless client fails to connect, it will continue to retry and the AI system will spawn whenever it
finally joins the server. I didn't want the server to run the code as I have the HC for a lot more than one mission
so I set this up with the thought in mind that I wanted as much as possible to be removed from the server's 
overhead.
 
While following this section, you may get kicked when you connect as client. There are issues with Arma3 and how
it creates the current mp mission in your appdata folder so that if your headless client connects, the next client from that
same machine to connect may try to overwrite the current_mission.pbo. Since that will fail it will kick you back to 
the server select screen. All you have to do is reconnect. Once connected/disconnected it will assume you already downloaded the
mission and will no longer try to re-write the file, allowing your client to connect.
 
SECTION 2: GETTING AI TO SPAWN
 
UPDATE: From user Defent, it appears that the Vehicle_Simulation.FSM is deleting any vehicle, (AI included), that was not spawned
by a logged in client. That likely means that this code will not work running solely on the server. I have personally verified that
when I run this code exactly as written from a headless client it works fine, but when ran by the server it deletes the ai within seconds.
We will have to wait on a workaround from the Epoch devs that will allow us to move this code server side in order to do that. I will update
this again once we figure out what array or variables are protecting server spawned vehicles.
 
For this part, I've seen a lot of posts about people having issues with ai being deleted. I had trouble with this as well
until I changed a lot of the variables. Certain models will be deleted but I found that creating soldiers and removing their
uniform seems to allow them to stick around. I am creating a global array, placing all the ai into it and making that a 
public variable. I had originally did this because I was using modified epoch code in a separate pbo on the server but 
didn't feel it was appropriate to teach that route since the current restrictions say releasing that modified code is bad. I mention
this because I really do not know what affects the ai during cleanup exactly, but it seems to have multiple parts. Certain 
models I spawn seem to instantly disappear while others will stick around for a few seconds, fire their guns, then disappear.
Since I don't know what exactly fixed the issue I wanted to post the code I am using as it stands right now and maybe we can 
figure it out as a community. What I am posting works for me, on a private server, but I wanted some testing done.
 
I made all of the ai in a group from side RESISTANCE and made all of my triggers pick up side GUE. This mission will make an 
AO, somewhere on the map, create a red marker and let all players know. After the mission starts, if thirty minutes goes
by and there are still bandits in the AO, the AO ends with a hint saying they took off and the marker will turn yellow.
 120 seconds later another AO will picked randomly from the list and continue. If players hunt down the bandits and kill them
 all before the thirty minute timer runs out, the AO marker turns green and an ammo box spawns that will last ten minutes
before it it deleted. 120 seconds later another AO will be chosen and so on. Each AO that is used is removed from the list
and if the list runs through all ten missions it will reset to full and start over.
 
 
 
Inside the mission folder you created for init.sqf you need to make another file called AI_Init.sqf and inside that file
place all of the spoiler code inside.

diag_log "HOGS_AI STARTING!";
HOGS_AI=[];
 
_missionsArray = [1,2,3,4,5,6,7,8,9,10];
 
sleep 1;
 
Bounce_Mission=false;
 
AI_Timer1={HAI_TIMER=time;waitUntil{(time-HAI_TIMER)>1800};Bounce_Mission=true;};
_loop_timer_01=[] spawn AI_Timer1;
 
while{true}do{
_missions = count _missionsArray;
 
if (_missions == 0) then
{
_missionsArray = [1,2,3,4,5,6,7,8,9,10];
_missions = count _missionsArray;
};
 
_objectiv = _missionsArray select (floor (random _missions));
_missionsArray = _missionsArray - [_objectiv];
 
 
switch (_objectiv) do
{
case 1:
{
_group1 = createGroup RESISTANCE;
currentAO = createMarker ["Inc_Zone_One", [8946.34,13758.8,0.00140381]];
"Inc_Zone_One" setMarkerShape "ELLIPSE";
"Inc_Zone_One" setMarkerSize [600,600];
"Inc_Zone_One" setMarkerColor "ColorRed";
"Inc_Zone_One" setMarkerBrush "DIAGGRID";
"Inc_Zone_One" setMarkerAlpha 1;
currentAO2 = createMarker ["Inc_Zone_Two", [8946.34,13758.8,0.00140381]];
"Inc_Zone_Two" setMarkerType "mil_dot";
"Inc_Zone_Two" setMarkerText "Hogscorp Defense Alert";
 
 
_ogjstr = "<t align='center' size='2.0'>Hogscorp<br/>Defense Alert!</t><br/>______________<br/><br/>
Our radar has picked up a bandit patrol and marked it on your map!<br/>
You have our permission to confiscate any property you find as payment for eliminating the threat!";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
BAN_1 = _group1 createUnit["I_Soldier_EPOCH", [8946.34,13758.8,0.00140381], [], 50, "CAN_COLLIDE"];
BAN_2 = _group1 createUnit["I_Soldier_EPOCH", [8946.34,13758.8,0.00140381], [], 50, "CAN_COLLIDE"];
BAN_3 = _group1 createUnit["I_Soldier_EPOCH", [8946.34,13758.8,0.00140381], [], 50, "CAN_COLLIDE"];
BAN_4 = _group1 createUnit["I_Soldier_EPOCH", [8946.34,13758.8,0.00140381], [], 50, "CAN_COLLIDE"];
BAN_5 = _group1 createUnit["I_Soldier_EPOCH", [8946.34,13758.8,0.00140381], [], 50, "CAN_COLLIDE"];
BAN_6 = _group1 createUnit["I_Soldier_EPOCH", [8946.34,13758.8,0.00140381], [], 50, "CAN_COLLIDE"];
BAN_7 = _group1 createUnit["I_Soldier_EPOCH", [8946.34,13758.8,0.00140381], [], 50, "CAN_COLLIDE"];
BAN_8 = _group1 createUnit["I_Soldier_EPOCH", [8946.34,13758.8,0.00140381], [], 50, "CAN_COLLIDE"];
BAN_9 = _group1 createUnit["I_Soldier_EPOCH", [8946.34,13758.8,0.00140381], [], 50, "CAN_COLLIDE"];
BAN_10 = _group1 createUnit["I_Soldier_EPOCH", [8946.34,13758.8,0.00140381], [], 50, "CAN_COLLIDE"];
BAN_11 = _group1 createUnit["I_Soldier_EPOCH", [8946.34,13758.8,0.00140381], [], 50, "CAN_COLLIDE"];
BAN_12 = _group1 createUnit["I_Soldier_EPOCH", [8946.34,13758.8,0.00140381], [], 50, "CAN_COLLIDE"];
BAN_13 = _group1 createUnit["I_Soldier_EPOCH", [8946.34,13758.8,0.00140381], [], 50, "CAN_COLLIDE"];
BAN_14 = _group1 createUnit["I_Soldier_EPOCH", [8946.34,13758.8,0.00140381], [], 50, "CAN_COLLIDE"];
BAN_15 = _group1 createUnit["I_Soldier_EPOCH", [8946.34,13758.8,0.00140381], [], 50, "CAN_COLLIDE"];
 
HOGS_AI=[bAN_1,BAN_2,BAN_3,BAN_4,BAN_5,BAN_6,BAN_7,BAN_8,BAN_9,BAN_10,BAN_11,BAN_12,BAN_13,BAN_14,BAN_15];
PublicVariableServer "HOGS_AI";
 
_group1 setBehaviour "RED";
{
removeUniform _x;
removeHeadgear _x;
_x forceAddUniform  "U_ghillie1_uniform";
_x addVest "V_TacVest_camo";
_x addHeadgear "H_ShemagOpen_tan";
_x addMagazines ["11Rnd_45ACP_Mag", 3];
_x addMagazines ["30Rnd_556x45_Stanag", 8];
_x addWeapon "arifle_Mk20_GL_F";
_x addPrimaryWeaponItem "optic_Arco";
_x addWeapon "hgun_Pistol_heavy_01_F";
_x addHandgunItem "optic_MRD";
//_x addPrimaryWeaponItem "FHQ_acc_LLM01F";
_x addMagazines ["1Rnd_HE_Grenade_shell", 2];
_x setSkill 0.7;
_x setBehaviour "RED";
//_x addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM "AI_Killed.sqf"; }];
 
}foreach HOGS_AI;
//_group1 = [[4822.0762,2836.5015], EAST, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Motorized_MTP" >> "OIA_MotInfTeam")] call BIS_fnc_spawnGroup;
[_group1, [8946.34,13758.8],300] call bis_fnc_taskPatrol;
 
  // Create trigger around location.
      _dt = createTrigger ["EmptyDetector", [8946.34,13758.8]];
      _dt setTriggerArea [600, 600, 0, false];
      _dt setTriggerActivation ["GUER", "NOTPRESENT", false];
 
// Wait until the trigger sets off or the mission runs out of time
sleep 2;
    Bounce_Mission=false;
waitUntil {(count list _dt < 1) or (Bounce_Mission)};
terminate _loop_timer_01;
 
if(!Bounce_Mission)then{
_prize = createVehicle ["Box_East_Ammo_F",[8946.34,13758.8,0.00140381],[], 0, "CAN_COLLIDE"];
HAI2Prize_Timer=time;
[_prize]spawn{_prize=_this select 0;waitUntil{(time-HAI2Prize_Timer)>600}; deleteVehicle _prize;};
 
//Change the marker to green, inform players of their success
"Inc_Zone_One" setMarkerColor "ColorGreen";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
Good work citizens.<br/>
The threat has been eliminated!<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
}else{
 
//Change the marker to yellow, inform players that the bandits got away
"Inc_Zone_One" setMarkerColor "ColorYellow";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
The bandits have slipped out of the area!<br/>
We will attempt to find their new location.<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
};
//Clean up - delete any left over enemies and groups that have broken ranks or glitched
//Delete the trigger and reset Enemy_Dead
deleteVehicle _dt;
 
 
{deletevehicle _x} forEach (units _group1);
    deleteGroup _group1;
 
sleep 120;
_loop_timer_01=[] spawn AI_Timer1;
 
deleteMarker "Inc_Zone_One"; 
deleteMarker "Inc_Zone_Two";
};
 
case 2:
{
_group1 = createGroup RESISTANCE;
currentAO = createMarker ["Inc_Zone_One", [2252.54,8415.4551]];
"Inc_Zone_One" setMarkerShape "ELLIPSE";
"Inc_Zone_One" setMarkerSize [600,600];
"Inc_Zone_One" setMarkerColor "ColorRed";
"Inc_Zone_One" setMarkerBrush "DIAGGRID";
"Inc_Zone_One" setMarkerAlpha 1;
currentAO2 = createMarker ["Inc_Zone_Two", [2252.54,8415.4551]];
"Inc_Zone_Two" setMarkerType "mil_dot";
"Inc_Zone_Two" setMarkerText "Hogscorp Defense Alert";
 
// publicVariable "currentAO";
// publicVariable "currentAO2";
 
_ogjstr = "<t align='center' size='2.0'>Hogscorp<br/>Defense Alert!</t><br/>______________<br/><br/>
Our radar has picked up a bandit patrol and marked it on your map!<br/>
You have our permission to confiscate any property you find as payment for eliminating the threat!";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
 
 
 
"I_Soldier_EPOCH" createUnit [[2252.54,8401.4551,0], _group1,"BAN_1=this"];
_group1 selectLeader BAN_1;
"I_Soldier_EPOCH" createUnit [[2252.54,8402.4551,0], _group1,"BAN_2=this"];
"I_Soldier_EPOCH" createUnit [[2252.54,8403.4551,0], _group1,"BAN_3=this"];
"I_Soldier_EPOCH" createUnit [[2252.54,8404.4551,0], _group1,"BAN_4=this"];
"I_Soldier_EPOCH" createUnit [[2252.54,8405.4551,0], _group1,"BAN_5=this"];
"I_Soldier_EPOCH" createUnit [[2252.54,8406.4551,0], _group1,"BAN_6=this"];
"I_Soldier_EPOCH" createUnit [[2252.54,8407.4551,0], _group1,"BAN_7=this"];
"I_Soldier_EPOCH" createUnit [[2252.54,8408.4551,0], _group1,"BAN_8=this"];
"I_Soldier_EPOCH" createUnit [[2252.54,8409.4551,0], _group1,"BAN_9=this"];
"I_Soldier_EPOCH" createUnit [[2252.54,8410.4551,0], _group1,"BAN_10=this"];
"I_Soldier_EPOCH" createUnit [[2252.54,8411.4551,0], _group1,"BAN_11=this"];
"I_Soldier_EPOCH" createUnit [[2252.54,8412.4551,0], _group1,"BAN_12=this"];
"I_Soldier_EPOCH" createUnit [[2252.54,8413.4551,0], _group1,"BAN_13=this"];
"I_Soldier_EPOCH" createUnit [[2252.54,8414.4551,0], _group1,"BAN_14=this"];
"I_Soldier_EPOCH" createUnit [[2252.54,8415.4551,0], _group1,"BAN_15=this"];
_group1 setBehaviour "RED";
 
HOGS_AI=[bAN_1,BAN_2,BAN_3,BAN_4,BAN_5,BAN_6,BAN_7,BAN_8,BAN_9,BAN_10,BAN_11,BAN_12,BAN_13,BAN_14,BAN_15];
PublicVariableServer "HOGS_AI";
 
{
removeUniform _x;
removeHeadgear _x;
_x forceAddUniform  "U_ghillie1_uniform";
_x addVest "V_TacVest_camo";
_x addHeadgear "H_ShemagOpen_tan";
_x addMagazines ["11Rnd_45ACP_Mag", 3];
_x addMagazines ["30Rnd_556x45_Stanag", 8];
_x addWeapon "arifle_Mk20_GL_F";
_x addPrimaryWeaponItem "optic_Arco";
_x addWeapon "hgun_Pistol_heavy_01_F";
_x addHandgunItem "optic_MRD";
//_x addPrimaryWeaponItem "FHQ_acc_LLM01F";
_x addMagazines ["1Rnd_HE_Grenade_shell", 2];
_x setSkill 0.7;
_x setBehaviour "RED";
//_x addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM "AI_Killed.sqf"; }];
 
}foreach HOGS_AI;
//_group1 = [[4822.0762,2836.5015], EAST, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Motorized_MTP" >> "OIA_MotInfTeam")] call BIS_fnc_spawnGroup;
[_group1, [2252.54,8415.4551],300] call bis_fnc_taskPatrol;
 
  // Create trigger around location.
      _dt = createTrigger ["EmptyDetector", [2252.54,8415.4551]];
      _dt setTriggerArea [600, 600, 0, false];
      _dt setTriggerActivation ["GUER", "NOTPRESENT", false];
 
// Wait until the trigger sets off or the mission runs out of time
sleep 2;
    Bounce_Mission=false;
waitUntil {(count list _dt < 1) or (Bounce_Mission)};
terminate _loop_timer_01;
 
if(!Bounce_Mission)then{
_prize = createVehicle ["Box_East_Ammo_F",[2252.54,8415.4551,0],[], 0, "CAN_COLLIDE"];
HAI2Prize_Timer=time;
[_prize]spawn{_prize=_this select 0;waitUntil{(time-HAI2Prize_Timer)>600}; deleteVehicle _prize;};
 
//Change the marker to green, inform players of their success
"Inc_Zone_One" setMarkerColor "ColorGreen";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
Good work citizens.<br/>
The threat has been eliminated!<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
}else{
 
//Change the marker to yellow, inform players that the bandits got away
"Inc_Zone_One" setMarkerColor "ColorYellow";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
The bandits have slipped out of the area!<br/>
We will attempt to find their new location.<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
};
//Clean up - delete any left over enemies and groups that have broken ranks or glitched
//Delete the trigger and reset Enemy_Dead
deleteVehicle _dt;
 
 
{deletevehicle _x} forEach (units _group1);
    deleteGroup _group1;
 
sleep 120;
_loop_timer_01=[] spawn AI_Timer1;
 
deleteMarker "Inc_Zone_One"; 
deleteMarker "Inc_Zone_Two";
};
case 3:
{
_group1 = createGroup RESISTANCE;
currentAO = createMarker ["Inc_Zone_One", [3557.4958,13942.614]];
"Inc_Zone_One" setMarkerShape "ELLIPSE";
"Inc_Zone_One" setMarkerSize [600,600];
"Inc_Zone_One" setMarkerColor "ColorRed";
"Inc_Zone_One" setMarkerBrush "DIAGGRID";
"Inc_Zone_One" setMarkerAlpha 1;
currentAO2 = createMarker ["Inc_Zone_Two", [3557.4958,13942.614]];
"Inc_Zone_Two" setMarkerType "mil_dot";
"Inc_Zone_Two" setMarkerText "Hogscorp Defense Alert";
 
// publicVariable "currentAO";
// publicVariable "currentAO2";
 
_ogjstr = "<t align='center' size='2.0'>Hogscorp<br/>Defense Alert!</t><br/>______________<br/><br/>
Our radar has picked up a bandit patrol and marked it on your map!<br/>
You have our permission to confiscate any property you find as payment for eliminating the threat!";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
 
 
 
"I_Soldier_EPOCH" createUnit [[3557.4958,13928.614,0], _group1,"BAN_1=this"];
_group1 selectLeader BAN_1;
"I_Soldier_EPOCH" createUnit [[3557.4958,13929.614,0], _group1,"BAN_2=this"];
"I_Soldier_EPOCH" createUnit [[3557.4958,13930.614,0], _group1,"BAN_3=this"];
"I_Soldier_EPOCH" createUnit [[3557.4958,13931.614,0], _group1,"BAN_4=this"];
"I_Soldier_EPOCH" createUnit [[3557.4958,13932.614,0], _group1,"BAN_5=this"];
"I_Soldier_EPOCH" createUnit [[3557.4958,13933.614,0], _group1,"BAN_6=this"];
"I_Soldier_EPOCH" createUnit [[3557.4958,13934.614,0], _group1,"BAN_7=this"];
"I_Soldier_EPOCH" createUnit [[3557.4958,13935.614,0], _group1,"BAN_8=this"];
"I_Soldier_EPOCH" createUnit [[3557.4958,13936.614,0], _group1,"BAN_9=this"];
"I_Soldier_EPOCH" createUnit [[3557.4958,13937.614,0], _group1,"BAN_10=this"];
"I_Soldier_EPOCH" createUnit [[3557.4958,13938.614,0], _group1,"BAN_11=this"];
"I_Soldier_EPOCH" createUnit [[3557.4958,13939.614,0], _group1,"BAN_12=this"];
"I_Soldier_EPOCH" createUnit [[3557.4958,13940.614,0], _group1,"BAN_13=this"];
"I_Soldier_EPOCH" createUnit [[3557.4958,13941.614,0], _group1,"BAN_14=this"];
"I_Soldier_EPOCH" createUnit [[3557.4958,13942.614,0], _group1,"BAN_15=this"];
 
HOGS_AI=[bAN_1,BAN_2,BAN_3,BAN_4,BAN_5,BAN_6,BAN_7,BAN_8,BAN_9,BAN_10,BAN_11,BAN_12,BAN_13,BAN_14,BAN_15];
PublicVariableServer "HOGS_AI";
 
_group1 setBehaviour "RED";
{
removeUniform _x;
removeHeadgear _x;
_x forceAddUniform  "U_ghillie1_uniform";
_x addVest "V_TacVest_camo";
_x addHeadgear "H_ShemagOpen_tan";
_x addMagazines ["11Rnd_45ACP_Mag", 3];
_x addMagazines ["30Rnd_556x45_Stanag", 8];
_x addWeapon "arifle_Mk20_GL_F";
_x addPrimaryWeaponItem "optic_Arco";
_x addWeapon "hgun_Pistol_heavy_01_F";
_x addHandgunItem "optic_MRD";
//_x addPrimaryWeaponItem "FHQ_acc_LLM01F";
_x addMagazines ["1Rnd_HE_Grenade_shell", 2];
_x setSkill 0.7;
_x setBehaviour "RED";
//_x addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM "AI_Killed.sqf"; }];
 
}foreach HOGS_AI;
//_group1 = [[4822.0762,2836.5015], EAST, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Motorized_MTP" >> "OIA_MotInfTeam")] call BIS_fnc_spawnGroup;
[_group1, [3557.4958,13942.614],300] call bis_fnc_taskPatrol;
 
  // Create trigger around location.
      _dt = createTrigger ["EmptyDetector", [3557.4958,13942.614]];
      _dt setTriggerArea [600, 600, 0, false];
      _dt setTriggerActivation ["GUER", "NOTPRESENT", false];
 
// Wait until the trigger sets off or the mission runs out of time
sleep 2;
    Bounce_Mission=false;
waitUntil {(count list _dt < 1) or (Bounce_Mission)};
terminate _loop_timer_01;
 
if(!Bounce_Mission)then{
_prize = createVehicle ["Box_East_Ammo_F",[3557.4958,13942.614,0],[], 0, "CAN_COLLIDE"];
HAI2Prize_Timer=time;
[_prize]spawn{_prize=_this select 0;waitUntil{(time-HAI2Prize_Timer)>600}; deleteVehicle _prize;};
 
//Change the marker to green, inform players of their success
"Inc_Zone_One" setMarkerColor "ColorGreen";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
Good work citizens.<br/>
The threat has been eliminated!<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
}else{
 
//Change the marker to yellow, inform players that the bandits got away
"Inc_Zone_One" setMarkerColor "ColorYellow";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
The bandits have slipped out of the area!<br/>
We will attempt to find their new location.<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
};
//Clean up - delete any left over enemies and groups that have broken ranks or glitched
//Delete the trigger and reset Enemy_Dead
deleteVehicle _dt;
 
 
{deletevehicle _x} forEach (units _group1);
    deleteGroup _group1;
 
sleep 120;
_loop_timer_01=[] spawn AI_Timer1;
 
deleteMarker "Inc_Zone_One"; 
deleteMarker "Inc_Zone_Two";
};
case 4:
{
_group1 = createGroup RESISTANCE;
currentAO = createMarker ["Inc_Zone_One", [9040.9043,1895.418]];
"Inc_Zone_One" setMarkerShape "ELLIPSE";
"Inc_Zone_One" setMarkerSize [600,600];
"Inc_Zone_One" setMarkerColor "ColorRed";
"Inc_Zone_One" setMarkerBrush "DIAGGRID";
"Inc_Zone_One" setMarkerAlpha 1;
currentAO2 = createMarker ["Inc_Zone_Two", [9040.9043,1895.418]];
"Inc_Zone_Two" setMarkerType "mil_dot";
"Inc_Zone_Two" setMarkerText "Hogscorp Defense Alert";
 
// publicVariable "currentAO";
// publicVariable "currentAO2";
 
_ogjstr = "<t align='center' size='2.0'>Hogscorp<br/>Defense Alert!</t><br/>______________<br/><br/>
Our radar has picked up a bandit patrol and marked it on your map!<br/>
You have our permission to confiscate any property you find as payment for eliminating the threat!";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
 
 
 
"I_Soldier_EPOCH" createUnit [[9040.9043,1881.418,0], _group1,"BAN_1=this"];
_group1 selectLeader BAN_1;
"I_Soldier_EPOCH" createUnit [[9040.9043,1882.418,0], _group1,"BAN_2=this"];
"I_Soldier_EPOCH" createUnit [[9040.9043,1883.418,0], _group1,"BAN_3=this"];
"I_Soldier_EPOCH" createUnit [[9040.9043,1884.418,0], _group1,"BAN_4=this"];
"I_Soldier_EPOCH" createUnit [[9040.9043,1885.418,0], _group1,"BAN_5=this"];
"I_Soldier_EPOCH" createUnit [[9040.9043,1886.418,0], _group1,"BAN_6=this"];
"I_Soldier_EPOCH" createUnit [[9040.9043,1887.418,0], _group1,"BAN_7=this"];
"I_Soldier_EPOCH" createUnit [[9040.9043,1888.418,0], _group1,"BAN_8=this"];
"I_Soldier_EPOCH" createUnit [[9040.9043,1889.418,0], _group1,"BAN_9=this"];
"I_Soldier_EPOCH" createUnit [[9040.9043,1890.418,0], _group1,"BAN_10=this"];
"I_Soldier_EPOCH" createUnit [[9040.9043,1891.418,0], _group1,"BAN_11=this"];
"I_Soldier_EPOCH" createUnit [[9040.9043,1892.418,0], _group1,"BAN_12=this"];
"I_Soldier_EPOCH" createUnit [[9040.9043,1893.418,0], _group1,"BAN_13=this"];
"I_Soldier_EPOCH" createUnit [[9040.9043,1894.418,0], _group1,"BAN_14=this"];
"I_Soldier_EPOCH" createUnit [[9040.9043,1895.418,0], _group1,"BAN_15=this"];
HOGS_AI=[bAN_1,BAN_2,BAN_3,BAN_4,BAN_5,BAN_6,BAN_7,BAN_8,BAN_9,BAN_10,BAN_11,BAN_12,BAN_13,BAN_14,BAN_15];
PublicVariableServer "HOGS_AI";
 
_group1 setBehaviour "RED";
{
removeUniform _x;
removeHeadgear _x;
_x forceAddUniform  "U_ghillie1_uniform";
_x addVest "V_TacVest_camo";
_x addHeadgear "H_ShemagOpen_tan";
_x addMagazines ["11Rnd_45ACP_Mag", 3];
_x addMagazines ["30Rnd_556x45_Stanag", 8];
_x addWeapon "arifle_Mk20_GL_F";
_x addPrimaryWeaponItem "optic_Arco";
_x addWeapon "hgun_Pistol_heavy_01_F";
_x addHandgunItem "optic_MRD";
//_x addPrimaryWeaponItem "FHQ_acc_LLM01F";
_x addMagazines ["1Rnd_HE_Grenade_shell", 2];
_x setSkill 0.7;
_x setBehaviour "RED";
//_x addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM "AI_Killed.sqf"; }];
 
}foreach HOGS_AI;
//_group1 = [[4822.0762,2836.5015], EAST, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Motorized_MTP" >> "OIA_MotInfTeam")] call BIS_fnc_spawnGroup;
[_group1, [9040.9043,1895.418],300] call bis_fnc_taskPatrol;
 
  // Create trigger around location.
      _dt = createTrigger ["EmptyDetector", [9040.9043,1895.418]];
      _dt setTriggerArea [600, 600, 0, false];
      _dt setTriggerActivation ["GUER", "NOTPRESENT", false];
 
// Wait until the trigger sets off or the mission runs out of time
sleep 2;
    Bounce_Mission=false;
waitUntil {(count list _dt < 1) or (Bounce_Mission)};
terminate _loop_timer_01;
 
if(!Bounce_Mission)then{
_prize = createVehicle ["Box_East_Ammo_F",[9040.9043,1895.418,0],[], 0, "CAN_COLLIDE"];
HAI2Prize_Timer=time;
[_prize]spawn{_prize=_this select 0;waitUntil{(time-HAI2Prize_Timer)>600}; deleteVehicle _prize;};
 
//Change the marker to green, inform players of their success
"Inc_Zone_One" setMarkerColor "ColorGreen";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
Good work citizens.<br/>
The threat has been eliminated!<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
}else{
 
//Change the marker to yellow, inform players that the bandits got away
"Inc_Zone_One" setMarkerColor "ColorYellow";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
The bandits have slipped out of the area!<br/>
We will attempt to find their new location.<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
};
//Clean up - delete any left over enemies and groups that have broken ranks or glitched
//Delete the trigger and reset Enemy_Dead
deleteVehicle _dt;
 
 
{deletevehicle _x} forEach (units _group1);
    deleteGroup _group1;
 
sleep 120;
_loop_timer_01=[] spawn AI_Timer1;
 
deleteMarker "Inc_Zone_One"; 
deleteMarker "Inc_Zone_Two";
};
case 5:
{
_group1 = createGroup RESISTANCE;
currentAO = createMarker ["Inc_Zone_One", [5781.8521,5882.4922]];
"Inc_Zone_One" setMarkerShape "ELLIPSE";
"Inc_Zone_One" setMarkerSize [600,600];
"Inc_Zone_One" setMarkerColor "ColorRed";
"Inc_Zone_One" setMarkerBrush "DIAGGRID";
"Inc_Zone_One" setMarkerAlpha 1;
currentAO2 = createMarker ["Inc_Zone_Two", [5781.8521,5882.4922]];
"Inc_Zone_Two" setMarkerType "mil_dot";
"Inc_Zone_Two" setMarkerText "Hogscorp Defense Alert";
 
// publicVariable "currentAO";
// publicVariable "currentAO2";
 
_ogjstr = "<t align='center' size='2.0'>Hogscorp<br/>Defense Alert!</t><br/>______________<br/><br/>
Our radar has picked up a bandit patrol and marked it on your map!<br/>
You have our permission to confiscate any property you find as payment for eliminating the threat!";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
 
 
 
"I_Soldier_EPOCH" createUnit [[5781.8521,5882.4922,0], _group1,"BAN_1=this"];
_group1 selectLeader BAN_1;
"I_Soldier_EPOCH" createUnit [[5781.8521,5883.4922,0], _group1,"BAN_2=this"];
"I_Soldier_EPOCH" createUnit [[5781.8521,5884.4922,0], _group1,"BAN_3=this"];
"I_Soldier_EPOCH" createUnit [[5781.8521,5885.4922,0], _group1,"BAN_4=this"];
"I_Soldier_EPOCH" createUnit [[5781.8521,5886.4922,0], _group1,"BAN_5=this"];
"I_Soldier_EPOCH" createUnit [[5781.8521,5887.4922,0], _group1,"BAN_6=this"];
"I_Soldier_EPOCH" createUnit [[5781.8521,5888.4922,0], _group1,"BAN_7=this"];
"I_Soldier_EPOCH" createUnit [[5781.8521,5889.4922,0], _group1,"BAN_8=this"];
"I_Soldier_EPOCH" createUnit [[5781.8521,5890.4922,0], _group1,"BAN_9=this"];
"I_Soldier_EPOCH" createUnit [[5781.8521,5891.4922,0], _group1,"BAN_10=this"];
"I_Soldier_EPOCH" createUnit [[5781.8521,5892.4922,0], _group1,"BAN_11=this"];
"I_Soldier_EPOCH" createUnit [[5781.8521,5893.4922,0], _group1,"BAN_12=this"];
"I_Soldier_EPOCH" createUnit [[5781.8521,5894.4922,0], _group1,"BAN_13=this"];
"I_Soldier_EPOCH" createUnit [[5781.8521,5895.4922,0], _group1,"BAN_14=this"];
"I_Soldier_EPOCH" createUnit [[5781.8521,5896.4922,0], _group1,"BAN_15=this"];
HOGS_AI=[bAN_1,BAN_2,BAN_3,BAN_4,BAN_5,BAN_6,BAN_7,BAN_8,BAN_9,BAN_10,BAN_11,BAN_12,BAN_13,BAN_14,BAN_15];
PublicVariableServer "HOGS_AI";
 
_group1 setBehaviour "RED";
{
removeUniform _x;
removeHeadgear _x;
_x forceAddUniform  "U_ghillie1_uniform";
_x addVest "V_TacVest_camo";
_x addHeadgear "H_ShemagOpen_tan";
_x addMagazines ["11Rnd_45ACP_Mag", 3];
_x addMagazines ["30Rnd_556x45_Stanag", 8];
_x addWeapon "arifle_Mk20_GL_F";
_x addPrimaryWeaponItem "optic_Arco";
_x addWeapon "hgun_Pistol_heavy_01_F";
_x addHandgunItem "optic_MRD";
//_x addPrimaryWeaponItem "FHQ_acc_LLM01F";
_x addMagazines ["1Rnd_HE_Grenade_shell", 2];
_x setSkill 0.7;
_x setBehaviour "RED";
//_x addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM "AI_Killed.sqf"; }];
 
}foreach HOGS_AI;
//_group1 = [[4822.0762,2836.5015], EAST, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Motorized_MTP" >> "OIA_MotInfTeam")] call BIS_fnc_spawnGroup;
[_group1, [5781.8521,5882.4922],300] call bis_fnc_taskPatrol;
 
  // Create trigger around location.
      _dt = createTrigger ["EmptyDetector", [5781.8521,5882.4922]];
      _dt setTriggerArea [600, 600, 0, false];
      _dt setTriggerActivation ["GUER", "NOTPRESENT", false];
 
// Wait until the trigger sets off or the mission runs out of time
sleep 2;
    Bounce_Mission=false;
waitUntil {(count list _dt < 1) or (Bounce_Mission)};
terminate _loop_timer_01;
 
if(!Bounce_Mission)then{
_prize = createVehicle ["Box_East_Ammo_F",[5781.8521,5882.4922,0],[], 0, "CAN_COLLIDE"];
HAI2Prize_Timer=time;
[_prize]spawn{_prize=_this select 0;waitUntil{(time-HAI2Prize_Timer)>600}; deleteVehicle _prize;};
 
//Change the marker to green, inform players of their success
"Inc_Zone_One" setMarkerColor "ColorGreen";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
Good work citizens.<br/>
The threat has been eliminated!<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
}else{
 
//Change the marker to yellow, inform players that the bandits got away
"Inc_Zone_One" setMarkerColor "ColorYellow";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
The bandits have slipped out of the area!<br/>
We will attempt to find their new location.<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
};
//Clean up - delete any left over enemies and groups that have broken ranks or glitched
//Delete the trigger and reset Enemy_Dead
deleteVehicle _dt;
 
 
{deletevehicle _x} forEach (units _group1);
    deleteGroup _group1;
 
sleep 120;
_loop_timer_01=[] spawn AI_Timer1;
 
deleteMarker "Inc_Zone_One"; 
deleteMarker "Inc_Zone_Two";
};
case 6:
{
_group1 = createGroup RESISTANCE;
currentAO = createMarker ["Inc_Zone_One", [10724.351,13992.229]];
"Inc_Zone_One" setMarkerShape "ELLIPSE";
"Inc_Zone_One" setMarkerSize [600,600];
"Inc_Zone_One" setMarkerColor "ColorRed";
"Inc_Zone_One" setMarkerBrush "DIAGGRID";
"Inc_Zone_One" setMarkerAlpha 1;
currentAO2 = createMarker ["Inc_Zone_Two", [10724.351,13992.229]];
"Inc_Zone_Two" setMarkerType "mil_dot";
"Inc_Zone_Two" setMarkerText "Hogscorp Defense Alert";
 
// publicVariable "currentAO";
// publicVariable "currentAO2";
 
_ogjstr = "<t align='center' size='2.0'>Hogscorp<br/>Defense Alert!</t><br/>______________<br/><br/>
Our radar has picked up a bandit patrol and marked it on your map!<br/>
You have our permission to confiscate any property you find as payment for eliminating the threat!";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
 
 
 
"I_Soldier_EPOCH" createUnit [[10724.351,13978.229,0], _group1,"BAN_1=this"];
_group1 selectLeader BAN_1;
"I_Soldier_EPOCH" createUnit [[10724.351,13979.229,0], _group1,"BAN_2=this"];
"I_Soldier_EPOCH" createUnit [[10724.351,13980.229,0], _group1,"BAN_3=this"];
"I_Soldier_EPOCH" createUnit [[10724.351,13981.229,0], _group1,"BAN_4=this"];
"I_Soldier_EPOCH" createUnit [[10724.351,13982.229,0], _group1,"BAN_5=this"];
"I_Soldier_EPOCH" createUnit [[10724.351,13983.229,0], _group1,"BAN_6=this"];
"I_Soldier_EPOCH" createUnit [[10724.351,13984.229,0], _group1,"BAN_7=this"];
"I_Soldier_EPOCH" createUnit [[10724.351,13985.229,0], _group1,"BAN_8=this"];
"I_Soldier_EPOCH" createUnit [[10724.351,13986.229,0], _group1,"BAN_9=this"];
"I_Soldier_EPOCH" createUnit [[10724.351,13987.229,0], _group1,"BAN_10=this"];
"I_Soldier_EPOCH" createUnit [[10724.351,13988.229,0], _group1,"BAN_11=this"];
"I_Soldier_EPOCH" createUnit [[10724.351,13989.229,0], _group1,"BAN_12=this"];
"I_Soldier_EPOCH" createUnit [[10724.351,13990.229,0], _group1,"BAN_13=this"];
"I_Soldier_EPOCH" createUnit [[10724.351,13991.229,0], _group1,"BAN_14=this"];
"I_Soldier_EPOCH" createUnit [[10724.351,13992.229,0], _group1,"BAN_15=this"];
HOGS_AI=[bAN_1,BAN_2,BAN_3,BAN_4,BAN_5,BAN_6,BAN_7,BAN_8,BAN_9,BAN_10,BAN_11,BAN_12,BAN_13,BAN_14,BAN_15];
PublicVariableServer "HOGS_AI";
 
_group1 setBehaviour "RED";
{
removeUniform _x;
removeHeadgear _x;
_x forceAddUniform  "U_ghillie1_uniform";
_x addVest "V_TacVest_camo";
_x addHeadgear "H_ShemagOpen_tan";
_x addMagazines ["11Rnd_45ACP_Mag", 3];
_x addMagazines ["30Rnd_556x45_Stanag", 8];
_x addWeapon "arifle_Mk20_GL_F";
_x addPrimaryWeaponItem "optic_Arco";
_x addWeapon "hgun_Pistol_heavy_01_F";
_x addHandgunItem "optic_MRD";
//_x addPrimaryWeaponItem "FHQ_acc_LLM01F";
_x addMagazines ["1Rnd_HE_Grenade_shell", 2];
_x setSkill 0.7;
_x setBehaviour "RED";
//_x addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM "AI_Killed.sqf"; }];
 
}foreach HOGS_AI;
//_group1 = [[4822.0762,2836.5015], EAST, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Motorized_MTP" >> "OIA_MotInfTeam")] call BIS_fnc_spawnGroup;
[_group1, [10724.351,13992.229],300] call bis_fnc_taskPatrol;
 
  // Create trigger around location.
      _dt = createTrigger ["EmptyDetector", [10724.351,13992.229]];
      _dt setTriggerArea [600, 600, 0, false];
      _dt setTriggerActivation ["GUER", "NOTPRESENT", false];
 
// Wait until the trigger sets off or the mission runs out of time
sleep 2;
    Bounce_Mission=false;
waitUntil {(count list _dt < 1) or (Bounce_Mission)};
terminate _loop_timer_01;
 
if(!Bounce_Mission)then{
_prize = createVehicle ["Box_East_Ammo_F",[10724.351,13992.229,0],[], 0, "CAN_COLLIDE"];
HAI2Prize_Timer=time;
[_prize]spawn{_prize=_this select 0;waitUntil{(time-HAI2Prize_Timer)>600}; deleteVehicle _prize;};
 
//Change the marker to green, inform players of their success
"Inc_Zone_One" setMarkerColor "ColorGreen";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
Good work citizens.<br/>
The threat has been eliminated!<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
}else{
 
//Change the marker to yellow, inform players that the bandits got away
"Inc_Zone_One" setMarkerColor "ColorYellow";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
The bandits have slipped out of the area!<br/>
We will attempt to find their new location.<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
};
//Clean up - delete any left over enemies and groups that have broken ranks or glitched
//Delete the trigger and reset Enemy_Dead
deleteVehicle _dt;
 
 
{deletevehicle _x} forEach (units _group1);
    deleteGroup _group1;
 
sleep 120;
_loop_timer_01=[] spawn AI_Timer1;
deleteMarker "Inc_Zone_One"; 
deleteMarker "Inc_Zone_Two";
};
case 7:
{
_group1 = createGroup RESISTANCE;
currentAO = createMarker ["Inc_Zone_One", [14469.495,13846.303]];
"Inc_Zone_One" setMarkerShape "ELLIPSE";
"Inc_Zone_One" setMarkerSize [600,600];
"Inc_Zone_One" setMarkerColor "ColorRed";
"Inc_Zone_One" setMarkerBrush "DIAGGRID";
"Inc_Zone_One" setMarkerAlpha 1;
currentAO2 = createMarker ["Inc_Zone_Two", [14469.495,13846.303]];
"Inc_Zone_Two" setMarkerType "mil_dot";
"Inc_Zone_Two" setMarkerText "Hogscorp Defense Alert";
 
// publicVariable "currentAO";
// publicVariable "currentAO2";
 
_ogjstr = "<t align='center' size='2.0'>Hogscorp<br/>Defense Alert!</t><br/>______________<br/><br/>
Our radar has picked up a bandit patrol and marked it on your map!<br/>
You have our permission to confiscate any property you find as payment for eliminating the threat!";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
 
 
 
"I_Soldier_EPOCH" createUnit [[14469.495,13832.303,0], _group1,"BAN_1=this"];
_group1 selectLeader BAN_1;
"I_Soldier_EPOCH" createUnit [[14469.495,13833.303,0], _group1,"BAN_2=this"];
"I_Soldier_EPOCH" createUnit [[14469.495,13834.303,0], _group1,"BAN_3=this"];
"I_Soldier_EPOCH" createUnit [[14469.495,13835.303,0], _group1,"BAN_4=this"];
"I_Soldier_EPOCH" createUnit [[14469.495,13836.303,0], _group1,"BAN_5=this"];
"I_Soldier_EPOCH" createUnit [[14469.495,13837.303,0], _group1,"BAN_6=this"];
"I_Soldier_EPOCH" createUnit [[14469.495,13838.303,0], _group1,"BAN_7=this"];
"I_Soldier_EPOCH" createUnit [[14469.495,13839.303,0], _group1,"BAN_8=this"];
"I_Soldier_EPOCH" createUnit [[14469.495,13840.303,0], _group1,"BAN_9=this"];
"I_Soldier_EPOCH" createUnit [[14469.495,13841.303,0], _group1,"BAN_10=this"];
"I_Soldier_EPOCH" createUnit [[14469.495,13842.303,0], _group1,"BAN_11=this"];
"I_Soldier_EPOCH" createUnit [[14469.495,13843.303,0], _group1,"BAN_12=this"];
"I_Soldier_EPOCH" createUnit [[14469.495,13844.303,0], _group1,"BAN_13=this"];
"I_Soldier_EPOCH" createUnit [[14469.495,13845.303,0], _group1,"BAN_14=this"];
"I_Soldier_EPOCH" createUnit [[14469.495,13846.303,0], _group1,"BAN_15=this"];
HOGS_AI=[bAN_1,BAN_2,BAN_3,BAN_4,BAN_5,BAN_6,BAN_7,BAN_8,BAN_9,BAN_10,BAN_11,BAN_12,BAN_13,BAN_14,BAN_15];
PublicVariableServer "HOGS_AI";
 
_group1 setBehaviour "RED";
{
removeUniform _x;
removeHeadgear _x;
_x forceAddUniform  "U_ghillie1_uniform";
_x addVest "V_TacVest_camo";
_x addHeadgear "H_ShemagOpen_tan";
_x addMagazines ["11Rnd_45ACP_Mag", 3];
_x addMagazines ["30Rnd_556x45_Stanag", 8];
_x addWeapon "arifle_Mk20_GL_F";
_x addPrimaryWeaponItem "optic_Arco";
_x addWeapon "hgun_Pistol_heavy_01_F";
_x addHandgunItem "optic_MRD";
//_x addPrimaryWeaponItem "FHQ_acc_LLM01F";
_x addMagazines ["1Rnd_HE_Grenade_shell", 2];
_x setSkill 0.7;
_x setBehaviour "RED";
//_x addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM "AI_Killed.sqf"; }];
 
}foreach HOGS_AI;
//_group1 = [[4822.0762,2836.5015], EAST, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Motorized_MTP" >> "OIA_MotInfTeam")] call BIS_fnc_spawnGroup;
[_group1, [14469.495,13846.303],300] call bis_fnc_taskPatrol;
 
  // Create trigger around location.
      _dt = createTrigger ["EmptyDetector", [14469.495,13846.303]];
      _dt setTriggerArea [600, 600, 0, false];
      _dt setTriggerActivation ["GUER", "NOTPRESENT", false];
 
// Wait until the trigger sets off or the mission runs out of time
sleep 2;
    Bounce_Mission=false;
waitUntil {(count list _dt < 1) or (Bounce_Mission)};
terminate _loop_timer_01;
 
if(!Bounce_Mission)then{
_prize = createVehicle ["Box_East_Ammo_F",[14469.495,13846.303,0],[], 0, "CAN_COLLIDE"];
HAI2Prize_Timer=time;
[_prize]spawn{_prize=_this select 0;waitUntil{(time-HAI2Prize_Timer)>600}; deleteVehicle _prize;};
 
//Change the marker to green, inform players of their success
"Inc_Zone_One" setMarkerColor "ColorGreen";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
Good work citizens.<br/>
The threat has been eliminated!<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
}else{
 
//Change the marker to yellow, inform players that the bandits got away
"Inc_Zone_One" setMarkerColor "ColorYellow";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
The bandits have slipped out of the area!<br/>
We will attempt to find their new location.<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
};
//Clean up - delete any left over enemies and groups that have broken ranks or glitched
//Delete the trigger and reset Enemy_Dead
deleteVehicle _dt;
 
 
{deletevehicle _x} forEach (units _group1);
    deleteGroup _group1;
 
sleep 120;
_loop_timer_01=[] spawn AI_Timer1;
 
deleteMarker "Inc_Zone_One"; 
deleteMarker "Inc_Zone_Two";
};
case 8:
{
_group1 = createGroup RESISTANCE;
currentAO = createMarker ["Inc_Zone_One", [13888.623,9896.498]];
"Inc_Zone_One" setMarkerShape "ELLIPSE";
"Inc_Zone_One" setMarkerSize [600,600];
"Inc_Zone_One" setMarkerColor "ColorRed";
"Inc_Zone_One" setMarkerBrush "DIAGGRID";
"Inc_Zone_One" setMarkerAlpha 1;
currentAO2 = createMarker ["Inc_Zone_Two", [13888.623,9896.498]];
"Inc_Zone_Two" setMarkerType "mil_dot";
"Inc_Zone_Two" setMarkerText "Hogscorp Defense Alert";
 
// publicVariable "currentAO";
// publicVariable "currentAO2";
 
_ogjstr = "<t align='center' size='2.0'>Hogscorp<br/>Defense Alert!</t><br/>______________<br/><br/>
Our radar has picked up a bandit patrol and marked it on your map!<br/>
You have our permission to confiscate any property you find as payment for eliminating the threat!";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
 
 
 
"I_Soldier_EPOCH" createUnit [[13874.623,9896.498,0], _group1,"BAN_1=this"];
_group1 selectLeader BAN_1;
"I_Soldier_EPOCH" createUnit [[13875.623,9896.498,0], _group1,"BAN_2=this"];
"I_Soldier_EPOCH" createUnit [[13876.623,9896.498,0], _group1,"BAN_3=this"];
"I_Soldier_EPOCH" createUnit [[13877.623,9896.498,0], _group1,"BAN_4=this"];
"I_Soldier_EPOCH" createUnit [[13878.623,9896.498,0], _group1,"BAN_5=this"];
"I_Soldier_EPOCH" createUnit [[13879.623,9896.498,0], _group1,"BAN_6=this"];
"I_Soldier_EPOCH" createUnit [[13880.623,9896.498,0], _group1,"BAN_7=this"];
"I_Soldier_EPOCH" createUnit [[13881.623,9896.498,0], _group1,"BAN_8=this"];
"I_Soldier_EPOCH" createUnit [[13882.623,9896.498,0], _group1,"BAN_9=this"];
"I_Soldier_EPOCH" createUnit [[13883.623,9896.498,0], _group1,"BAN_10=this"];
"I_Soldier_EPOCH" createUnit [[13884.623,9896.498,0], _group1,"BAN_11=this"];
"I_Soldier_EPOCH" createUnit [[13885.623,9896.498,0], _group1,"BAN_12=this"];
"I_Soldier_EPOCH" createUnit [[13886.623,9896.498,0], _group1,"BAN_13=this"];
"I_Soldier_EPOCH" createUnit [[13887.623,9896.498,0], _group1,"BAN_14=this"];
"I_Soldier_EPOCH" createUnit [[13888.623,9896.498,0], _group1,"BAN_15=this"];
HOGS_AI=[bAN_1,BAN_2,BAN_3,BAN_4,BAN_5,BAN_6,BAN_7,BAN_8,BAN_9,BAN_10,BAN_11,BAN_12,BAN_13,BAN_14,BAN_15];
PublicVariableServer "HOGS_AI";
 
_group1 setBehaviour "RED";
{
removeUniform _x;
removeHeadgear _x;
_x forceAddUniform  "U_ghillie1_uniform";
_x addVest "V_TacVest_camo";
_x addHeadgear "H_ShemagOpen_tan";
_x addMagazines ["11Rnd_45ACP_Mag", 3];
_x addMagazines ["30Rnd_556x45_Stanag", 8];
_x addWeapon "arifle_Mk20_GL_F";
_x addPrimaryWeaponItem "optic_Arco";
_x addWeapon "hgun_Pistol_heavy_01_F";
_x addHandgunItem "optic_MRD";
//_x addPrimaryWeaponItem "FHQ_acc_LLM01F";
_x addMagazines ["1Rnd_HE_Grenade_shell", 2];
_x setSkill 0.7;
_x setBehaviour "RED";
//_x addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM "AI_Killed.sqf"; }];
 
}foreach HOGS_AI;
//_group1 = [[4822.0762,2836.5015], EAST, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Motorized_MTP" >> "OIA_MotInfTeam")] call BIS_fnc_spawnGroup;
[_group1, [13888.623,9896.498],300] call bis_fnc_taskPatrol;
 
  // Create trigger around location.
      _dt = createTrigger ["EmptyDetector", [13888.623,9896.498]];
      _dt setTriggerArea [600, 600, 0, false];
      _dt setTriggerActivation ["GUER", "NOTPRESENT", false];
 
// Wait until the trigger sets off or the mission runs out of time
sleep 2;
    Bounce_Mission=false;
waitUntil {(count list _dt < 1) or (Bounce_Mission)};
terminate _loop_timer_01;
 
if(!Bounce_Mission)then{
_prize = createVehicle ["Box_East_Ammo_F",[13888.623,9896.498,0],[], 0, "CAN_COLLIDE"];
HAI2Prize_Timer=time;
[_prize]spawn{_prize=_this select 0;waitUntil{(time-HAI2Prize_Timer)>600}; deleteVehicle _prize;};
 
//Change the marker to green, inform players of their success
"Inc_Zone_One" setMarkerColor "ColorGreen";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
Good work citizens.<br/>
The threat has been eliminated!<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
}else{
 
//Change the marker to yellow, inform players that the bandits got away
"Inc_Zone_One" setMarkerColor "ColorYellow";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
The bandits have slipped out of the area!<br/>
We will attempt to find their new location.<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
};
//Clean up - delete any left over enemies and groups that have broken ranks or glitched
//Delete the trigger and reset Enemy_Dead
deleteVehicle _dt;
 
 
{deletevehicle _x} forEach (units _group1);
    deleteGroup _group1;
 
sleep 120;
_loop_timer_01=[] spawn AI_Timer1;
deleteMarker "Inc_Zone_One"; 
deleteMarker "Inc_Zone_Two";
};
case 9:
{
_group1 = createGroup RESISTANCE;
currentAO = createMarker ["Inc_Zone_One", [12400.097,6199.0391]];
"Inc_Zone_One" setMarkerShape "ELLIPSE";
"Inc_Zone_One" setMarkerSize [600,600];
"Inc_Zone_One" setMarkerColor "ColorRed";
"Inc_Zone_One" setMarkerBrush "DIAGGRID";
"Inc_Zone_One" setMarkerAlpha 1;
currentAO2 = createMarker ["Inc_Zone_Two", [12400.097,6199.0391]];
"Inc_Zone_Two" setMarkerType "mil_dot";
"Inc_Zone_Two" setMarkerText "Hogscorp Defense Alert";
 
// publicVariable "currentAO";
// publicVariable "currentAO2";
 
_ogjstr = "<t align='center' size='2.0'>Hogscorp<br/>Defense Alert!</t><br/>______________<br/><br/>
Our radar has picked up a bandit patrol and marked it on your map!<br/>
You have our permission to confiscate any property you find as payment for eliminating the threat!";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
 
 
 
"I_Soldier_EPOCH" createUnit [[12400.097,6184.0391,0], _group1,"BAN_1=this"];
_group1 selectLeader BAN_1;
"I_Soldier_EPOCH" createUnit [[12400.097,6185.0391,0], _group1,"BAN_2=this"];
"I_Soldier_EPOCH" createUnit [[12400.097,6186.0391,0], _group1,"BAN_3=this"];
"I_Soldier_EPOCH" createUnit [[12400.097,6187.0391,0], _group1,"BAN_4=this"];
"I_Soldier_EPOCH" createUnit [[12400.097,6189.0391,0], _group1,"BAN_5=this"];
"I_Soldier_EPOCH" createUnit [[12400.097,6190.0391,0], _group1,"BAN_6=this"];
"I_Soldier_EPOCH" createUnit [[12400.097,6191.0391,0], _group1,"BAN_7=this"];
"I_Soldier_EPOCH" createUnit [[12400.097,6192.0391,0], _group1,"BAN_8=this"];
"I_Soldier_EPOCH" createUnit [[12400.097,6193.0391,0], _group1,"BAN_9=this"];
"I_Soldier_EPOCH" createUnit [[12400.097,6194.0391,0], _group1,"BAN_10=this"];
"I_Soldier_EPOCH" createUnit [[12400.097,6195.0391,0], _group1,"BAN_11=this"];
"I_Soldier_EPOCH" createUnit [[12400.097,6196.0391,0], _group1,"BAN_12=this"];
"I_Soldier_EPOCH" createUnit [[12400.097,6197.0391,0], _group1,"BAN_13=this"];
"I_Soldier_EPOCH" createUnit [[12400.097,6198.0391,0], _group1,"BAN_14=this"];
"I_Soldier_EPOCH" createUnit [[12400.097,6199.0391,0], _group1,"BAN_15=this"];
HOGS_AI=[bAN_1,BAN_2,BAN_3,BAN_4,BAN_5,BAN_6,BAN_7,BAN_8,BAN_9,BAN_10,BAN_11,BAN_12,BAN_13,BAN_14,BAN_15];
PublicVariableServer "HOGS_AI";
 
_group1 setBehaviour "RED";
{
removeUniform _x;
removeHeadgear _x;
_x forceAddUniform  "U_ghillie1_uniform";
_x addVest "V_TacVest_camo";
_x addHeadgear "H_ShemagOpen_tan";
_x addMagazines ["11Rnd_45ACP_Mag", 3];
_x addMagazines ["30Rnd_556x45_Stanag", 8];
_x addWeapon "arifle_Mk20_GL_F";
_x addPrimaryWeaponItem "optic_Arco";
_x addWeapon "hgun_Pistol_heavy_01_F";
_x addHandgunItem "optic_MRD";
//_x addPrimaryWeaponItem "FHQ_acc_LLM01F";
_x addMagazines ["1Rnd_HE_Grenade_shell", 2];
_x setSkill 0.7;
_x setBehaviour "RED";
//_x addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM "AI_Killed.sqf"; }];
 
}foreach HOGS_AI;
//_group1 = [[4822.0762,2836.5015], EAST, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Motorized_MTP" >> "OIA_MotInfTeam")] call BIS_fnc_spawnGroup;
[_group1, [12400.097,6199.0391],300] call bis_fnc_taskPatrol;
 
  // Create trigger around location.
      _dt = createTrigger ["EmptyDetector", [12400.097,6199.0391]];
      _dt setTriggerArea [600, 600, 0, false];
      _dt setTriggerActivation ["GUER", "NOTPRESENT", false];
 
// Wait until the trigger sets off or the mission runs out of time
sleep 2;
    Bounce_Mission=false;
waitUntil {(count list _dt < 1) or (Bounce_Mission)};
terminate _loop_timer_01;
 
if(!Bounce_Mission)then{
_prize = createVehicle ["Box_East_Ammo_F",[12400.097,6199.0391,0],[], 0, "CAN_COLLIDE"];
HAI2Prize_Timer=time;
[_prize]spawn{_prize=_this select 0;waitUntil{(time-HAI2Prize_Timer)>600}; deleteVehicle _prize;};
 
//Change the marker to green, inform players of their success
"Inc_Zone_One" setMarkerColor "ColorGreen";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
Good work citizens.<br/>
The threat has been eliminated!<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
}else{
 
//Change the marker to yellow, inform players that the bandits got away
"Inc_Zone_One" setMarkerColor "ColorYellow";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
The bandits have slipped out of the area!<br/>
We will attempt to find their new location.<br/>
Stand by while our radar makes another pass.";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
};
//Clean up - delete any left over enemies and groups that have broken ranks or glitched
//Delete the trigger and reset Enemy_Dead
deleteVehicle _dt;
 
 
{deletevehicle _x} forEach (units _group1);
    deleteGroup _group1;
 
sleep 120;
_loop_timer_01=[] spawn AI_Timer1;
deleteMarker "Inc_Zone_One"; 
deleteMarker "Inc_Zone_Two";
};
case 10:
{
_group1 = createGroup RESISTANCE;
currentAO = createMarker ["Inc_Zone_One", [8837.4209,8242.2432]];
"Inc_Zone_One" setMarkerShape "ELLIPSE";
"Inc_Zone_One" setMarkerSize [600,600];
"Inc_Zone_One" setMarkerColor "ColorRed";
"Inc_Zone_One" setMarkerBrush "DIAGGRID";
"Inc_Zone_One" setMarkerAlpha 1;
currentAO2 = createMarker ["Inc_Zone_Two", [8837.4209,8242.2432]];
"Inc_Zone_Two" setMarkerType "mil_dot";
"Inc_Zone_Two" setMarkerText "Hogscorp Defense Alert";
 
// publicVariable "currentAO";
// publicVariable "currentAO2";
 
_ogjstr = "<t align='center' size='2.0'>Hogscorp<br/>Defense Alert!</t><br/>______________<br/><br/>
A massive bandit incursion has taken place at the Hogscorp Airport!<br/>
The airport is hugely important to your loyal benefactors!<br/>
Annihilate the threat at all costs!";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
 
 
 
"I_Soldier_EPOCH" createUnit [[8837.4209,8240.2432,0], _group1,"BAN_1=this"];
_group1 selectLeader BAN_1;
"I_Soldier_EPOCH" createUnit [[8837.4209,8241.2432,0], _group1,"BAN_2=this"];
"I_Soldier_EPOCH" createUnit [[8837.4209,8242.2432,0], _group1,"BAN_3=this"];
"I_Soldier_EPOCH" createUnit [[8837.4209,8243.2432,0], _group1,"BAN_4=this"];
"I_Soldier_EPOCH" createUnit [[8837.4209,8244.2432,0], _group1,"BAN_5=this"];
"I_Soldier_EPOCH" createUnit [[8837.4209,8245.2432,0], _group1,"BAN_6=this"];
"I_Soldier_EPOCH" createUnit [[8837.4209,8246.2432,0], _group1,"BAN_7=this"];
"I_Soldier_EPOCH" createUnit [[8837.4209,8247.2432,0], _group1,"BAN_8=this"];
"I_Soldier_EPOCH" createUnit [[8837.4209,8248.2432,0], _group1,"BAN_9=this"];
"I_Soldier_EPOCH" createUnit [[8837.4209,8249.2432,0], _group1,"BAN_10=this"];
"I_Soldier_EPOCH" createUnit [[8837.4209,8250.2432,0], _group1,"BAN_11=this"];
"I_Soldier_EPOCH" createUnit [[8837.4209,8251.2432,0], _group1,"BAN_12=this"];
"I_Soldier_EPOCH" createUnit [[8837.4209,8252.2432,0], _group1,"BAN_13=this"];
"I_Soldier_EPOCH" createUnit [[8837.4209,8253.2432,0], _group1,"BAN_14=this"];
"I_Soldier_EPOCH" createUnit [[8837.4209,8254.2432,0], _group1,"BAN_15=this"];
 
HOGS_AI=[bAN_1,BAN_2,BAN_3,BAN_4,BAN_5,BAN_6,BAN_7,BAN_8,BAN_9,BAN_10,BAN_11,BAN_12,BAN_13,BAN_14,BAN_15];
PublicVariableServer "HOGS_AI";
 
_group1 setBehaviour "RED";
{
removeUniform _x;
removeHeadgear _x;
_x forceAddUniform  "U_ghillie1_uniform";
_x addVest "V_TacVest_camo";
_x addHeadgear "H_ShemagOpen_tan";
_x addMagazines ["11Rnd_45ACP_Mag", 3];
_x addMagazines ["30Rnd_556x45_Stanag", 8];
_x addWeapon "arifle_Mk20_GL_F";
_x addPrimaryWeaponItem "optic_Arco";
_x addWeapon "hgun_Pistol_heavy_01_F";
_x addHandgunItem "optic_MRD";
//_x addPrimaryWeaponItem "FHQ_acc_LLM01F";
_x addMagazines ["1Rnd_HE_Grenade_shell", 2];
_x setSkill 0.7;
_x setBehaviour "RED";
 
//_x addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM "AI_Killed.sqf"; }];
 
}foreach HOGS_AI;
//_group1 = [[4822.0762,2836.5015], EAST, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Motorized_MTP" >> "OIA_MotInfTeam")] call BIS_fnc_spawnGroup;
[_group1, [8837.4209,8242.2432],300] call bis_fnc_taskPatrol;
 
  // Create trigger around location.
      _dt = createTrigger ["EmptyDetector", [8837.4209,8242.2432]];
      _dt setTriggerArea [600, 600, 0, false];
      _dt setTriggerActivation ["GUER", "NOTPRESENT", false];
 
// Wait until the trigger sets off or the mission runs out of time
sleep 2;
Bounce_Mission=false;
waitUntil {(count list _dt < 1) or (Bounce_Mission)};
terminate _loop_timer_01;
 
 
if(!Bounce_Mission)then{
_prize = createVehicle ["Box_East_Ammo_F",[8837.4209,8242.2432,0],[], 0, "CAN_COLLIDE"];
HAI2Prize_Timer=time;
[_prize]spawn{_prize=_this select 0;waitUntil{(time-HAI2Prize_Timer)>600}; deleteVehicle _prize;};
 
//Change the marker to green, inform players of their success
"Inc_Zone_One" setMarkerColor "ColorGreen";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
Excellent work citizens!<br/>
Your work has helped clear the way for bigger profits.<br/>
Those who helped will be greatly rewarded!";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
 
 
}else{
 
//Change the marker to yellow, inform players that the bandits got away
"Inc_Zone_One" setMarkerColor "ColorYellow";
publicVariable "currentAO";
 
_ogjstr = "<t align='center' size='2.0'>Mission Status</t><br/>
______________<br/><br/>
The bandits have done their damage and moved on...<br/>
Prices on goods sold in Barter Town will have to be increased to cover our losses.<br/>
Remember, a threat to Hogscorp is a threat to us all!";
GlobalHint = _ogjstr;
publicVariable "GlobalHint";
};
//Clean up - delete any left over enemies and groups that have broken ranks or glitched
//Delete the trigger and reset Enemy_Dead
deleteVehicle _dt;
 
 
{deletevehicle _x} forEach (units _group1);
    deleteGroup _group1;
 
sleep 120;
_loop_timer_01=[] spawn AI_Timer1;
deleteMarker "Inc_Zone_One";
deleteMarker "Inc_Zone_Two";
};
};
 
 
};

 
The above code has positions that are relevant to a custom map I am working are and the AO's themselves have
had their text chopped down to something generic. Since this is part of a much larger mission system I am
working on I wanted to make a generic version that you could tailor to your own tastes. Pretty much anything
you could want just needs to be added to the appropriate section or you could even work out DZMS. I previously
got permission from Vampire to modify and use his mission system in my larger A3 mod and it has been working
 as well, along side this system, and works the same if I spawn them the same way as this.
 
One thing I didn't mention above, are BE filters. You will need to take some time and work out which filters you
need to edit. I currently have a dozen things I am working on and I honestly can't remember which ones I had to adjust
to make this work. The BEC console window will tell you what rule you broke, and that will tell you what changes you 
need to make to your filters. Since any AI system you use will likely have much different code, there's no way of
knowing which filters will be affected anyways until you test it out. The above mission is more of a basic, to get 
started, mission system and really should be used to figure out how to make your own or how to edit existing systems
to work with Epoch. Be warned, though, that if you chose to retrofit an A2 mission there will be a ton of things you
need to edit to get everything working happily with A3, (like ai skins and loudouts, positions, vehicles, etc).
 
As I said before, I have tested this many times on my test server and everything seems to be working just fine, but
if its not for you guys, let's figure out what's going on! The only issue I have run into is that sometimes the 
AI wanders out of the AO. This will prompt the same reaction as killing all of the AI and a reward will spawn
as soon as the trigger sees no bandits. I am currently working on things for the ai to do other than a random patrol
and am also looking at randomizing their gear and skills and fixing the wandering issue. 
If you have a better way, just let me know and I'll gladly update the top of this post! 
Link to comment
Share on other sites

Hi,

 

 

 thx for sharing this! :)

 

i tried to do what you wrote but when starting the bat i got this :

 

 Player headlessclient connecting

>You vannot pla/edit this mission; it is dependent on downloadable content that has been deleted.A3_epoch_config

 

no idea why - checked your instructions severall times to what i have done .. i dont find the error :(

 

My epochserver is dedicated and runs (tested) 

 

 

UPDATE : gotit running .. you have to connect with a real player first then start Headless.bat. But anyway the Headlessclient is kicked direct :

 

13:25:17 NetServer: users.get failed when sending to 751779052
13:25:17 Message not sent - error 0, message ID = ffffffff, to 751779052 (headlessclient)
 
InGame the client is kicked with this message:
 
Steam ticket fail (null)
Link to comment
Share on other sites

 

Hi,

 

 

 thx for sharing this! :)

 

i tried to do what you wrote but when starting the bat i got this :

 

 Player headlessclient connecting

>You vannot pla/edit this mission; it is dependent on downloadable content that has been deleted.A3_epoch_config

 

no idea why - checked your instructions severall times to what i have done .. i dont find the error :(

 

My epochserver is dedicated and runs (tested) 

 

 

UPDATE : gotit running .. you have to connect with a real player first then start Headless.bat. But anyway the Headlessclient is kicked direct :

 

13:25:17 NetServer: users.get failed when sending to 751779052
13:25:17 Message not sent - error 0, message ID = ffffffff, to 751779052 (headlessclient)
 
InGame the client is kicked with this message:
 
Steam ticket fail (null)

 

try

arma3server.exe -client -connect=127.0.0.1 -mod=@epoch

Link to comment
Share on other sites

Keep in mind too, folks, that not everybody is going to need this at this point.  Many game servers are plenty powerful enough to run a full server just fine as they are.  Once the mod gets opened up more and we can add more AI and more scripts, then the HC system may be necessary to keep server FPS at playable levels.  But right now it's kinda overkill.  So I would advise not to go through all this work unless you really need to, like if your server box is a little long in the tooth and needs a small boost.  

Link to comment
Share on other sites

try

arma3server.exe -client -connect=127.0.0.1 -mod=@epoch

 

changed to :

 

arma3server.exe -client -password=xxxxxx -connect=127.0.0.1 -mod=@epoch

 

 

but still getting :

 

13:57:11 NetServer::SendMsg: cannot find channel #512943300, users.card=2
13:57:11 NetServer: users.get failed when sending to 512943300
13:57:11 Message not sent - error 0, message ID = ffffffff, to 512943300 (headlessclient)

 

 

 

 

UPDATE:

 

ok found the problem .. i had still the epoch.altis.pbo in my mpmission-folder ... renaming this one and using instead the unpaacked epoch.altis FOLDER let me proceed a liitle bit further. 

 

Now i am at the point to put BE filter ..:

 

 

 

14:41:59 BattlEye Server: Script Log: #0 mIcCrossHill () - #20 "HeadlessVariable = true;

14:41:59   
14:41:59   publicVariable "HeadlessVariable";
14:41:59   
14:41:59   execVm "AI_Init.sqf";
14:41:59   
14:41:59   };
14:41:59   
14:41:59   "GlobalHint" addPublicVariableEventHand"
14:41:59 Player mIcCrossHill kicked off by BattlEye: Script Restriction #20

 

sorry to bother you - but i never got so deep into ARMA&Server ...

 

any hint how & what to add to the script.txt in sc/battleye  ??

Link to comment
Share on other sites

That's likely because you're using location coords for a completely different map.  Those aren't for altis. I just rewrote the script with some altis coords and a few different loadout variables. about to test it out. However I don't think headless client in necessary to get it executed. Unless I am wrong?

 

 

If i have any success, I'll let ya know.

Link to comment
Share on other sites

Would running a HC on the same dedi work?

Or should i use a completely separate system?

 

Thanks

 

dM

 

Yes, you can use the same box, you just need to use 127.0.0.1 as the IP address. You could actually use a different box if you really needed to squeeze performance out of your dedi and just use that ip. 

 

Keep in mind too, folks, that not everybody is going to need this at this point.  Many game servers are plenty powerful enough to run a full server just fine as they are.  Once the mod gets opened up more and we can add more AI and more scripts, then the HC system may be necessary to keep server FPS at playable levels.  But right now it's kinda overkill.  So I would advise not to go through all this work unless you really need to, like if your server box is a little long in the tooth and needs a small boost.  

 

The main reason for going this route is this is exactly when you use a headless client, while building your mission at the beginning. Its near nightmare level of headaches trying to take something like A2 epoch and get everything over to the HC that needs to be there after the fact. It definitely is overkill when you are only running a small mission, but by the time you have ten different things to juggle its exponentially harder to get everything working right.

 

sorry to bother you - but i never got so deep into ARMA&Server ...

 

any hint how & what to add to the script.txt in sc/battleye  ??

 

 You can cut all your filters out at first to make sure its going to work for you. As far as how to edit? Each filter is a list of what a person is allowed to do. So Script restriction#19 means the 19th thing in the scripts.txt is not allowed or restricted. You will need to check the name as well as I think they count the first line as line zero so #19 might be the 20th line. But let's say the restriction is for addweapon. If you get the restriction error you need to find the corresponding line, and at the end of that line, add an exception. 

Each line in the file tells BE to:

not allow any player to call any script that contains any line containing the first word unless it is exactly the same in the list.

If you have any line that contains addWeapon you can copy that line and create a new filter exception in the format:

 

!"whatever line of code you have"

So adding !"player addWeapon" would allow a client to use "player addweapon"

Link to comment
Share on other sites

And yes, the coords will not work for Altis. These were done for a map that is 16,384x16,384. If they are ok with me doing so, I will pack up my files and post them here for download if need be. I wanted to make this easier, but with the restrictions currently in place I didn't want to break any rules posting up modified Epoch code. Honestly, I would cut all my be filters out of the folder, paste them somewhere safe, then make sure you can get this working before worrying about them. As I said before, this is not an easy thing to do and there are lots of steps where things can get screwed up. 

Link to comment
Share on other sites

this becomes stranger and stranger .. 

 

still having issues with script restriction #20 - just did a workaround and deleted the line .. my player connects .,

 

then i start the headlessclient and this one gets still kicked .. 

 

17:37:16 NetServer::SendMsg: cannot find channel #839025741, users.card=1
17:37:16 NetServer: users.get failed when sending to 839025741
17:37:16 Message not sent - error 0, message ID = ffffffff, to 839025741 (headlessclient)

 

 

Link to comment
Share on other sites

 

this becomes stranger and stranger .. 

 

still having issues with script restriction #20 - just did a workaround and deleted the line .. my player connects .,

 

then i start the headlessclient and this one gets still kicked .. 

 

 

 

There shouldn't be any addons in that folder at all... I have been connecting with the hc first every time before any other clients get on.

Link to comment
Share on other sites

Minor things I did based upon the 'basic HC' installation instructions:

 

1) add to ArmA3\SC\config.cfg 

// Add additional IP's if you are going to use HC's from other locations

headlessClients[] = {127.0.0.1};

 

2) add to mpmission epoch.Altis\description.ext

change maxPlayers = 100; to maxPlayers = 101;

 

3) add to mpmissions epoch.Altis\mission.sqm 

under class Groups change items=100; to items=101

add the following after the class Item99 structure

 

class Item100
{
side="LOGIC";
class Vehicles
{
items=1;
class Item0
{
position[]={10720.502,12.714643,11356.243};
id=100;
side="LOGIC";
vehicle="HeadlessClient_F";
player="PLAY CDG";
leader=1;
skill=0.60000002;
text="HC_HAL";
};
};
};
 
I have turned off BE while I test. On the 1st attempt to connect I got a signature file error on the helo folders, so I had to copy the files from my actual Arma3 folder to the proper location on my server
 
HC is now running. It connects without any other players connected and the mission does not start. It just sits and idles until a player connects.
 
If you log in as an Admin you can see HC_HAL connected as a virtual client.  
 
Now onto getting the AI to work!
 
PS: R3F logistics works pretty seamlessly with Epoch right now too! (I still have to work out the BE filters)
Link to comment
Share on other sites

What is your server rpt saying about the mission not loading? Also, do you already have your init.sqf and AI_Init.sqf? The only thing I noticed is I have 

"127.0.0.1" in my config. The original tutorial had "xxx.xxx.xxx.xxx" so replacing the xxx with 127 you might still need to keep the "" in there.

Link to comment
Share on other sites

With Horbin´s extra - i got the headlessclient also running. *thx a million* :)

 

I have also to connect first with a player - then with the headlessclient - starting with the headless client results in 

 

 Server error: Player without identity headlessclient

 

 

adding -autoinit to the startcommand did not help.

 

 

I had also to copy my local Player ARMA3/heli/addons Folder to the server .. seems the new Helimodel is not updated serverside .. 

 

Now i wait for the first mission to start - checking my map .. lets see what happen ;) 

Link to comment
Share on other sites

Yeah R3F works great, you just need to add in the classnames for the _EPOCH vehicles... I got all my trucks towing and all my helis lifting with no issues. BE filters weren't too bad to make exceptions for the Attachto.txt either.

 

 

 

So far so good on the mission script. It loaded in, just waiting on the first marker.

Link to comment
Share on other sites

Got it .. *yeah* 

 

 

now also starting the headlessclient is running .. i got direct the first mission shown as Info on the right and on the map ..

 

have to find out better positions .. first on was on the sea. Is it possible to get these randomly ? 

 

and i have also to diable BE ... scripterror #0 needs to be put into br/script.txt

Link to comment
Share on other sites

I got all my locations spawning in correctly and AI spawn on them just fine. Had to set all my own locations, but overall not a bad script.

 

One issue I'm having is im getting waypointcondition #0 restriction, which i set to 1(to log only) to see what would happen, and the script it making people spawn in at the salt flats. O.o I looked through the entire script and no where do i see a call to waypointCondition, or statement. Any ideas? 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...