-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated version 1.3.4.2 + not used C-Ram
- Loading branch information
Showing
9 changed files
with
169 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
if(!isServer)exitWith{}; | ||
|
||
private["_chance","_rand","_cram"]; | ||
|
||
_cram = _this select 0; | ||
_gatID = _this select 1; | ||
_incoming = []; | ||
_scanDis = FSG_CRAMRANGE; | ||
_engageRange = FSG_ENGAGERANGE; | ||
_radarOffset = FSG_RADAROFFSET; | ||
|
||
sleep 1; | ||
while{alive _cram}do{ | ||
sleep 1; | ||
if(FSG_USE_MAINRADAR && alive FSG_MAINRADAR_NAME)then{ | ||
_incoming = +FSG_INCOMING; | ||
}else{ | ||
if(FSG_USE_CRAMRADAR)then{ | ||
_incoming = _cram nearObjects ["MissileBase",_scanDis]; | ||
_incoming = _incoming + (_cram nearObjects ["RocketBase",_scanDis]); | ||
_incoming = _incoming + (_cram nearObjects ["ShellBase",_scanDis]); | ||
if(FSG_DEBUG)then{FSG_INCOMING = +_incoming;hint format["Incoming: %1 \n Using CRAM Radar \n CRAMs Online: %2 \n SAMs Online: %3",(count _incoming),FSG_CRAMCOUNT,FSG_SAMCOUNT]}; | ||
}else{ | ||
_incoming = []; | ||
if(FSG_DEBUG)then{FSG_INCOMING = +_incoming;hint format["Incoming: %1 \n Using CRAM Radar \n CRAMs Online: %2 \n SAMs Online: %3",(count _incoming),FSG_CRAMCOUNT,FSG_SAMCOUNT]}; | ||
}; | ||
}; | ||
|
||
if(count _incoming > _gatID)then{ | ||
_cram disableAI "TARGET"; | ||
_cram disableAI "AUTOTARGET"; | ||
sleep 0.2; | ||
_incomingRound = _incoming select _gatID; | ||
_fromTarget = _incomingRound getDir _cram; | ||
_targetDir = direction _incomingRound; | ||
if(_targetDir < _fromTarget + (_radarOffset/2) && _targetDir > _fromTarget - (_radarOffset/2) && ((getPos _incomingRound) select 2) > 30 && alive _incomingRound)then{ | ||
_cram addMagazine FSG_MAG_OVERRIDE; | ||
_cram addWeapon FSG_WEP_OVERRIDE; | ||
_cram doWatch _incomingRound; | ||
sleep 0.2; | ||
_chance = 100; | ||
_watchIdle = (getPos _cram); | ||
_watchIdle set [2, (_watchIdle select 2) + 100]; | ||
_cram doWatch _watchIdle; | ||
while{alive _incomingRound && ((getPos _incomingRound) select 2) > 50 && _chance > 0 && _cram distance _incomingRound < _engageRange}do{ | ||
_target = "Land_HelipadEmpty_F" createVehicle [0,0,0]; //Very bad but i have no idea how to do this otherwise, let me know | ||
_leadPrediction = (((_cram distance _incomingRound) / 4032) * (speed _incomingRound)) / (_cram distance _incomingRound); | ||
_zeroing = ((_cram distance _incomingRound) / 100) * 8; | ||
_target attachTo [_incomingRound,[0,_leadPrediction,_zeroing]]; | ||
_cram doWatch _target; | ||
if(alive _target && alive _incomingRound)then{ | ||
_cram fire FSG_WEP_OVERRIDE; | ||
}; | ||
//_cram fire (currentWeapon _cram); | ||
sleep 0.01; | ||
deleteVehicle _target; | ||
if(_cram distance _incomingRound < _engageRange && alive _incomingRound && _cram distance _incomingRound > 40)then{ | ||
_rand = random[0,1,2]; | ||
_chance = _chance - _rand; | ||
}; | ||
}; | ||
if(alive _incomingRound && _incomingRound distance _cram < _engageRange && _cram distance _incomingRound > 40)then{ | ||
sleep 1; | ||
_exp = "helicopterexplosmall" createVehicle getPos _incomingRound; | ||
deleteVehicle _incomingRound; | ||
}; | ||
}; | ||
_cram enableAI "TARGET"; | ||
_cram enableAI "AUTOTARGET"; | ||
}; | ||
Sleep FSG_SLEEPCYCLE; | ||
}; | ||
FSG_CRAMCOUNT = FSG_CRAMCOUNT - 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
if(!isServer)exitWith{}; | ||
//EDIT THESE | ||
|
||
FSG_CRAM_ENABLED = FALSE; | ||
FSG_DEBUG = FALSE; | ||
FSG_CRAM_GATLING_CN = "B_AAA_System_01_F"; //Classname of Gatling type CRAMs (def. Praetorian) | ||
FSG_CRAM_SAM_CN = "B_SAM_System_02_F"; //Classname of Missile type CRAMs (def. Mk21 Centurion) | ||
|
||
FSG_USE_WEPOVERRIDE = TRUE; //Use weapon override | ||
FSG_WEP_OVERRIDE = "Gatling_30mm_Plane_CAS_01_F"; //Weapon override for Gatling weapons (def. 30mm CAS) | ||
FSG_MAG_OVERRIDE = "1000Rnd_Gatling_30mm_Plane_CAS_01_F"; //Magazine override for Gatling weapons (def. 30mm CAS red tracer) | ||
|
||
FSG_USE_MAINRADAR = FALSE; //Use a single radar for all CRAMs (Reduces lag by quite alot) | ||
FSG_MAINRADAR_NAME = objNull; //Use objNull if not using. (Otherwise place radar on map and name it something) | ||
FSG_USE_CRAMRADAR = TRUE; //Use CRAMs own radar if Main not in use/destroyed | ||
FSG_INCOMING = []; //Main array to store incoming rounds (Main Radars) | ||
|
||
FSG_MAINRADAR_SCANDIS = 3000; //Main radar range | ||
FSG_CRAMRANGE = 2000; //CRAM Radar Range | ||
FSG_ENGAGERANGE = 1700; //CRAM Engage Range | ||
FSG_RADAROFFSET = 50; //Incoming must be pointing towards cram in this range to be shot down | ||
|
||
FSG_SLEEPCYCLE = 1; //Sleep control for almost everything (Increase if heavy lag) | ||
|
||
FSG_CRAMINDEX = 0; | ||
FSG_CRAMCOUNT = 0; | ||
FSG_SAMCOUNT = 0; //Counts how many Crams/Sams are online | ||
FSG_TARGETCOUNT = 0; | ||
|
||
|
||
/* | ||
if(FSG_USE_MAINRADAR)then{ | ||
_null=[FSG_MAINRADAR_NAME]spawn{ | ||
private["_radar","_scanDis","_incoming"]; | ||
_radar = _this select 0; | ||
_scanDis = FSG_MAINRADAR_SCANDIS; | ||
while{alive _radar}do{ | ||
_incoming = _radar nearObjects ["MissileBase",_scanDis]; | ||
_incoming = _incoming + (_radar nearObjects ["RocketBase",_scanDis]); | ||
_incoming = _incoming + (_radar nearObjects ["ShellBase",_scanDis]); | ||
FSG_INCOMING = +_incoming; | ||
if(FSG_DEBUG)then{hint format["Incoming: %1 \n Using Main Radar \n CRAMs Online: %2 \n SAMs Online: %3",(count FSG_INCOMING),FSG_CRAMCOUNT,FSG_SAMCOUNT]}; //Show incoming (all crams) | ||
Sleep FSG_SLEEPCYCLE; | ||
}; | ||
}; | ||
}; | ||
{ | ||
if(_x isKindOf FSG_CRAM_GATLING_CN)then{ | ||
if((side _x) == West)then{ | ||
private["_gatID"]; | ||
_gatID = FSG_CRAMCOUNT; | ||
FSG_CRAMCOUNT = FSG_CRAMCOUNT + 1; | ||
_null = [_x,_gatID] execVM "scripts\cram\cram.sqf"; | ||
}; | ||
}; | ||
} forEach vehicles; | ||
{ | ||
if(_x isKindOf FSG_CRAM_SAM_CN)then{ | ||
if((side _x) == West)then{ | ||
private["_gatID"]; | ||
_gatID = FSG_CRAMCOUNT + FSG_SAMCOUNT; | ||
FSG_SAMCOUNT = FSG_SAMCOUNT + 1; | ||
_null = [_x,_gatID] execVM "scripts\cram\sam.sqf"; | ||
}; | ||
}; | ||
} forEach vehicles;*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters