Hello all! I've taken the script shared by DayZ Medic in his CIWS video and heavily modified it to create a script that acts as an active protection system (APS). It can intercept rockets, missiles, and large calibre shells. The script file and the commentated code (separate file) are included in a dropbox folder. In order to use the script, copy the Trophy.sqf file into your mission folder. Then, after finding the class names of the vehicles you want to have the APS, copy and paste the following into an init.sqf file:
call compile preprocessFileLineNumbers "Trophy.sqf";
if(isServer)then{
{
if (_x isKindOf "classname") then{
[_x,15]call addToTrophy;
};
} forEach vehicles;
};
Note that this applies to every vehicle of that type, and doesn't differentiate between which faction controls it or even if it is manned. I have not tested it in a very large, complicated scenario, but do expect performance drops if you have a lot of the vehicle type you intend on giving it the APS. Additionally, it spawns an explosion when it destroys an incoming projectile, so it is a hazard to nearby infantry (true to real life), although the infantry was probably at risk anyway if they're standing next to a vehicle about to be hit by an RPG. As noted in the commentated code (readme_2.txt), the performance of the APS is dependent upon the range declared in the init.sqf (I have it as 15 meters by default), and the interval time between checks. The greater the distance and the shorter the interval time, the fewer projectiles will get through, and the faster the projectile can be and still get intercepted. With the default settings, it will reliably stop most missiles and rockets, and a projectile from a recoilless rifle (SPG-9 from the RHS mod). You can adjust these parameters to be able to stop tank rounds, but this will increase the CPU usage to run this script. Also, there is a delay between intercepting a projectile if a salvo is engaged at the same time. Thus, the best way to defeat a vehicle with the APS is to coordinate multiple launchers to shoot simultaneously, and to use the fastest projectiles available.