First port of AGM_FireControlSystem -> ace_fcs

Untested
This commit is contained in:
KoffeinFlummi 2015-01-12 11:02:44 +01:00
parent 877fef16be
commit e02e058ecb
22 changed files with 791 additions and 1299 deletions

View File

@ -1,257 +0,0 @@
#define MACRO_RANGERFINDER \
class CA_Distance; \
class AGM_CA_Distance: CA_Distance { \
idc = 1713151; \
text = "----"; \
}; \
class AGM_Rangehelper: RscMapControl { \
onDraw = "((ctrlParent (_this select 0)) displayCtrl 1713151) ctrlShow (cameraView == 'GUNNER');"; \
w = 0; \
h = 0; \
};
class RscControlsGroup;
class RscMapControl;
class RscInGameUI {
class RscUnitInfo;
class RscUnitInfo_AH64D_gunner {
onLoad = "";
controls[] = {"CA_Distance", "AGM_CA_Distance"};
MACRO_RANGERFINDER
};
class RscWeaponRangeFinder {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "AGM_CA_Distance"};
MACRO_RANGERFINDER
};
//class RscWeaponRangeArtillery
//class RscWeaponRangeArtilleryAuto
class RscWeaponRangeFinderPAS13 {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
MACRO_RANGERFINDER
};
class RscOptics_Rangefinder: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_LaserDesignator {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscWeaponRangeFinderMAAWS {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscWeaponRangeFinderAbramsCom {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "AGM_CA_Distance"};
MACRO_RANGERFINDER
};
class RscWeaponRangeFinderAbramsGun {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "AGM_CA_Distance"};
MACRO_RANGERFINDER
};
class RscWeaponRangeFinderStrykerMGSGun {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "AGM_CA_Distance"};
MACRO_RANGERFINDER
};
class RscOptics_crows: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_strider_commander {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscWeaponRangeZeroing: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
controls[] = {"CA_Zeroing", "CA_DistanceText", "CA_Distance", "AGM_CA_Distance", "AGM_Rangehelper"};
MACRO_RANGERFINDER
};
class RscOptics_sos: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_nightstalker: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_tws: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_punisher {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_tws_sniper: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_SDV_periscope {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_Heli_Attack_02_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_Heli_Attack_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_UAV_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_UGV_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_APC_Tracked_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_APC_Tracked_03_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_APC_Wheeled_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_APC_Wheeled_03_commander: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_APC_Wheeled_03_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_MBT_01_commander: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_MBT_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_MBT_02_commander: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_MBT_02_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
class RscOptics_MBT_03_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGERFINDER
};
};
};
};

View File

@ -1,3 +0,0 @@
AGM_FCSEnabled = true;
AGM_FCSTime = -1;
AGM_FCSPosition = [0,0,0];

View File

@ -1,899 +0,0 @@
class CfgPatches {
class AGM_FireControlSystem {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core, AGM_Interaction};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"KoffeinFlummi","BadGuy (simon84)"};
authorUrl = "https://github.com/KoffeinFlummi/";
};
};
// @todo: clean up inheritance and remove old code
class CfgFunctions {
class AGM_FCS {
class AGM_FCS {
file = "AGM_FireControlSystem\functions";
class adjustRange;
class canUseFCS;
class canUseRangefinder;
class firedEH;
class getAngle;
class getImpactPoint;
class getRange;
class keyDown;
class keyUp;
class reset;
class vehicleInit;
};
};
};
class Extended_PostInit_EventHandlers {
class AGM_FCS {
clientInit = "call compile preprocessFileLineNumbers '\AGM_FireControlSystem\clientInit.sqf'";
};
};
class Extended_Init_EventHandlers {
class AllVehicles {
class AGM_FCS {
clientInit = "_this call AGM_FCS_fnc_vehicleInit";
};
};
};
class AGM_Core_Default_Keys {
class laseTarget {
displayName = "$STR_AGM_FireControlSystem_LaseTarget";
condition = "call AGM_FCS_fnc_canUseRangefinder || AGM_FCS_fnc_canUseFCS";
statement = "_range = call AGM_FCS_fnc_getRange; if (call AGM_FCS_fnc_canUseFCS) then {[_vehicle, _range] call AGM_FCS_fnc_keyDown};";
conditionUp = "AGM_FCSEnabled && AGM_FCS_fnc_canUseFCS";
statementUp = "_range = call AGM_FCS_fnc_getRange; if (AGM_FCSEnabled && AGM_FCS_fnc_canUseFCS) then {[_vehicle, _range] call AGM_FCS_fnc_keyUp};";
key = 15;
shift = 0;
control = 0;
alt = 0;
};
class adjustRangeUp {
displayName = "$STR_AGM_FireControlSystem_AdjustRangeUp";
condition = "player == gunner _vehicle && {getNumber (configFile >> 'CfgVehicles' >> (typeOf _vehicle) >> 'AGM_FCSEnabled') == 1}";
statement = "[_vehicle, 50] call AGM_FCS_fnc_adjustRange";
key = 201;
shift = 0;
control = 0;
alt = 0;
allowHolding = 1;
};
class adjustRangeDown: adjustRangeUp {
displayName = "$STR_AGM_FireControlSystem_AdjustRangeDown";
statement = "[_vehicle, -50] call AGM_FCS_fnc_adjustRange";
key = 209;
};
};
class CfgVehicles {
class All {
class Turrets;
};
class AllVehicles: All {
AGM_FCSEnabled = 0;
AGM_FCSMinDistance = 200;
AGM_FCSMaxDistance = 9990;
AGM_FCSDistanceInterval = 5;
class NewTurret {
class Turrets;
};
class CargoTurret;
};
class Land: AllVehicles {};
class LandVehicle: Land {
class CommanderOptics;
};
class Car: LandVehicle {
class AGM_SelfActions {
class AGM_ResetFCS {
displayName = "$STR_AGM_FireControlSystem_ResetFCS";
condition = "(count (vehicle _player getVariable ['AGM_FCSMagazines', []]) > 1) and (_player == gunner (vehicle _player))";
statement = "[vehicle _player] call AGM_FCS_fnc_reset;";
showDisabled = 0;
priority = -1;
};
};
};
class Tank: LandVehicle {
AGM_FCSEnabled = 1; // all tracked vehicles get one by default
class AGM_SelfActions {
class AGM_ResetFCS {
displayName = "$STR_AGM_FireControlSystem_ResetFCS";
enableInside = 1;
condition = "(count (_vehicle getVariable ['AGM_FCSMagazines', []]) > 1) and (_player == gunner _vehicle)";
statement = "[vehicle _player] call AGM_FCS_fnc_reset;";
showDisabled = 0;
priority = 1;
icon = "";
};
};
class Turrets {
class MainTurret: NewTurret {
class Turrets {
class CommanderOptics;
};
};
};
};
class APC: Tank {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
};
class Air: AllVehicles {};
class Helicopter: Air {
class Turrets {
class MainTurret;
};
};
class Plane: Air {};
class Ship: AllVehicles {
class Turrets {
class MainTurret;
};
};
class Helicopter_Base_F: Helicopter {
class Turrets: Turrets {
class CopilotTurret;
};
};
class Helicopter_Base_H: Helicopter_Base_F {
class Turrets: Turrets {
class CopilotTurret;
};
};
class Heli_Light_01_base_F: Helicopter_Base_H {
/*class Turrets: Turrets {
class CopilotTurret: CopilotTurret {};
};*/
};
class B_Heli_Light_01_F: Heli_Light_01_base_F {
/*class Turrets: Turrets {
class CopilotTurret: CopilotTurret {};
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
class CargoTurret_03: CargoTurret_02 {};
class CargoTurret_04: CargoTurret_01 {};
};*/
};
class Heli_Light_01_armed_base_F: Heli_Light_01_base_F {
/*class Turrets: Turrets {
class CopilotTurret: CopilotTurret {};
};*/
};
class Heli_Light_02_base_F: Helicopter_Base_H {
/*class Turrets: Turrets {
class CopilotTurret: CopilotTurret {};
};*/
};
class Plane_Base_F: Plane {
class Turrets {
class CopilotTurret;
};
};
class Heli_Attack_01_base_F: Helicopter_Base_F {
AGM_FCSEnabled = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
class Heli_Attack_02_base_F: Helicopter_Base_F {
AGM_FCSEnabled = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
class Heli_Transport_01_base_F: Helicopter_Base_H {
/*class Turrets: Turrets {
class CopilotTurret: CopilotTurret {};
class MainTurret: MainTurret {};
class RightDoorGun: MainTurret {};
};*/
};
class Heli_Transport_02_base_F: Helicopter_Base_H {
/*class Turrets: Turrets {
class CopilotTurret: CopilotTurret {};
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};*/
};
class I_Heli_light_03_base_F: Helicopter_Base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
};
class I_Heli_light_03_F: I_Heli_light_03_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};*/
};
class Plane_CAS_01_base_F: Plane_Base_F {
class Turrets;
};
class Plane_CAS_02_base_F: Plane_Base_F {
class Turrets;
};
class Plane_Fighter_03_base_F: Plane_Base_F {
class Turrets;
};
class Tank_F: Tank {
class Turrets {
class MainTurret: NewTurret {
class Turrets {
class CommanderOptics;//: CommanderOptics {};
};
};
};
};
class Car_F: Car {
class Turrets {
class MainTurret;
};
};
class Wheeled_APC_F: Car_F {
class Turrets {
class MainTurret: NewTurret {
class Turrets {
class CommanderOptics;//: CommanderOptics {};
};
};
};
};
class APC_Tracked_01_base_F: Tank_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {
class Turrets;
};
};*/
};
class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
};
class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F {
AGM_FCSEnabled = 0;
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
class CommanderOptics: CommanderOptics {};
};*/
};
class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F {
AGM_FCSEnabled = 0;
};
class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
magazines[] += {"AGM_120Rnd_35mm_ABM_shells_Tracer_Red"};
/*class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};*/
};
};
};
class APC_Tracked_02_base_F: Tank_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};
};
};*/
};
class O_APC_Tracked_02_base_F: APC_Tracked_02_base_F {};
class O_APC_Tracked_02_cannon_F: O_APC_Tracked_02_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
};
class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
magazines[] += {"AGM_120Rnd_35mm_ABM_shells_Tracer_Green"};
/*class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};*/
};
};
};
class APC_Tracked_03_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
/*class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};*/
};
};
};
class MBT_03_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
/*class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};*/
};
};
};
class MBT_01_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
/*class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};*/
};
};
};
class B_MBT_01_base_F: MBT_01_base_F {};
class B_MBT_01_cannon_F: B_MBT_01_base_F {};
class MBT_01_arty_base_F: MBT_01_base_F {
AGM_FCSEnabled = 0;
/*class Turrets: Turrets {
class MainTurret: MainTurret {
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};
};
};*/
};
class MBT_01_mlrs_base_F: MBT_01_base_F {
AGM_FCSEnabled = 0;
/*class Turrets: Turrets {
class MainTurret: MainTurret {
class Turrets;
};
};*/
};
class MBT_02_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
/*class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};*/
};
};
};
class MBT_02_arty_base_F: MBT_02_base_F {
AGM_FCSEnabled = 0;
/*class Turrets: Turrets {
class MainTurret: MainTurret {
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};
};
};*/
};
class Ship_F: Ship {};
class Boat_F: Ship_F {};
class Boat_Armed_01_base_F: Boat_F {
class Turrets: Turrets {
class FrontTurret;
class RearTurret: FrontTurret {};
};
};
/*class Boat_Armed_01_minigun_base_F: Boat_Armed_01_base_F {
class Turrets: Turrets {
class FrontTurret: FrontTurret {};
class RearTurret: RearTurret {};
};
};*/
class Truck_F: Car_F {
//class Turrets: Turrets {};
};
class MRAP_01_base_F: Car_F {};
class MRAP_01_gmg_base_F: MRAP_01_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
};
class MRAP_01_hmg_base_F: MRAP_01_gmg_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
};
class B_MRAP_01_F: MRAP_01_base_F {
class Turrets;
};
class MRAP_02_base_F: Car_F {};
class MRAP_02_hmg_base_F: MRAP_02_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
};
class MRAP_02_gmg_base_F: MRAP_02_hmg_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
};
class O_MRAP_02_F: MRAP_02_base_F {
class Turrets;
};
class Offroad_01_base_F: Car_F {};
class C_Offroad_01_F: Offroad_01_base_F {
/*class Turrets: Turrets {
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
class CargoTurret_03: CargoTurret_01 {};
class CargoTurret_04: CargoTurret_03 {};
};*/
};
class Offroad_01_repair_base_F: Offroad_01_base_F {
class Turrets;
};
class I_G_Offroad_01_F: Offroad_01_base_F {
/*class Turrets: Turrets {
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
class CargoTurret_03: CargoTurret_01 {};
class CargoTurret_04: CargoTurret_03 {};
};*/
};
class Offroad_01_armed_base_F: Offroad_01_base_F {
/*class Turrets: Turrets {
class M2_Turret: MainTurret {};
};*/
};
class MRAP_03_base_F: Car_F {
/*class Turrets: Turrets {
class CommanderTurret: MainTurret {};
};*/
};
class MRAP_03_hmg_base_F: MRAP_03_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
class CommanderTurret: CommanderTurret {};
};*/
};
class MRAP_03_gmg_base_F: MRAP_03_hmg_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
class CommanderTurret: CommanderTurret {};
};*/
};
class Truck_01_base_F: Truck_F {
class Turrets;
};
class B_Truck_01_transport_F: Truck_01_base_F {
/*class Turrets: Turrets {
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};*/
};
class Truck_02_base_F: Truck_F {
class Turrets;
};
class O_Truck_02_covered_F: Truck_02_base_F {
/*class Turrets: Turrets {
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};*/
};
class O_Truck_02_transport_F: Truck_02_base_F {
/*class Turrets: Turrets {
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};*/
};
class I_Truck_02_covered_F: Truck_02_base_F {
/*class Turrets: Turrets {
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};*/
};
class I_Truck_02_transport_F: Truck_02_base_F {
/*class Turrets: Turrets {
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};*/
};
class Truck_03_base_F: Truck_F {
class Turrets;
};
class O_Truck_03_transport_F: Truck_03_base_F {
/*class Turrets: Turrets {
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};*/
};
class O_Truck_03_covered_F: Truck_03_base_F {
/*class Turrets: Turrets {
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};*/
};
class Hatchback_01_base_F: Car_F {
class Turrets;
};
class SUV_01_base_F: Car_F {
class Turrets;
};
class B_Truck_01_mover_F: B_Truck_01_transport_F {
class Turrets;
};
class Van_01_base_F: Truck_F {
class Turrets;
};
class C_Van_01_transport_F: Van_01_base_F {
//class Turrets: Turrets {};
};
class I_G_Van_01_transport_F: Van_01_base_F {
/*class Turrets: Turrets {
class CargoTurret_L1: CargoTurret {};
class CargoTurret_L2: CargoTurret_L1 {};
class CargoTurret_L3: CargoTurret_L1 {};
class CargoTurret_L4: CargoTurret_L1 {};
class CargoTurret_L5: CargoTurret_L1 {};
class CargoTurret_R1: CargoTurret_L1 {};
class CargoTurret_R2: CargoTurret_L1 {};
class CargoTurret_R3: CargoTurret_L1 {};
class CargoTurret_R4: CargoTurret_L1 {};
class CargoTurret_R5: CargoTurret_L1 {};
};*/
};
class Kart_01_Base_F: Car_F {
class Turrets;
};
class B_Heli_Transport_03_base_F: Helicopter_Base_H {
/*class Turrets: Turrets {
class CopilotTurret: CopilotTurret {};
class MainTurret: MainTurret {};
class RightDoorGun: MainTurret {};
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};*/
};
class B_Heli_Transport_03_unarmed_base_F: B_Heli_Transport_03_base_F {
/*class Turrets: Turrets {
class CopilotTurret: CopilotTurret {};
class MainTurret: MainTurret {};
class RightDoorGun: MainTurret {};
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};*/
};
class Heli_Transport_04_base_F: Helicopter_Base_H {
/*class Turrets: Turrets {
class CopilotTurret: CopilotTurret {};
class LoadmasterTurret: MainTurret {};
};*/
};
class O_Heli_Transport_04_bench_F: Heli_Transport_04_base_F {
/*class Turrets: Turrets {
class CopilotTurret: CopilotTurret {};
class LoadmasterTurret: LoadmasterTurret {};
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
class CargoTurret_03: CargoTurret_01 {};
class CargoTurret_04: CargoTurret_01 {};
class CargoTurret_05: CargoTurret_01 {};
class CargoTurret_06: CargoTurret_05 {};
class CargoTurret_07: CargoTurret_05 {};
class CargoTurret_08: CargoTurret_05 {};
};*/
};
class O_Heli_Transport_04_covered_F: Heli_Transport_04_base_F {
/*class Turrets: Turrets {
class CopilotTurret: CopilotTurret {};
class LoadmasterTurret: LoadmasterTurret {};
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};*/
};
class APC_Wheeled_01_base_F: Wheeled_APC_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};
};
};*/
};
class B_APC_Wheeled_01_base_F: APC_Wheeled_01_base_F {};
class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F {
AGM_FCSEnabled = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
class APC_Wheeled_02_base_F: Wheeled_APC_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {
class Turrets;
};
class CommanderOptics: CommanderOptics {};
};*/
};
class B_MBT_01_TUSK_F: B_MBT_01_cannon_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
/*class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};*/
};
};
};
class APC_Wheeled_03_base_F: Wheeled_APC_F {
AGM_FCSEnabled = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
/*class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};*/
};
};
};
class I_APC_Wheeled_03_base_F: APC_Wheeled_03_base_F {};
class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
};
};
// disable locking, so it doesn't interfere with our system
class CfgWeapons {
class CannonCore;
class cannon_120mm: CannonCore {
canLock = 0;
ballisticsComputer = 0;
};
class autocannon_Base_F: CannonCore {
canLock = 0;
ballisticsComputer = 0;
};
class autocannon_35mm: CannonCore {
canLock = 0;
ballisticsComputer = 0;
magazines[] += {"AGM_120Rnd_35mm_ABM_shells","AGM_120Rnd_35mm_ABM_shells_Tracer_Red","AGM_120Rnd_35mm_ABM_shells_Tracer_Green","AGM_120Rnd_35mm_ABM_shells_Tracer_Yellow"};
};
/*class Cannon_30mm_Plane_CAS_02_F: CannonCore {
canLock = 0;
ballisticsComputer = 0;
};*/
/*class gatling_20mm: CannonCore {
canLock = 0;
ballisticsComputer = 0;
};
class gatling_25mm: CannonCore {
canLock = 0;
};
class gatling_30mm: CannonCore {
canLock = 0;
ballisticsComputer = 0;
};
class Gatling_30mm_Plane_CAS_01_F: CannonCore {
canLock = 0;
ballisticsComputer = 0;
};*/
/*class MGunCore;
class M134_minigun: MGunCore {
canLock = 0;
};
class MGun: MGunCore {};
class LMG_RCWS: MGun {
canLock = 0;
ballisticsComputer = 0;
};
class HMG_127: LMG_RCWS {
ballisticsComputer = 0;
};
class GMG_F: MGun {
canLock = 0;
ballisticsComputer = 0;
};*/
// fix mrco having an invisible rangefinder
class ItemCore;
class optic_MRCO: ItemCore {
weaponInfoType = "RscWeaponZeroing";
};
};
class CfgMagazines {
class 680Rnd_35mm_AA_shells;
class 680Rnd_35mm_AA_shells_Tracer_Red;
class 680Rnd_35mm_AA_shells_Tracer_Green;
class 680Rnd_35mm_AA_shells_Tracer_Yellow;
class AGM_120Rnd_35mm_ABM_shells: 680Rnd_35mm_AA_shells {
ammo = "AGM_B_35mm_ABM";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM";
};
class AGM_120Rnd_35mm_ABM_shells_Tracer_Red: 680Rnd_35mm_AA_shells_Tracer_Red {
ammo = "AGM_B_35mm_ABM_Tracer_Red";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM-T";
};
class AGM_120Rnd_35mm_ABM_shells_Tracer_Green: 680Rnd_35mm_AA_shells_Tracer_Green {
ammo = "AGM_B_35mm_ABM_Tracer_Green";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM-T";
};
class AGM_120Rnd_35mm_ABM_shells_Tracer_Yellow: 680Rnd_35mm_AA_shells_Tracer_Yellow {
ammo = "AGM_B_35mm_ABM_Tracer_Yellow";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM-T";
};
};
class CfgAmmo {
class B_35mm_AA;
class B_35mm_AA_Tracer_Red;
class B_35mm_AA_Tracer_Green;
class B_35mm_AA_Tracer_Yellow;
class AGM_B_35mm_ABM: B_35mm_AA {
AGM_Airburst = 1;
deflecting = 0;
};
class AGM_B_35mm_ABM_Tracer_Red: B_35mm_AA_Tracer_Red {
AGM_Airburst = 1;
deflecting = 0;
};
class AGM_B_35mm_ABM_Tracer_Green: B_35mm_AA_Tracer_Green {
AGM_Airburst = 1;
deflecting = 0;
};
class AGM_B_35mm_ABM_Tracer_Yellow: B_35mm_AA_Tracer_Yellow {
AGM_Airburst = 1;
deflecting = 0;
};
class AGM_B_35mm_ABM_Helper: B_35mm_AA {
indirectHitRange = 6;
simulation = "shotRocket";
timeToLive = 0;
};
};
#include <Optics.hpp>

View File

@ -1,14 +0,0 @@
/*
* Author: commy2
*
* Called from config. Returns true if the player is a gunner and the players current vehicle has a FCS.
*
* Argument:
* Nothing
*
* Return value:
* Boolean (Bool)
*/
_player == gunner _vehicle && {getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_FCSEnabled") == 1}
&& {cameraView == "GUNNER"}

View File

@ -1,36 +0,0 @@
/*
* Author: KoffeinFlummi
*
* Gets the impact point if the given bomb were to be dropped at the
* the current time from the given vehicle.
*
* !!! Experimental !!!
*
* Arguments:
* 0: Vehicle
* 1: Classname of bomb
*
* Return Value:
* Coordinates of hit in ATL
*/
_vehicle = _this select 0;
_projectile = _this select 1;
_velocity = velocity (_vehicle);
_position = getPosASL _vehicle;
_airFriction = getNumber (configFile >> "CfgAmmo" >> _projectile >> "airFriction");
_simulationStep = getNumber (configFile >> "CfgAmmo" >> _projectile >> "simulationStep");
_timeToLive = getNumber (configFile >> "CfgAmmo" >> _projectile >> "timeToLive");
_time = 0;
while {_time < _timeToLive and (ASLToATL _position) select 2 > 0} do {
_position = _position vectorAdd (_velocity vectorMultiply _simulationStep);
_velMag = vectorMagnitude _velocity;
_velocity = _velocity vectorAdd (_velocity vectorMultiply (_simulationStep * _velMag * _airFriction));
_velocity set [2, (_velocity select 2) - 9.81 * _simulationStep];
_time = _time + _simulationStep;
};
_position

View File

@ -1,22 +0,0 @@
/*
* Author: KoffeinFlummi
*
* Resets the FCS to default.
*
* Arguments:
* 0: Vehicle
*
* Return Value:
* none
*/
private ["_vehicle"];
_vehicle = _this select 0;
_vehicle setVariable ["AGM_FCSDistance", 0, true];
_vehicle setVariable ["AGM_FCSMagazines", [], true];
_vehicle setVariable ["AGM_FCSElevation", 0, true];
_vehicle setVariable ["AGM_FCSAzimuth", 0, true];
[localize "STR_AGM_FireControlSystem_HasBeenReset"] call AGM_Core_fnc_displayTextStructured;

254
addons/fcs/Optics.hpp Normal file
View File

@ -0,0 +1,254 @@
#define MACRO_RANGEFINDER \
class CA_Distance; \
class ACE_CA_Distance: CA_Distance { \
idc = 1713151; \
text = "----"; \
}; \
class ACE_Rangehelper: RscMapControl { \
onDraw = "((ctrlParent (_this select 0)) displayCtrl 1713151) ctrlShow (cameraView == 'GUNNER');"; \
w = 0; \
h = 0; \
};
class RscControlsGroup;
class RscMapControl;
class RscInGameUI {
class RscUnitInfo;
class RscUnitInfo_AH64D_gunner {
onLoad = "";
controls[] = {"CA_Distance", "ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscWeaponRangeFinder {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscWeaponRangeFinderPAS13 {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
MACRO_RANGEFINDER
};
class RscOptics_Rangefinder: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_LaserDesignator {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscWeaponRangeFinderMAAWS {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscWeaponRangeFinderAbramsCom {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscWeaponRangeFinderAbramsGun {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscWeaponRangeFinderStrykerMGSGun {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscOptics_crows: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_strider_commander {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscWeaponRangeZeroing: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
controls[] = {"CA_Zeroing", "CA_DistanceText", "CA_Distance", "ACE_CA_Distance", "ACE_Rangehelper"};
MACRO_RANGEFINDER
};
class RscOptics_sos: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_nightstalker: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_tws: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_punisher {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_tws_sniper: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_SDV_periscope {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_Heli_Attack_02_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_Heli_Attack_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_UAV_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_UGV_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_APC_Tracked_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_APC_Tracked_03_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_APC_Wheeled_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_APC_Wheeled_03_commander: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_APC_Wheeled_03_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_MBT_01_commander: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_MBT_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_MBT_02_commander: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_MBT_02_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_MBT_03_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};

View File

@ -0,0 +1,5 @@
#include "script_component.hpp"
GVAR(enabled) = True;
GVAR(time) = True;
GVAR(position) = True;

View File

@ -0,0 +1,12 @@
#include "script_component.hpp"
PREPF(adjustRange)
PREPF(canUseFCS)
PREPF(canUseRangefinder)
PREPF(firedEH)
PREPF(getAngle)
PREPF(getRange)
PREPF(keyDown)
PREPF(keyUp)
PREPF(reset)
PREPF(vehicleInit)

385
addons/fcs/config.cpp Normal file
View File

@ -0,0 +1,385 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {ace_core, ace_interaction};
version = "1.0";
versionStr = "1.0";
versionAr[] = {1,0,0};
author[] = {"KoffeinFlummi","BadGuy (simon84)"};
authorUrl = "https://github.com/KoffeinFlummi/";
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE(call compile preprocessFileLineNumbers PATHTOF(XEH_clientInit.sqf));
};
};
class Extended_Init_EventHandlers {
class AllVehicles {
class ADDON {
clientInit = QUOTE(_this call FUNC(vehicleInit));
};
};
};
class EGVAR(Core, Default_Keys) {
class laseTarget {
displayName = $STR_ACE_FireControlSystem_LaseTarget;
condition = QUOTE(call FUNC(canUseRangefinder) || FUNC(canUseFCS));
statement = QUOTE(_range = call FUNC(getRange); if (call FUNC(canUseFCS)) then {[_vehicle, _range] call FUNC(keyDown)};);
conditionUp = QUOTE(GVAR(enabled) && FUNC(canUseFCS));
statementUp = QUOTE(_range = call FUNC(getRange); if (GVAR(enabled) && FUNC(canUseFCS)) then {[_vehicle, _range] call FUNC(keyUp)};);
key = 15;
shift = 0;
control = 0;
alt = 0;
};
class adjustRangeUp {
displayName = $STR_ACE_FireControlSystem_AdjustRangeUp;
condition = QUOTE(ACE_player == gunner _vehicle && {getNumber (configFile >> 'CfgVehicles' >> (typeOf _vehicle) >> QGVAR(Enabled)) == 1});
statement = QUOTE([_vehicle, 50] call FUNC(adjustRange));
key = 201;
shift = 0;
control = 0;
alt = 0;
allowHolding = 1;
};
class adjustRangeDown: adjustRangeUp {
displayName = $STR_ACE_FireControlSystem_AdjustRangeDown;
statement = QUOTE([_vehicle, -50] call FUNC(adjustRange));
key = 209;
};
};
class CfgVehicles {
class All {
class Turrets;
};
class AllVehicles: All {
GVAR(Enabled) = 0;
GVAR(MinDistance) = 200;
GVAR(MaxDistance) = 9990;
GVAR(DistanceInterval) = 5;
class NewTurret {
class Turrets;
};
class CargoTurret;
};
class Land: AllVehicles {};
class LandVehicle: Land {
class CommanderOptics;
};
// WHEELED
class Car: LandVehicle {
class ACE_SelfActions {
class ResetFCS {
displayName = $STR_AGM_FireControlSystem_ResetFCS;
enableInside = 1;
condition = QUOTE((count (_vehicle getVariable [QGVAR(Magazines), []]) > 1) and (_player == gunner _vehicle));
statement = QUOTE([vehicle _player] call FUNC(reset););
showDisabled = 0;
priority = 1;
icon = "";
};
};
};
class Car_F: Car {
class Turrets {
class MainTurret;
};
};
class Wheeled_APC_F: Car_F {
class Turrets {
class MainTurret: NewTurret {
class Turrets {
class CommanderOptics;
};
};
};
};
class APC_Wheeled_01_base_F: Wheeled_APC_F {};
class B_APC_Wheeled_01_base_F: APC_Wheeled_01_base_F {};
class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F {
GVAR(Enabled) = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
class APC_Wheeled_03_base_F: Wheeled_APC_F {
GVAR(Enabled) = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
// TRACKED
class Tank: LandVehicle {
GVAR(Enabled) = 1; // all tracked vehicles get one by default
class ACE_SelfActions {
class ResetFCS {
displayName = $STR_AGM_FireControlSystem_ResetFCS;
enableInside = 1;
condition = QUOTE((count (_vehicle getVariable [QGVAR(Magazines), []]) > 1) and (_player == gunner _vehicle));
statement = QUOTE([vehicle _player] call FUNC(reset););
showDisabled = 0;
priority = 1;
icon = "";
};
};
class Turrets {
class MainTurret: NewTurret {
class Turrets {
class CommanderOptics;
};
};
};
};
class Tank_F: Tank {
class Turrets {
class MainTurret: NewTurret {
class Turrets {
class CommanderOptics;
};
};
};
};
class MBT_01_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
class B_MBT_01_base_F: MBT_01_base_F {};
class B_MBT_01_cannon_F: B_MBT_01_base_F {};
class B_MBT_01_TUSK_F: B_MBT_01_cannon_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
class MBT_01_arty_base_F: MBT_01_base_F {
GVAR(Enabled) = 0;
};
class MBT_01_mlrs_base_F: MBT_01_base_F {
GVAR(Enabled) = 0;
};
class MBT_02_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
class MBT_02_arty_base_F: MBT_02_base_F {
GVAR(Enabled) = 0;
};
class MBT_03_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
class APC_Tracked_01_base_F: Tank_F {};
class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {};
class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F {
GVAR(Enabled) = 0;
};
class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F {
GVAR(Enabled) = 0;
};
class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
magazines[] += {"ACE_120Rnd_35mm_ABM_shells_Tracer_Red"};
};
};
};
class APC_Tracked_02_base_F: Tank_F {};
class O_APC_Tracked_02_base_F: APC_Tracked_02_base_F {};
class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
magazines[] += {"ACE_120Rnd_35mm_ABM_shells_Tracer_Green"};
};
};
};
class APC_Tracked_03_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
// HELICOPTERS
class Air: AllVehicles {};
class Helicopter: Air {
class ACE_SelfActions {
class ResetFCS {
displayName = $STR_AGM_FireControlSystem_ResetFCS;
enableInside = 1;
condition = QUOTE((count (_vehicle getVariable [QGVAR(Magazines), []]) > 1) and (_player == gunner _vehicle));
statement = QUOTE([vehicle _player] call FUNC(reset););
showDisabled = 0;
priority = 1;
icon = "";
};
};
class Turrets {
class MainTurret;
};
};
class Helicopter_Base_F: Helicopter {
class Turrets: Turrets {
class CopilotTurret;
};
};
class Heli_Attack_01_base_F: Helicopter_Base_F {
GVAR(Enabled) = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
class Heli_Attack_02_base_F: Helicopter_Base_F {
GVAR(Enabled) = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
};
class CfgWeapons {
// disable locking, so it doesn't interfere with our system
class CannonCore;
class cannon_120mm: CannonCore {
canLock = 0;
ballisticsComputer = 0;
};
class autocannon_Base_F: CannonCore {
canLock = 0;
ballisticsComputer = 0;
};
class autocannon_35mm: CannonCore {
canLock = 0;
ballisticsComputer = 0;
magazines[] += {"ACE_120Rnd_35mm_ABM_shells","ACE_120Rnd_35mm_ABM_shells_Tracer_Red","ACE_120Rnd_35mm_ABM_shells_Tracer_Green","ACE_120Rnd_35mm_ABM_shells_Tracer_Yellow"};
};
// fix mrco having an invisible rangefinder
class ItemCore;
class optic_MRCO: ItemCore {
weaponInfoType = "RscWeaponZeroing";
};
};
class CfgMagazines {
class 680Rnd_35mm_AA_shells;
class 680Rnd_35mm_AA_shells_Tracer_Red;
class 680Rnd_35mm_AA_shells_Tracer_Green;
class 680Rnd_35mm_AA_shells_Tracer_Yellow;
class ACE_120Rnd_35mm_ABM_shells: 680Rnd_35mm_AA_shells {
ammo = "ACE_B_35mm_ABM";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM";
};
class ACE_120Rnd_35mm_ABM_shells_Tracer_Red: 680Rnd_35mm_AA_shells_Tracer_Red {
ammo = "ACE_B_35mm_ABM_Tracer_Red";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM-T";
};
class ACE_120Rnd_35mm_ABM_shells_Tracer_Green: 680Rnd_35mm_AA_shells_Tracer_Green {
ammo = "ACE_B_35mm_ABM_Tracer_Green";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM-T";
};
class ACE_120Rnd_35mm_ABM_shells_Tracer_Yellow: 680Rnd_35mm_AA_shells_Tracer_Yellow {
ammo = "ACE_B_35mm_ABM_Tracer_Yellow";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM-T";
};
};
class CfgAmmo {
class B_35mm_AA;
class B_35mm_AA_Tracer_Red;
class B_35mm_AA_Tracer_Green;
class B_35mm_AA_Tracer_Yellow;
class ACE_B_35mm_ABM: B_35mm_AA {
GVAR(Airburst) = 1;
deflecting = 0;
};
class ACE_B_35mm_ABM_Tracer_Red: B_35mm_AA_Tracer_Red {
GVAR(Airburst) = 1;
deflecting = 0;
};
class ACE_B_35mm_ABM_Tracer_Green: B_35mm_AA_Tracer_Green {
GVAR(Airburst) = 1;
deflecting = 0;
};
class ACE_B_35mm_ABM_Tracer_Yellow: B_35mm_AA_Tracer_Yellow {
GVAR(Airburst) = 1;
deflecting = 0;
};
class ACE_B_35mm_ABM_Helper: B_35mm_AA {
indirectHitRange = 6;
simulation = "shotRocket";
timeToLive = 0;
};
};
#include <Optics.hpp>

View File

@ -11,17 +11,19 @@
* None
*/
#include "script_component.hpp"
private ["_vehicle", "_delta", "_min", "_max", "_distance"];
_vehicle = _this select 0;
_delta = _this select 1;
_min = getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "AGM_FCSMinDistance");
_max = getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "AGM_FCSMaxDistance");
_distance = _vehicle getVariable ["AGM_FCSDistance", _min];
_min = getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> QGVAR(MinDistance));
_max = getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> QGVAR(MaxDistance));
_distance = _vehicle getVariable [QGVAR(Distance), _min];
_distance = _distance + _delta;
_distance = _distance min _max;
_distance = _distance max _min;
[_vehicle, 0, _distance] call AGM_FCS_fnc_keyUp;
[_vehicle, 0, _distance] call FUNC(keyUp);

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
*
* Called from config. Returns true if the player is a gunner and the players current vehicle has a FCS.
*
* Argument:
* Nothing
*
* Return value:
* Boolean (Bool)
*/
#include "script_component.hpp"
_player == gunner _vehicle
&& {getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(Enabled)) == 1}
&& {cameraView == "GUNNER"}

View File

@ -10,5 +10,7 @@
* Boolean (Bool)
*/
!isNull ((uiNamespace getVariable ["AGM_dlgRangefinder", displayNull]) displayCtrl 1713151)
#include "script_component.hpp"
!isNull ((uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]) displayCtrl 1713151)
&& {cameraView == "GUNNER"}

View File

@ -10,6 +10,8 @@
* None
*/
#include "script_component.hpp"
private ["_unit", "_weaponType", "_ammoType", "_magazineType", "_round", "_FCSMagazines", "_FCSElevation", "_offset"];
_unit = _this select 0;
@ -18,10 +20,10 @@ _ammoType = _this select 4;
_magazineType = _this select 5;
_round = _this select 6;
_FCSMagazines = _unit getVariable "AGM_FCSMagazines";
_FCSElevation = _unit getVariable "AGM_FCSElevation";
_FCSMagazines = _unit getVariable QGVAR(Magazines);
_FCSElevation = _unit getVariable QGVAR(Elevation);
if (AGM_player != gunner _unit) exitWith {};
if (ACE_player != gunner _unit) exitWith {};
if !(_magazineType in _FCSMagazines) exitWith {};
// GET ELEVATION OFFSET OF CURRENT MAGAZINE
@ -32,15 +34,16 @@ _offset = 0;
};
} forEach _FCSMagazines;
[_round, (_unit getVariable "AGM_FCSAzimuth"), _offset, 0] call AGM_Core_fnc_changeProjectileDirection;
[_round, (_unit getVariable QGVAR(Azimuth)), _offset, 0] call EFUNC(core, changeProjectileDirection);
// Air burst missile
if (getNumber (configFile >> "CfgAmmo" >> _ammoType >> "AGM_Airburst") == 1) then {
// may need to get rewritten
if (getNumber (configFile >> "CfgAmmo" >> _ammoType >> "ACE_Airburst") == 1) then {
_this spawn {
_vehicle = _this select 0;
_projectile = _this select 6;
_distance = _vehicle getVariable ["AGM_FCSDistance", currentZeroing _vehicle];
_distance = _vehicle getVariable [QGVAR(Distance), currentZeroing _vehicle];
if (_distance < 50) exitWith {};
if (_distance > 1500) exitWith {};
@ -50,7 +53,7 @@ if (getNumber (configFile >> "CfgAmmo" >> _ammoType >> "AGM_Airburst") == 1) the
_position = getPosATL _projectile;
_subMunition = createVehicle ["AGM_B_35mm_ABM_Helper", _position, [], 0, "FLY"];
_subMunition = createVehicle ["ACE_B_35mm_ABM_Helper", _position, [], 0, "FLY"];
_subMunition setPosATL _position;
_subMunition setVelocity [0, 0, -10];

View File

@ -16,6 +16,7 @@
* offset from the current angle necessary to hit the target
*/
#include "script_component.hpp"
#define PRECISION 0.1
private ["_distance","_angleTarget","_maxElev","_initSpeed","_airFriction","_timeToLive","_timeToLive","_simulationStep","_angle","_posTargetX","_posTargetY","_posX","_posY","_velocityX","_velocityY","_velocityMagnitude"];
@ -30,7 +31,7 @@ _simulationStep = _this select 6;
if (_simulationStep == 0) exitWith {_angleTarget};
AGM_FCS_traceBullet = {
FUNC(traceBullet) = {
private ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle", "_posTargetX", "_posTargetY", "_posX", "_posY", "_velocityX", "_velocityY", "_velocityMagnitude"];
_distance = _this select 0;
@ -67,17 +68,17 @@ AGM_FCS_traceBullet = {
_posY - _posTargetY
};
if ((_this + [_maxElev]) call AGM_FCS_traceBullet < 0) exitWith {_maxElev - _angleTarget};
if ((_this + [_maxElev]) call FUNC(traceBullet) < 0) exitWith {_maxElev - _angleTarget};
// Newton Method / Secand Method
_angle1 = _angleTarget;
_angle2 = _maxElev;
_it2 = 0;
_f1 = (_this + [_angle1]) call AGM_FCS_traceBullet;
_f1 = (_this + [_angle1]) call FUNC(traceBullet);
if ((abs _f1) <= PRECISION) exitWith {0};
while {(abs _f1) > PRECISION} do {
_f2 = (_this + [_angle2]) call AGM_FCS_traceBullet;
_f2 = (_this + [_angle2]) call FUNC(traceBullet);
_temp = _angle2-_f2*(_angle2-_angle1)/(_f2-_f1);
_angle1 = _angle2;
_angle2 = _temp;

View File

@ -10,10 +10,12 @@
* Measured distance (Number)
*/
#include "script_component.hpp"
private ["_dlgRangefinder", "_range"];
disableSerialization;
_dlgRangefinder = uiNamespace getVariable ["AGM_dlgRangefinder", displayNull];
_dlgRangefinder = uiNamespace getVariable ["ACE_dlgRangefinder", displayNull];
_range = ctrlText (_dlgRangefinder displayCtrl 151);
(_dlgRangefinder displayCtrl 1713151) ctrlSetText _range;

View File

@ -10,21 +10,23 @@
* none
*/
#include "script_component.hpp"
private ["_vehicle", "_distance", "_weaponDirection"];
_vehicle = _this select 0;
_distance = _this select 1;
AGM_FCSEnabled = true;
AGM_FCSTime = time;
GVAR(Enabled) = true;
GVAR(Time) = time;
if (_distance == 0) then {
_distance = [5, 5000, 0] call AGM_Core_fnc_getTargetDistance; // maximum distance: 5000m, 5m precision
_distance = [5, 5000, 0] call EFUNC(core, getTargetDistance); // maximum distance: 5000m, 5m precision
};
_weaponDirection = _vehicle weaponDirection currentWeapon _vehicle;
AGM_FCSPosition = [
GVAR(Position) = [
(getPos _vehicle select 0) + _distance * (_weaponDirection select 0),
(getPos _vehicle select 1) + _distance * (_weaponDirection select 1),
(getPos _vehicle select 2) + _distance * (_weaponDirection select 2)

View File

@ -11,6 +11,8 @@
* none
*/
#include "script_component.hpp"
private ["_ammoType", "_viewDiff", "_posArrival", "_airFriction", "_timeToLive", "_maxElev", "_vehicle", "_posTarget", "_distance", "_simulationStep", "_posX", "_velocityMagnitude", "_magazines", "_movingAzimuth", "_FCSElevation", "_velocityX", "_velocityY", "_weaponDirection", "_velocityTarget", "_FCSAzimuth", "_FCSMagazines", "_dirArrival", "_i", "_magazineType", "_angleTarget", "_offset", "_timeToTarget", "_initSpeed"];
_vehicle = _this select 0;
@ -20,10 +22,10 @@ _magazines = magazines _vehicle;
if (_distance == 0) then {
_distance = [
getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_FCSDistanceInterval"),
getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_FCSMaxDistance"),
getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_FCSMinDistance")
] call AGM_Core_fnc_getTargetDistance; // maximum distance: 5000m, 5m precision
getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(DistanceInterval)),
getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(MaxDistance)),
getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(MinDistance))
] call EFUNC(core, getTargetDistance); // maximum distance: 5000m, 5m precision
};
_weaponDirection = _vehicle weaponDirection currentWeapon _vehicle;
@ -33,13 +35,13 @@ if (count _this > 2) then {
_distance = _this select 2;
};
if (!(isNil "AGM_FCS_backgroundCalculation") and {!(scriptDone AGM_FCS_backgroundCalculation)}) then {
terminate AGM_FCS_backgroundCalculation;
if (!(isNil QGVAR(backgroundCalculation)) and {!(scriptDone GVAR(backgroundCalculation))}) then {
terminate GVAR(backgroundCalculation);
};
// MOVING TARGETS
_movingAzimuth = 0;
if (time - AGM_FCSTime > 1 and AGM_FCSTime != -1 and count _this < 3) then {
if (time - GVAR(time) > 1 and GVAR(time) != -1 and count _this < 3) then {
// calculate speed of target
_posTarget = [
(getPos _vehicle select 0) + _distance * (_weaponDirection select 0),
@ -47,9 +49,9 @@ if (time - AGM_FCSTime > 1 and AGM_FCSTime != -1 and count _this < 3) then {
(getPos _vehicle select 2) + _distance * (_weaponDirection select 2)
];
_velocityTarget = [
((_posTarget select 0) - (AGM_FCSPosition select 0)) / (time - AGM_FCSTime),
((_posTarget select 1) - (AGM_FCSPosition select 1)) / (time - AGM_FCSTime),
((_posTarget select 2) - (AGM_FCSPosition select 2)) / (time - AGM_FCSTime)
((_posTarget select 0) - (GVAR(position) select 0)) / (time - GVAR(time)),
((_posTarget select 1) - (GVAR(position) select 1)) / (time - GVAR(time)),
((_posTarget select 2) - (GVAR(position) select 2)) / (time - GVAR(time))
];
// estimate time to target
@ -92,11 +94,11 @@ if (time - AGM_FCSTime > 1 and AGM_FCSTime != -1 and count _this < 3) then {
_distance = floor (_posArrival distance (getPos _vehicle));
};
};
AGM_FCSEnabled = false;
AGM_FCSTime = -1;
GVAR(enabled) = false;
GVAR(time) = -1;
// CALCULATE AZIMUTH CORRECTION
_viewDiff = _vehicle getVariable "AGM_FCSViewDiff";
_viewDiff = _vehicle getVariable QGVAR(ViewDiff);
_FCSAzimuth = _movingAzimuth;
if (_viewDiff != 0) then {
_FCSAzimuth = (atan (_distance / _viewDiff) - (abs _viewDiff / _viewDiff) * 90) + _movingAzimuth;
@ -115,19 +117,19 @@ if !(getText (configFile >> "CfgAmmo" >> _ammoType >> "simulation") == "shotMiss
_timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive");
_simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep");
_offset = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep] call AGM_FCS_fnc_getAngle;
_offset = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep] call FUNC(getAngle);
_FCSMagazines = _FCSMagazines + [_magazineType];
_FCSElevation = _FCSElevation + [_offset];
};
_vehicle setVariable ["AGM_FCSDistance", _distance, true];
_vehicle setVariable ["AGM_FCSMagazines", _FCSMagazines, true];
_vehicle setVariable ["AGM_FCSElevation", _FCSElevation, true];
_vehicle setVariable ["AGM_FCSAzimuth", _FCSAzimuth, true];
_vehicle setVariable [QGVAR(Distance), _distance, true];
_vehicle setVariable [QGVAR(Magazines), _FCSMagazines, true];
_vehicle setVariable [QGVAR(Elevation), _FCSElevation, true];
_vehicle setVariable [QGVAR(Azimuth), _FCSAzimuth, true];
// CALCULATE OFFSETS FOR OTHER WEAPONS IN THE BACKGROUND
AGM_FCS_backgroundCalculation = [_vehicle, _magazines, _distance, _angleTarget, _FCSMagazines, _FCSElevation] spawn {
GVAR(backgroundCalculation) = [_vehicle, _magazines, _distance, _angleTarget, _FCSMagazines, _FCSElevation] spawn {
_vehicle = _this select 0;
_magazines = _this select 1;
_distance = _this select 2;
@ -145,7 +147,7 @@ AGM_FCS_backgroundCalculation = [_vehicle, _magazines, _distance, _angleTarget,
_timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive");
_simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep");
_offset = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep] call AGM_FCS_fnc_getAngle;
_offset = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep] call FUNC(getAngle);
_FCSMagazines = _FCSMagazines + [_x];
_FCSElevation = _FCSElevation + [_offset];
@ -153,8 +155,8 @@ AGM_FCS_backgroundCalculation = [_vehicle, _magazines, _distance, _angleTarget,
};
} forEach _magazines;
_vehicle setVariable ["AGM_FCSMagazines", _FCSMagazines, true];
_vehicle setVariable ["AGM_FCSElevation", _FCSElevation, true];
_vehicle setVariable [QGVAR(Magazines), _FCSMagazines, true];
_vehicle setVariable [QGVAR(Elevation), _FCSElevation, true];
};
[format ["%1: %2", localize "STR_AGM_FireControlSystem_ZeroedTo", _distance]] call AGM_Core_fnc_displayTextStructured;
[format ["%1: %2", localize "STR_ACE_FireControlSystem_ZeroedTo", _distance]] call EFUNC(core, displayTextStructured);

View File

@ -0,0 +1,24 @@
/*
* Author: KoffeinFlummi
*
* Resets the FCS to default.
*
* Arguments:
* 0: Vehicle
*
* Return Value:
* none
*/
#include "script_component.hpp"
private ["_vehicle"];
_vehicle = _this select 0;
_vehicle setVariable [QGVAR(Distance), 0, true];
_vehicle setVariable [QGVAR(Magazines), [], true];
_vehicle setVariable [QGVAR(Elevation), 0, true];
_vehicle setVariable [QGVAR(Azimuth), 0, true];
[localize "STR_ACE_FireControlSystem_HasBeenReset"] call EFUNC(core, displayTextStructured);

View File

@ -12,13 +12,13 @@
private ["_gunBeg", "_gunnerView", "_gunBegPos", "_gunnerViewPos", "_viewDiff"];
if (getNumber (configFile >> "CfgVehicles" >> (typeOf (_this select 0)) >> "AGM_FCSEnabled") == 1) then {
(_this select 0) addEventHandler ["Fired", {_this call AGM_FCS_fnc_firedEH}];
if (getNumber (configFile >> "CfgVehicles" >> (typeOf (_this select 0)) >> QGVAR(Enabled)) == 1) then {
(_this select 0) addEventHandler ["Fired", {_this call FUNC(firedEH)}];
(_this select 0) setVariable ["AGM_FCSDistance", 0, true];
(_this select 0) setVariable ["AGM_FCSMagazines", [], true];
(_this select 0) setVariable ["AGM_FCSElevation", [], true];
(_this select 0) setVariable ["AGM_FCSAzimuth", 0, true];
(_this select 0) setVariable [QGVAR(Distance), 0, true];
(_this select 0) setVariable [QGVAR(Magazines), [], true];
(_this select 0) setVariable [QGVAR(Elevation), [], true];
(_this select 0) setVariable [QGVAR(Azimuth), 0, true];
// calculate offset between gunner camera and muzzle position
if !((_this select 0) isKindOf "Air") then {
@ -27,8 +27,8 @@ if (getNumber (configFile >> "CfgVehicles" >> (typeOf (_this select 0)) >> "AGM_
_gunBegPos = ((_this select 0) selectionPosition _gunBeg) select 0;
_gunnerViewPos = ((_this select 0) selectionPosition _gunnerView) select 0;
_viewDiff = _gunBegPos - _gunnerViewPos;
(_this select 0) setVariable ["AGM_FCSViewDiff", _viewDiff, true];
(_this select 0) setVariable [QGVAR(ViewDiff), _viewDiff, true];
} else {
(_this select 0) setVariable ["AGM_FCSViewDiff", 0, true];
(_this select 0) setVariable [QGVAR(ViewDiff), 0, true];
};
};

View File

@ -0,0 +1,12 @@
#define COMPONENT fcs
#include "\z\ace\Addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_FCS
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_FCS
#define DEBUG_SETTINGS DEBUG_SETTINGS_FCS
#endif
#include "\z\ace\Addons\main\script_macros.hpp"

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-19 -->
<Project name="AGM">
<Package name="FireControlSystem">
<Key ID="STR_AGM_FireControlSystem_LaseTarget">
<Project name="ACE">
<Package name="FCS">
<Key ID="STR_ACE_FCS_LaseTarget">
<English>Lase Target / Measure Distance</English>
<German>Ziel anlasern / Entfernung Messen</German>
<French>Télémétrer la cible</French>
@ -17,7 +17,7 @@
-->
<Russian>Подсветить цель / Измерить расстояние</Russian>
</Key>
<Key ID="STR_AGM_FireControlSystem_ZeroedTo">
<Key ID="STR_ACE_FCS_ZeroedTo">
<English>Zeroed To</English>
<German>Haltepunkt</German>
<Spanish>Fijado a</Spanish>
@ -29,7 +29,7 @@
<Portuguese>Fixado em</Portuguese>
<Italian>Azzeramento a</Italian>
</Key>
<Key ID="STR_AGM_FireControlSystem_AdjustRangeUp">
<Key ID="STR_ACE_FCS_AdjustRangeUp">
<English>Adjust FCS Range (Up)</English>
<German>Entfernung des FLS erhöhen</German>
<Polish>Zwiększ zasięg FCS</Polish>
@ -41,7 +41,7 @@
<Italian>Aumentare la distanza dell'FCS</Italian>
<Russian>Диапазон СУО (Выше)</Russian>
</Key>
<Key ID="STR_AGM_FireControlSystem_AdjustRangeDown">
<Key ID="STR_ACE_FCS_AdjustRangeDown">
<English>Adjust FCS Range (Down)</English>
<German>Entfernung des FLS verringern</German>
<Polish>Zmniejsz zasięg FCS</Polish>
@ -53,7 +53,7 @@
<Italian>Ridurre la distanza dell'FCS</Italian>
<Russian>Диапазон СУО (Ниже)</Russian>
</Key>
<Key ID="STR_AGM_FireControlSystem_ResetFCS">
<Key ID="STR_ACE_FCS_ResetFCS">
<English>Reset FCS</English>
<German>FLS zurücksetzen</German>
<Spanish>Reiniciar FCS</Spanish>
@ -65,7 +65,7 @@
<Italian>Azzeramento dell'FCS</Italian>
<Russian>Обнулить СУО</Russian>
</Key>
<Key ID="STR_AGM_FireControlSystem_HasBeenReset">
<Key ID="STR_ACE_FCS_HasBeenReset">
<English>FCS has been reset.</English>
<German>FLS wurde zurückgesetzt.</German>
<Spanish>FCS reiniciado</Spanish>