Jump to content

WAI Missions - Anti-Sniper Strategy


Cash

Recommended Posts

I'm hoping ya'll could help come up with a strategy for protecting missions using WAI from Snipers.

 

Currently, a good sniper can clear a mission by himself. This should remain possible but I'd like the AI to have some tactical response to the threat. Some of my ideas include:

 

  • Detect players out to 1,000 meters and drop paratroops on them
  • Add a very small number of AI Snipers with increased skills (would require special skill level selection)
  • Drop paratroops on them as they enter the camp to loot
  • Have a number of AI come out of hiding as they enter the camp to loot

 

I am not sure that I could code the first or second idea but the other two are easy. My question is, can you think of any other ways of addressing the problem? I want the missions to be fun and challenging but not OP. I don't want to just increase the skills and use aim bots, that's no fun and is cheating IMO. Perhaps someone could help by sharing how to detect the players world space and then using that as a variable in the drop location of the paradrop script?

 

 

Link to comment
Share on other sites

I have been thinking alot about how it would be possible to make missions sniperproof, since they can do them often without even getting any response.

 

I think one of the easiest ways to go would be to have a radius check and when the sniper gets within 50-100 meters, the paratroopers come out and you make sure the heli transporting them doesn't spawn too far. It could definitely give way for some "oh shit"-moments and it makes the missions a two-battle with long range and shorter range. My only problem has been that the paratroopers in WAI aren't always landing as accurate as I'd want them to.

 

The small number of sniper AI will either just be aimbot or not react at all. You could have every mission be accompanied with some sort of a garage and when players get close enough a beeping sound starts and the garage door slowly opens... revealing ...! :D

 

No, I think the first idea would definitely be easiest manageable and code-able! Cool you're looking for some ideas as well ^^

Link to comment
Share on other sites

What we did on our server was to add vehicle patrols of GPK's to the missions.  A good sniper can still take out the gunner but it is tough and if you get spotted you are toast.

 

I believe that the AI and the vehicle communicate, can't confirm 100% but if you were to add a heli patrol to the mission it might work well too.

 

Here's how to add a patrol to your mission.  For this example we are going to use the crashSpawner.sqf

 

 

Place this code after

] call spawn_static;  
};

 

vehicle code to insert GPK:

[[(_position select 0) + 15,(_position select 1) + 15,0],   //Position to patrol
[(_position select 0) + 1,(_position select 1) + 1,0], // Position to spawn at
200, //Radius of patrol
10,                     //Number of waypoints to give
"HMMWV_M1151_M2_DES_EP1", //Classname of vehicle (make sure it has driver and gunner)
1 //Skill level of units 
] spawn vehicle_patrol;

 

you can play around with this and add more static guns or whatever you want.  Pretty much just cut up the "static spawns" script and insert the snippets like above into your missions.  Heck you can even spawn "bases" around the missions by spawning in composites at the mission location.

Link to comment
Share on other sites

I am really interested in setting up gpk patrols on my missions. Currently I use ems and I really like those. How would I go about adding them to my missions.

 

currently to add ai my mission files call one of these 3 files:

add_unit_server.sqf

add_unit_server2.sqf

add_unit_server3.sqf

 

these i think are what i would need to add the above code to.

//Created by axeman Edited by TheSzerdi
private ["_aiunit","_xpos","_ypos","_unitpos","_aiGroup","_wppos","_wpradius","_wpnum","_levelnum","_numunits","_rndLOut","_ailoadout","_wp","_aispawnpos","_aiwep1","_aiammo1"];
 
    _aiunit = objNull;
    _aiGroup = createGroup EAST;
    _aispawnpos =_this select 0;
    _wpradius = _this select 1;
    _wpnum = _this select 2;
    _numunits = _this select 3;
    _levelnum = _this select 4;
 
    _xpos = _aispawnpos select 0;
    _ypos = _aispawnpos select 1;
 
    diag_log format ["AIUNIT: Spawn initiated: Centre:%1 | Radius in m:%2 | Waypoint number:%3 | WeaponLevel:%4",_aispawnpos,_wpradius,_wpnum,_levelnum];
 
    for [{ x=1 },{ x < _numunits+1 },{ x = x + 1; }] do
    {
        _unitpos = [_xpos+x,_ypos+x,0];
 
        if (_levelnum==0) then // in_sityes troops
        {
            if ((x == 1) || (x == 3) || (x == 5)) then //troop soldiers
            {
                "BanditW2_DZ" createUnit [_unitpos, _aiGroup, "_aiunit=this;",1,"PRIVATE"];
                _rndLOut=floor(random 4);
                _ailoadout=
                switch (_rndLOut) do
                {
                  case 0: {["M1014","8Rnd_B_Beneli_74Slug"]};
                  case 1: {["M1014","8Rnd_B_Beneli_Pellets"]};
                  case 2: {["Remington870_lamp","8Rnd_B_Beneli_74Slug"]};
                  case 3: {["Remington870_lamp","8Rnd_B_Beneli_Pellets"]};
                };
            };
            if ((x == 2) || (x == 4) || (x >= 6)) then //troops snipers
            {
                "Bandit1_DZ" createUnit [_unitpos, _aiGroup, "_aiunit=this;",1,"PRIVATE"];
                _rndLOut=floor(random 3);
                _ailoadout=
                switch (_rndLOut) do
                {
                  case 0: {["M4A1_HWS_GL_SD_Camo","30Rnd_556x45_StanagSD"]};
                  case 1: {["Huntingrifle","5x_22_LR_17_HMR"]};
                  case 2: {["M14_EP1","20Rnd_762x51_DMR"]};
                };
            };
        };
        if (_levelnum==1) then //in_military troops
        {
            if (x == 1) then //one troops comander
            {
                "GUE_Soldier_2_DZ" createUnit [_unitpos, _aiGroup, "_aiunit=this;",1,"LIEUTENANT"];
                _rndLOut=floor(random 7);
                _ailoadout=
                switch (_rndLOut) do
                {
                  case 0: {["AK_47_M","30Rnd_762x39_AK47"]};
                  case 1: {["M4A1_RCO_GL","30Rnd_556x45_Stanag"]};
                  case 2: {["Sa58P_EP1","30Rnd_762x39_SA58"]};
                  case 3: {["Sa58V_CCO_EP1","30Rnd_762x39_SA58"]};
                  case 4: {["Sa58V_EP1","30Rnd_762x39_SA58"]};
                  case 5: {["M4SPR","30Rnd_556x45_Stanag"]};
                  case 6: {["M4A1_HWS_GL_SD_Camo","30Rnd_556x45_StanagSD"]};
                };
            };
            if ((x == 2) || (x == 3)) then //troops sergeant
            {
                "Bandit1_DZ" createUnit [_unitpos, _aiGroup, "_aiunit=this;",1,"SERGEANT"];
                _rndLOut=floor(random 4);
                _ailoadout=
                switch (_rndLOut) do
                {
                  case 0: {["BAF_L85A2_RIS_SUSAT","30Rnd_556x45_Stanag"]};
                  case 1: {["RPK_74","75Rnd_545x39_RPK"]};
                  case 2: {["G36A_camo","30Rnd_556x45_G36"]};
                  case 3: {["M4A1_HWS_GL_SD_Camo","30Rnd_556x45_StanagSD"]};
                };
            };
            if (x > 3) then //troops soldiers
            {
                "GUE_Soldier_Crew_DZ" createUnit [_unitpos, _aiGroup, "_aiunit=this;",1,"CORPORAL"];
         
                _rndLOut=floor(random 5);
                _ailoadout=
                switch (_rndLOut) do
                {
                  case 0: {["SVD_CAMO","10Rnd_762x54_SVD"]};
                  case 1: {["M24","5Rnd_762x51_M24"]};
                  case 2: {["M24_des_EP1","5Rnd_762x51_M24"]};
                  case 3: {["SVD","10Rnd_762x54_SVD"]};
		  case 4: {["AK_107_pso","30Rnd_545x39_AK"]};
                };
            };
        };
        diag_log format ["AIUNIT: Creating Ins_Soldier_1 by %1 at %2. Result:%3 | Loadout:%4 / Num:%5",player,_unitpos,_aiunit,_ailoadout,_rndLOut];
 
        _aiunit enableAI "TARGET";
        _aiunit enableAI "AUTOTARGET";
        _aiunit enableAI "MOVE";
        _aiunit enableAI "ANIM";
        _aiunit enableAI "FSM";
        _aiunit allowDammage true;
  	
		_aiunit addEventHandler ['killed',{_this execVM "\z\addons\dayz_server\EMS\bodyclean.sqf"}]; //Body disappear time
 
        _aiunit setCombatMode "RED";
        _aiunit setBehaviour "COMBAT";
 
        //clear default weapons / ammo
        removeAllWeapons _aiunit;
        //add random selection
        _aiwep1 = _ailoadout select 0;
        _aiammo1 = _ailoadout select 1;
        _aiunit addweapon _aiwep1;
        _aiunit addMagazine _aiammo1;
        _aiunit addMagazine _aiammo1;
        _aiunit addMagazine _aiammo1;
		_aiunit removeWeapon "ItemRadio","NVGoggles";
      //add some garbage
        if (x == 1) then {
        _aiunit addMagazine "SmokeShellGreen";
        _aiunit addMagazine "HandGrenade_West";
        _aiunit addMagazine "FoodCanBakedBeans";
        _aiunit addMagazine "ItemSodaCoke";
        _aiunit addMagazine "ItemPainkiller";
        _aiunit addMagazine "ItemHeatPack";
        _aiunit addMagazine "ItemEpinephrine";
        _aiunit addMagazine "ItemMorphine";
        };
        if (x == 2) then {
        _aiunit addMagazine "ItemHeatPack";
        _aiunit addMagazine "ItemPainkiller";
        _aiunit addMagazine "ItemEpinephrine";
        _aiunit addMagazine "ItemMorphine";
        };
        if (x >= 3) then {
        _aiunit addMagazine "ItemHeatPack";
        _aiunit addMagazine "ItemBandage";
        };
        //set skills
        _aiunit setSkill ["aimingAccuracy",0.6];
        _aiunit setSkill ["aimingShake",0.7];
        _aiunit setSkill ["aimingSpeed",0.8];
        _aiunit setSkill ["endurance",0.9];
        _aiunit setSkill ["spotDistance",0.8];
        _aiunit setSkill ["spotTime",0.7];
        _aiunit setSkill ["courage",0.9];
        _aiunit setSkill ["reloadSpeed",0.8];
        _aiunit setSkill ["commanding",1];
        _aiunit setSkill ["general",1];
        //sleep 0.5;
    };
    //generate waypoints
    for [{ x=1 },{ x < _wpnum },{ x = x + 1; }] do {
    _wppos = [_xpos+(x*20),_ypos+(x*20),_wpradius];
    _wp = _aiGroup addWaypoint [_wppos, _wpradius];
    _wp setWaypointType "MOVE";
    };
    _wp = _aiGroup addWaypoint [[_xpos,_ypos,0], _wpradius];
    _wp setWaypointType "CYCLE";
 
    diag_log format ["AIUNIT: Last Waypoint %1 at %2",_wp,_wppos];

thats what is in the first add unit file. also you mentioned make sure it has driver and gunner? how would i do that? just make sure that other ai spawn near it to hop in? cause i currently have them set not to steal vehicles so i dont think that would work.

Link to comment
Share on other sites

I am really interested in setting up gpk patrols on my missions. Currently I use ems and I really like those. How would I go about adding them to my missions.

 

currently to add ai my mission files call one of these 3 files:

add_unit_server.sqf

add_unit_server2.sqf

add_unit_server3.sqf

 

these i think are what i would need to add the above code to.

//Created by axeman Edited by TheSzerdi
private ["_aiunit","_xpos","_ypos","_unitpos","_aiGroup","_wppos","_wpradius","_wpnum","_levelnum","_numunits","_rndLOut","_ailoadout","_wp","_aispawnpos","_aiwep1","_aiammo1"];
 
    _aiunit = objNull;
    _aiGroup = createGroup EAST;
    _aispawnpos =_this select 0;
    _wpradius = _this select 1;
    _wpnum = _this select 2;
    _numunits = _this select 3;
    _levelnum = _this select 4;
 
    _xpos = _aispawnpos select 0;
    _ypos = _aispawnpos select 1;
 
    diag_log format ["AIUNIT: Spawn initiated: Centre:%1 | Radius in m:%2 | Waypoint number:%3 | WeaponLevel:%4",_aispawnpos,_wpradius,_wpnum,_levelnum];
 
    for [{ x=1 },{ x < _numunits+1 },{ x = x + 1; }] do
    {
        _unitpos = [_xpos+x,_ypos+x,0];
 
        if (_levelnum==0) then // in_sityes troops
        {
            if ((x == 1) || (x == 3) || (x == 5)) then //troop soldiers
            {
                "BanditW2_DZ" createUnit [_unitpos, _aiGroup, "_aiunit=this;",1,"PRIVATE"];
                _rndLOut=floor(random 4);
                _ailoadout=
                switch (_rndLOut) do
                {
                  case 0: {["M1014","8Rnd_B_Beneli_74Slug"]};
                  case 1: {["M1014","8Rnd_B_Beneli_Pellets"]};
                  case 2: {["Remington870_lamp","8Rnd_B_Beneli_74Slug"]};
                  case 3: {["Remington870_lamp","8Rnd_B_Beneli_Pellets"]};
                };
            };
            if ((x == 2) || (x == 4) || (x >= 6)) then //troops snipers
            {
                "Bandit1_DZ" createUnit [_unitpos, _aiGroup, "_aiunit=this;",1,"PRIVATE"];
                _rndLOut=floor(random 3);
                _ailoadout=
                switch (_rndLOut) do
                {
                  case 0: {["M4A1_HWS_GL_SD_Camo","30Rnd_556x45_StanagSD"]};
                  case 1: {["Huntingrifle","5x_22_LR_17_HMR"]};
                  case 2: {["M14_EP1","20Rnd_762x51_DMR"]};
                };
            };
        };
        if (_levelnum==1) then //in_military troops
        {
            if (x == 1) then //one troops comander
            {
                "GUE_Soldier_2_DZ" createUnit [_unitpos, _aiGroup, "_aiunit=this;",1,"LIEUTENANT"];
                _rndLOut=floor(random 7);
                _ailoadout=
                switch (_rndLOut) do
                {
                  case 0: {["AK_47_M","30Rnd_762x39_AK47"]};
                  case 1: {["M4A1_RCO_GL","30Rnd_556x45_Stanag"]};
                  case 2: {["Sa58P_EP1","30Rnd_762x39_SA58"]};
                  case 3: {["Sa58V_CCO_EP1","30Rnd_762x39_SA58"]};
                  case 4: {["Sa58V_EP1","30Rnd_762x39_SA58"]};
                  case 5: {["M4SPR","30Rnd_556x45_Stanag"]};
                  case 6: {["M4A1_HWS_GL_SD_Camo","30Rnd_556x45_StanagSD"]};
                };
            };
            if ((x == 2) || (x == 3)) then //troops sergeant
            {
                "Bandit1_DZ" createUnit [_unitpos, _aiGroup, "_aiunit=this;",1,"SERGEANT"];
                _rndLOut=floor(random 4);
                _ailoadout=
                switch (_rndLOut) do
                {
                  case 0: {["BAF_L85A2_RIS_SUSAT","30Rnd_556x45_Stanag"]};
                  case 1: {["RPK_74","75Rnd_545x39_RPK"]};
                  case 2: {["G36A_camo","30Rnd_556x45_G36"]};
                  case 3: {["M4A1_HWS_GL_SD_Camo","30Rnd_556x45_StanagSD"]};
                };
            };
            if (x > 3) then //troops soldiers
            {
                "GUE_Soldier_Crew_DZ" createUnit [_unitpos, _aiGroup, "_aiunit=this;",1,"CORPORAL"];
         
                _rndLOut=floor(random 5);
                _ailoadout=
                switch (_rndLOut) do
                {
                  case 0: {["SVD_CAMO","10Rnd_762x54_SVD"]};
                  case 1: {["M24","5Rnd_762x51_M24"]};
                  case 2: {["M24_des_EP1","5Rnd_762x51_M24"]};
                  case 3: {["SVD","10Rnd_762x54_SVD"]};
		  case 4: {["AK_107_pso","30Rnd_545x39_AK"]};
                };
            };
        };
        diag_log format ["AIUNIT: Creating Ins_Soldier_1 by %1 at %2. Result:%3 | Loadout:%4 / Num:%5",player,_unitpos,_aiunit,_ailoadout,_rndLOut];
 
        _aiunit enableAI "TARGET";
        _aiunit enableAI "AUTOTARGET";
        _aiunit enableAI "MOVE";
        _aiunit enableAI "ANIM";
        _aiunit enableAI "FSM";
        _aiunit allowDammage true;
  	
		_aiunit addEventHandler ['killed',{_this execVM "\z\addons\dayz_server\EMS\bodyclean.sqf"}]; //Body disappear time
 
        _aiunit setCombatMode "RED";
        _aiunit setBehaviour "COMBAT";
 
        //clear default weapons / ammo
        removeAllWeapons _aiunit;
        //add random selection
        _aiwep1 = _ailoadout select 0;
        _aiammo1 = _ailoadout select 1;
        _aiunit addweapon _aiwep1;
        _aiunit addMagazine _aiammo1;
        _aiunit addMagazine _aiammo1;
        _aiunit addMagazine _aiammo1;
		_aiunit removeWeapon "ItemRadio","NVGoggles";
      //add some garbage
        if (x == 1) then {
        _aiunit addMagazine "SmokeShellGreen";
        _aiunit addMagazine "HandGrenade_West";
        _aiunit addMagazine "FoodCanBakedBeans";
        _aiunit addMagazine "ItemSodaCoke";
        _aiunit addMagazine "ItemPainkiller";
        _aiunit addMagazine "ItemHeatPack";
        _aiunit addMagazine "ItemEpinephrine";
        _aiunit addMagazine "ItemMorphine";
        };
        if (x == 2) then {
        _aiunit addMagazine "ItemHeatPack";
        _aiunit addMagazine "ItemPainkiller";
        _aiunit addMagazine "ItemEpinephrine";
        _aiunit addMagazine "ItemMorphine";
        };
        if (x >= 3) then {
        _aiunit addMagazine "ItemHeatPack";
        _aiunit addMagazine "ItemBandage";
        };
        //set skills
        _aiunit setSkill ["aimingAccuracy",0.6];
        _aiunit setSkill ["aimingShake",0.7];
        _aiunit setSkill ["aimingSpeed",0.8];
        _aiunit setSkill ["endurance",0.9];
        _aiunit setSkill ["spotDistance",0.8];
        _aiunit setSkill ["spotTime",0.7];
        _aiunit setSkill ["courage",0.9];
        _aiunit setSkill ["reloadSpeed",0.8];
        _aiunit setSkill ["commanding",1];
        _aiunit setSkill ["general",1];
        //sleep 0.5;
    };
    //generate waypoints
    for [{ x=1 },{ x < _wpnum },{ x = x + 1; }] do {
    _wppos = [_xpos+(x*20),_ypos+(x*20),_wpradius];
    _wp = _aiGroup addWaypoint [_wppos, _wpradius];
    _wp setWaypointType "MOVE";
    };
    _wp = _aiGroup addWaypoint [[_xpos,_ypos,0], _wpradius];
    _wp setWaypointType "CYCLE";
 
    diag_log format ["AIUNIT: Last Waypoint %1 at %2",_wp,_wppos];

thats what is in the first add unit file. also you mentioned make sure it has driver and gunner? how would i do that? just make sure that other ai spawn near it to hop in? cause i currently have them set not to steal vehicles so i dont think that would work.

 

 

this does not look familiar to me.  I am using WAI 1.6 from the original author.

Link to comment
Share on other sites

i am not using wai, i am using EMS, epoch mission system. my question was how to make it work with this, where in there would i put the code you provided.

 

when my EMS calls ai for missions, this is one of the files it calls, the other files are setup with only slight differences so if you could tell me how to make it work with this then i could figure out the other 2 ai files myself.

Link to comment
Share on other sites

I'm not familiar with EMS, sorry.

 

I've added base buildings, sand bag encampments, AI popping up when players get close, added vehicles, and static guns. These strategies work well but I'd still love to figure out a way to use the world space of players inside a sensor zone as a point of reference for either spawning AI or dropping paratroops (heck, maybe even dropping a bomb after playing an air raid siren lol., would be overkill but funny to test)

Link to comment
Share on other sites

How about this,

 

Line 33 of Heli_para.sqf reads

{if((isPlayer _x) AND (_x distance [(_position select 0),_position select 1),0] <= _triggerdis)) then....

I read that as If the player is <= the defined trigger distance referenced in the execute line from the spawn point of the mission then consider the player present and proceed with the code. Would this mean then that we could reference (_position select 1) as the drop point somehow?

 

Something like:

[[(_position select 0), (_position select 1),0],[(_position select 1)],800.blah blah rest of the helidrop code

I would think that the script is already defining the _position select 0 and select 1 variables for use in triggering events in the mission so why not use them again for targeting? I think I have that second example wrong but you get the idea.

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
  • Advertisement
  • Discord

×
×
  • Create New...