Skip to content

Commit

Permalink
Isolate MANPAD and IR
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCandianVendingMachine committed May 28, 2024
1 parent bcb6ed7 commit 7659e83
Show file tree
Hide file tree
Showing 12 changed files with 503 additions and 0 deletions.
1 change: 1 addition & 0 deletions addons/manpad/$PBOPREFIX$
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
z\ace\addons\manpad
90 changes: 90 additions & 0 deletions addons/manpad/CfgAmmo.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
class CfgAmmo {
class ammo_Missile_rim116;
class GVAR(rim116): ammo_Missile_rim116 {
maneuvrability = 0;
missileLockMaxSpeed = 2000;

missileLockCone = 3; // caged lock
missileKeepLockedCone = 45;
missileLockMaxDistance = 5000;
missileLockMinDistance = 250;

class ace_missileguidance {
enabled = 1;

pitchRate = 50; // Minium flap deflection for guidance
yawRate = 50; // Maximum flap deflection for guidance

canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode

// Guidance type for munitions
defaultSeekerType = "IR";
seekerTypes[] = { "IR" };

flareDistanceFilter = 100;
flareAngleFilter = 0.5; // can filter out flares that are >= flareAngleFilter to known target velocity

defaultSeekerLockMode = "LOBL";
seekerLockModes[] = { "LOBL" };

defaultNavigationType = "ZeroEffortMiss";
navigationTypes[] = { "ZeroEffortMiss" };

seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos]
seekerAngle = 45; // Angle from the shooter's view that can track the missile
seekerAccuracy = 0.8; // seeker accuracy multiplier

seekerMinRange = 75;
seekerMaxRange = 5000; // Range from the missile which the seeker can visually search

// Attack profile type selection
defaultAttackProfile = "DIR";
attackProfiles[] = {"DIR"};
};
};

class M_70mm_SAAMI;
class GVAR(stinger): M_70mm_SAAMI {
maneuvrability = 0;
missileLockMaxSpeed = 2000;

missileLockCone = 3; // caged lock
missileKeepLockedCone = 45;
missileLockMaxDistance = 5000;
missileLockMinDistance = 250;

class ace_missileguidance {
enabled = 1;

pitchRate = 42; // Minium flap deflection for guidance
yawRate = 42; // Maximum flap deflection for guidance

canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode

// Guidance type for munitions
defaultSeekerType = "IR";
seekerTypes[] = { "IR" };

flareDistanceFilter = 100;
flareAngleFilter = 1.3; // can filter out flares that are >= flareAngleFilter to known target velocity

defaultSeekerLockMode = "LOBL";
seekerLockModes[] = { "LOBL" };

defaultNavigationType = "AugmentedProportionalNavigation";
navigationTypes[] = { "AugmentedProportionalNavigation" };

seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos]
seekerAngle = 45; // Angle from the shooter's view that can track the missile
seekerAccuracy = 0.8; // seeker accuracy multiplier

seekerMinRange = 75;
seekerMaxRange = 5000; // Range from the missile which the seeker can visually search

// Attack profile type selection
defaultAttackProfile = "DIR";
attackProfiles[] = {"DIR"};
};
};
};

22 changes: 22 additions & 0 deletions addons/manpad/CfgMagazines.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
class CfgMagazines {
class magazine_Missile_rim116_x21;
class GVAR(rim116): magazine_Missile_rim116_x21 {
author = "Dani (TCVM)";
displayName = CSTRING(rim116_21x);
ammo = QGVAR(rim116);
};

class 4Rnd_70mm_SAAMI_missiles;
class GVAR(stinger): 4Rnd_70mm_SAAMI_missiles {
author = "Dani (TCVM)";
displayName = CSTRING(stinger_4x);
ammo = QGVAR(stinger);
};

class Titan_AA;
class GVAR(stinger_man): Titan_AA {
author = "Dani (TCVM)";
displayName = CSTRING(stinger);
ammo = QGVAR(stinger);
};
};
108 changes: 108 additions & 0 deletions addons/manpad/CfgVehicles.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
class CfgVehicles {
class LandVehicle;
class StaticWeapon: LandVehicle {
class Turrets;
};
class StaticMGWeapon: StaticWeapon {
class Turrets: Turrets {
class MainTurret;
};
};

class SAM_System_01_base_F: StaticMGWeapon {
class AnimationSources {
class Missiles_revolving {
source = "revolving";
weapon = QGVAR(rim116);
};
};

class Turrets: Turrets {
class MainTurret: MainTurret {
weapons[] = {QGVAR(rim116)};
magazines[] = {QGVAR(rim116)};
};
};
};

class Tank;
class Tank_F: Tank {
class Turrets {
class MainTurret;
};
};
class LT_01_base_F: Tank_F {
class AnimationSources;
class Turrets: Turrets {};
};

class LT_01_AA_base_F: LT_01_base_F {
class AnimationSources: AnimationSources {
class Missiles_revolving {
source = "revolving";
weapon = QGVAR(FIM92);
};
};

class Turrets: Turrets {
class MainTurret: MainTurret {
weapons[] = {"SmokeLauncher", QGVAR(FIM92), "HMG_127"};
magazines[] = {
"SmokeLauncherMag",
QGVAR(stinger),
QGVAR(stinger),
"100Rnd_127x99_mag_Tracer_Red",
"100Rnd_127x99_mag_Tracer_Red",
"100Rnd_127x99_mag_Tracer_Red",
"100Rnd_127x99_mag_Tracer_Red"
};
};
};
};

class APC_Tracked_01_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {};
};
};
class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {
class AnimationSources;
};
class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F {
class AnimationSources: AnimationSources {
class Missiles_revolving {
source = "revolving";
weapon = QGVAR(FIM92);
};
};
class Turrets: Turrets {
class MainTurret: MainTurret {
weapons[] = {"autocannon_35mm", QGVAR(FIM92)};
magazines[] = {"680Rnd_35mm_AA_shells_Tracer_Red", QGVAR(stinger), QGVAR(stinger)};
};
};
};

class APC_Tracked_02_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {};
};
};
class O_APC_Tracked_02_base_F: APC_Tracked_02_base_F {
class AnimationSources;
};
class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F {
class AnimationSources: AnimationSources {
class Missiles_revolving {
source = "revolving";
weapon = QGVAR(FIM92);
};
};
class Turrets: Turrets {
class MainTurret: MainTurret {
weapons[] = {"autocannon_35mm", QGVAR(FIM92)};
magazines[] = {"680Rnd_35mm_AA_shells_Tracer_Green", QGVAR(stinger), QGVAR(stinger)};
};
};
};
};
23 changes: 23 additions & 0 deletions addons/manpad/CfgWeapons.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class CfgWeapons {
class weapon_rim116Launcher;
class GVAR(rim116): weapon_rim116Launcher {
author = "Dani (TCVM)";
displayName = CSTRING(rim116);
magazines[] = { QGVAR(rim116) };
weaponLockDelay = 0.5;
};

class missiles_SAAMI;
class GVAR(FIM92): missiles_SAAMI {
author = "Dani (TCVM)";
displayName = CSTRING(stinger);
magazines[] = { QGVAR(stinger) };
weaponLockDelay = 0.5;
};

class Launcher_Base_F;
class launch_Titan_base: Launcher_Base_F {
magazines[] = {QGVAR(stinger_man)};
};
};

12 changes: 12 additions & 0 deletions addons/manpad/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ace_manpad
===================

Adds missile guidance to all vanilla MANPAD systems


## Maintainers

The people responsible for merging changes to this component or answering potential questions.

- [Dani-TCVM](https://github.com/TheCandianVendingMachine)

21 changes: 21 additions & 0 deletions addons/manpad/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "script_component.hpp"

class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common","ace_missileguidance"};
author = ECSTRING(common,ACETeam);
authors[] = {"Dani (TCVM)"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};

#include "CfgAmmo.hpp"
#include "CfgMagazines.hpp"
#include "CfgWeapons.hpp"
#include "CfgVehicles.hpp"

18 changes: 18 additions & 0 deletions addons/manpad/script_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#define COMPONENT manpad
#define COMPONENT_BEAUTIFIED MANPAD
#include "\z\ace\addons\main\script_mod.hpp"

// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS

#ifdef DEBUG_ENABLED_MANPAD
#define DEBUG_MODE_FULL
#endif

#ifdef DEBUG_SETTINGS_MANPAD
#define DEBUG_SETTINGS DEBUG_SETTINGS_MANPAD
#endif

#include "\z\ace\addons\main\script_macros.hpp"

17 changes: 17 additions & 0 deletions addons/manpad/stringtable.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="MANPAD">
<Key ID="STR_ACE_MANPAD_stinger">
<English>FIM-92 Stinger [ACE]</English>
</Key>
<Key ID="STR_ACE_MANPAD_rim116">
<English>RIM-116 [ACE]</English>
</Key>
<Key ID="STR_ACE_MANPAD_rim116_21x">
<English>21x RIM-116 [ACE]</English>
</Key>
<Key ID="STR_ACE_MANPAD_stinger_4x">
<English>4x FIM-92 Stinger [ACE]</English>
</Key>
</Package>
</Project>
8 changes: 8 additions & 0 deletions addons/missileguidance/ACE_GuidanceConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ class GVAR(SeekerTypes) {
functionName = QFUNC(seekerType_MWR);
onFired = QFUNC(mwr_onFired);
};
class IR {
name = "";
visualName = "";
description = "";

functionName = QFUNC(seekerType_IR);
onFired = QFUNC(IR_onFired);
};
};

class GVAR(NavigationTypes) {
Expand Down
29 changes: 29 additions & 0 deletions addons/missileguidance/functions/fnc_IR_onFired.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "..\script_component.hpp"
/*
* Author: tcvm
* Sets up IR state arrays (called from missileGuidance's onFired).
*
* Arguments:
* Guidance Arg Array <ARRAY>
*
* Return Value:
* None
*
* Example:
* [] call ace_missileguidance_fnc_IR_onFired
*
* Public: No
*/
params ["_firedEH", "_launchParams", "", "", "_stateParams"];
_firedEH params ["_shooter","_weapon","","","","","_projectile"];
_stateParams params ["", "_seekerStateParams"];
_launchParams params ["", "_targetLaunchParams"];
_targetLaunchParams params ["_target"];

private _flareDistanceFilter = getNumber (configOf _projectile >> QUOTE(ADDON) >> "flareDistanceFilter");
private _flareAngleFilter = getNumber (configOf _projectile >> QUOTE(ADDON) >> "flareAngleFilter");

_seekerStateParams set [0, _flareDistanceFilter];
_seekerStateParams set [1, _flareAngleFilter];
_seekerStateParams set [2, _target];

Loading

0 comments on commit 7659e83

Please sign in to comment.