Merge pull request #677 from acemod/titanCompat

Titan static & variant compatability with missile guidance
This commit is contained in:
jaynus 2015-04-18 10:32:57 -07:00
commit 1d908c2f70
14 changed files with 128 additions and 117 deletions

View File

@ -0,0 +1,32 @@
class CfgVehicles {
class LandVehicle;
class StaticWeapon : LandVehicle {
class Turrets;
};
class StaticMGWeapon : StaticWeapon {
class Turrets : Turrets {
class MainTurret;
};
};
class AT_01_base_F: StaticMGWeapon {
class Turrets : Turrets {
class MainTurret : MainTurret {
weapons[] = { "missiles_titan_static_at" };
magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"};
turretInfoType = "ACE_RscOptics_javelin";
gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d);
opticsZoomMin = 0.08333;
opticsZoomMax = 0.04167;
opticsZoomInit = 0.08333;
opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
opticsFlare = 0;
discretefov[] = {0.08333,0.04167};
discreteInitIndex = 0;
};
};
};
};

View File

@ -1,17 +1,38 @@
class CfgWeapons {
class Launcher;
class MissileLauncher;
class Launcher_Base_F : Launcher {
class WeaponSlotsInfo;
};
};
// @TODO: AA by default, motherfuckers
class missiles_titan : MissileLauncher {
};
class launch_Titan_base : Launcher_Base_F {
class missiles_titan_at : missiles_titan {
weaponInfoType = "ACE_RscOptics_javelin";
modelOptics = PATHTOF(data\reticle_titan.p3d);
canLock = 1;
canLock = 0;
magazines[] = {"1Rnd_GAT_missiles"};
lockingTargetSound[] = {"",0,1};
lockedTargetSound[] = {"",0,1};
};
class missiles_titan_static_at : missiles_titan_at { };
// @TODO: AA by default, motherfuckers
class launch_Titan_base : Launcher_Base_F {};
class launch_Titan_short_base : launch_Titan_base {
weaponInfoType = "ACE_RscOptics_javelin";
modelOptics = PATHTOF(data\reticle_titan.p3d);
canLock = 0;
lockingTargetSound[] = {"",0,1};
lockedTargetSound[] = {"",0,1};
lockedTargetSound[] = {"",0,1};
};
};

View File

@ -255,9 +255,9 @@ class RscInGameUI {
idc = 6999;
x = "SafezoneX";
y = "SafezoneY";
w = "SafezoneW";
h = "SafezoneH";
y = "SafezoneY";
w = "SafezoneW";
h = "SafezoneH";
enabled = 0;
class Controls {

View File

@ -13,4 +13,5 @@ class CfgPatches {
#include "CfgEventhandlers.hpp"
#include "RscInGameUI.hpp"
#include "CfgSounds.hpp"
#include "CfgWeapons.hpp"
#include "CfgWeapons.hpp"
#include "CfgVehicles.hpp"

View File

@ -6,7 +6,10 @@ PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
// Bail on not missile
if( _shooter != ACE_player) exitWith { false };
if( ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "launch_Titan_base"] call EFUNC(common,inheritsFrom)) ) exitWith { };
if( ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "launch_Titan_short_base"] call EFUNC(common,inheritsFrom))
&&
{ ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "missiles_titan_at"] call EFUNC(common,inheritsFrom)) }
) exitWith { };
_pfh_handle = uiNamespace getVariable ["ACE_RscOptics_javelin_PFH", nil];
if(!isNil "_pfh_handle") then {

View File

@ -30,13 +30,18 @@ _soundTime = _args select 4;
_randomLockInterval = _args select 5;
_fireDisabledEH = _args select 6;
if( ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "launch_Titan_base"] call EFUNC(common,inheritsFrom)) ) exitWith {
if( ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "launch_Titan_short_base"] call EFUNC(common,inheritsFrom))
&&
{ ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "missiles_titan_at"] call EFUNC(common,inheritsFrom)) }
) exitWith {
__JavelinIGUITargeting ctrlShow false;
__JavelinIGUITargetingGate ctrlShow false;
__JavelinIGUITargetingLines ctrlShow false;
__JavelinIGUITargetingConstraints ctrlShow false;
_fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire);
if(!isNil "_fireDisabledEH") then {
_fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire);
};
[(_this select 1)] call cba_fnc_removePerFrameHandler;
uiNamespace setVariable["ACE_RscOptics_javelin_PFH", nil];
@ -55,13 +60,21 @@ if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} &&
// bail on not loaded
if (ACE_player ammo (currentWeapon ACE_player) == 0) exitWith { };
if( (vehicle ACE_player) != ACE_player) then {
if( (vehicle player) magazineTurretAmmo ["1Rnd_GAT_missiles", [0]] < 1) exitWith {
TRACE_1("No turret ammo, exit", "");
};
} else {
if (ACE_player ammo (currentWeapon ACE_player) < 1 ) exitWith {
TRACE_1("No ammo, exit", "");
};
};
_range = parseNumber (ctrlText __JavelinIGUIRangefinder);
TRACE_1("Viewing range", _range);
if (_range > 50 && {_range < 2500}) then {
_pos = positionCameraToWorld [0,0,_range];
_targetArray = _pos nearEntities ["AllVehicles", _range/25];
_targetArray = _pos nearEntities ["AllVehicles", _range/100];
TRACE_1("Searching at range", _targetArray);
if (count (_targetArray) > 0) then {
_newTarget = _targetArray select 0;
@ -144,6 +157,8 @@ if (isNull _newTarget) then {
// Disallow fire
_fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire);
} else {
_fov = [] call CBA_fnc_getFoV;
TRACE_1("FOV", _fov);
if (_newTarget distance ACE_player < 2500
&& {(call CBA_fnc_getFoV) select 1 > 9}
&& { (currentVisionMode ACE_player == 2)}

View File

@ -8,29 +8,29 @@ class CfgAmmo {
class M_PG_AT : MissileBase {
model = "\A3\Weapons_F\Ammo\Rocket_01_fly_F";
proxyShape = "\A3\Weapons_F\Ammo\Rocket_01_F";
proxyShape = "\A3\Weapons_F\Ammo\Rocket_01_F";
irLock = 0;
laserLock = 0;
airLock = 0;
weaponLockSystem = "2 + 16";
laserLock = 0;
airLock = 0;
weaponLockSystem = "2 + 16";
maxSpeed = 720;
maxControlRange = 5000;
maneuvrability = 8;
timeToLive = 60;
simulationStep = 0.01;
airFriction = 0.1;
sideAirFriction = 0.16;
initTime = 0.002;
thrustTime = 1.07;
thrust = 530;
fuseDistance = 2;
maxSpeed = 720;
maxControlRange = 5000;
maneuvrability = 8;
timeToLive = 60;
simulationStep = 0.01;
airFriction = 0.1;
sideAirFriction = 0.16;
initTime = 0.002;
thrustTime = 1.07;
thrust = 530;
fuseDistance = 2;
effectsMissileInit = "MissileDAR1";
effectsMissile = "missile2";
whistleDist = 4;
muzzleEffect = "";
effectsMissileInit = "MissileDAR1";
effectsMissile = "missile2";
whistleDist = 4;
muzzleEffect = "";
// Turn off arma crosshair-guidance
manualControl = 0;
@ -46,9 +46,6 @@ class CfgAmmo {
minDeflection = 0.00025; // Minium flap deflection for guidance
maxDeflection = 0.001; // Maximum flap deflection for guidance
incDeflection = 0.0005; // The incrmeent in which deflection adjusts.
//minDeflection = 0.005;
//maxDeflection = 0.5;
//incDeflection = 0.005;
canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode
@ -73,17 +70,17 @@ class CfgAmmo {
class ACE_Hydra70_DAGR : M_PG_AT {
displayName = "$STR_ACE_Hydra70_DAGR";
displayNameShort = "$STR_ACE_Hydra70_DAGR_Short";
displayNameShort = "$STR_ACE_Hydra70_DAGR_Short";
description = "$STR_ACE_Hydra70_DAGR";
descriptionShort = "$STR_ACE_Hydra70_DAGR_Desc";
descriptionShort = "$STR_ACE_Hydra70_DAGR_Desc";
};
class ACE_Hellfire_AGM114K : ACE_Hydra70_DAGR {
displayName = "$STR_ACE_Hellfire_AGM114K";
displayNameShort = "$STR_ACE_Hellfire_AGM114K_Short";
displayNameShort = "$STR_ACE_Hellfire_AGM114K_Short";
description = "$STR_ACE_Hellfire_AGM114K_desc";
description = "$STR_ACE_Hellfire_AGM114K_desc";
descriptionShort = "$STR_ACE_Hellfire_AGM114K_desc";
// @TODO: placeholder model to at least make it look different
@ -92,21 +89,22 @@ class CfgAmmo {
hit = 1400;
indirectHit = 71;
indirectHitRange = 4.5;
effectsMissile = "missile2";
indirectHitRange = 4.5;
effectsMissile = "missile2";
};
// Titan
class M_Titan_AT : MissileBase {
irLock = 0;
laserLock = 0;
airLock = 0;
laserLock = 0;
airLock = 0;
// Turn off arma crosshair-guidance
manualControl = 0;
hit = 1400;
hit = 1400; // default: 800
indirectHit = 20;
indirectHitRange = 2;
// ACE uses these values
//trackOversteer = 1;
//trackLead = 0;
@ -118,9 +116,6 @@ class CfgAmmo {
minDeflection = 0.00005; // Minium flap deflection for guidance
maxDeflection = 0.025; // Maximum flap deflection for guidance
incDeflection = 0.00005; // The incrmeent in which deflection adjusts.
//minDeflection = 0.005;
//maxDeflection = 0.5;
//incDeflection = 0.005;
canVanillaLock = 0;

View File

@ -17,7 +17,7 @@ class CfgVehicles {
class MainTurret;
};
};
class ACE_Comanche_Test : B_Heli_Attack_01_F {
displayName = "ACE_Comanche_Test";
author = "ACE Team";
@ -30,4 +30,5 @@ class CfgVehicles {
};
};
};
};

View File

@ -1,65 +0,0 @@
THIS IS A WIP FUNCTIONALITY, DUE TO CHANGE
class M_PG_AT : MissileBase {
model = "\A3\Weapons_F\Ammo\Rocket_01_fly_F";
proxyShape = "\A3\Weapons_F\Ammo\Rocket_01_F";
irLock = 0;
laserLock = 0;
airLock = 0;
weaponLockSystem = "2 + 16";
maxSpeed = 720;
maxControlRange = 5000;
maneuvrability = 8;
timeToLive = 60;
simulationStep = 0.01;
airFriction = 0.1;
sideAirFriction = 0.16;
initTime = 0.002;
thrustTime = 1.07;
thrust = 530;
fuseDistance = 2;
effectsMissileInit = "MissileDAR1";
effectsMissile = "missile2";
whistleDist = 4;
muzzleEffect = "";
// Turn off arma crosshair-guidance
manualControl = 0;
// ACE uses these values
trackOversteer = 1;
trackLead = 0;
// Begin ACE guidance Configs
class ACE_MissileGuidance {
enabled = 1;
minDeflection = 0.005; // Minium flap deflection for guidance
maxDeflection = 0.025; // Maximum flap deflection for guidance
incDeflection = 0.005; // The incrmeent in which deflection adjusts.
//minDeflection = 0.005;
//maxDeflection = 0.5;
//incDeflection = 0.005;
// Guidance type for munitions
defaultSeekerType = "SALH";
seekerTypes[] = { "SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS" };
defaultSeekerLockMode = "LOAL";
seekerLockModes[] = { "LOAL", "LOBL" };
seekerAngle = 90; // Angle in front of the missile which can be searched
seekerAccuracy = 1; // seeker accuracy multiplier
seekerMinRange = 1;
seekerMaxRange = 2500; // Range from the missile which the seeker can visually search
// Attack profile type selection
defaultAttackProfile = "LIN";
attackProfiles[] = { "LIN", "DIR", "MID", "HI", "TOP", "PYM" };
};
};

View File

@ -53,7 +53,7 @@ switch( (_state select 0) ) do {
};
case STAGE_TERMINAL: {
TRACE_1("STAGE_TERMINAL","");
_returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget * 0.002];
_returnTargetPos = _seekerTargetPos;
};
};

View File

@ -70,7 +70,7 @@ switch( (_state select 0) ) do {
case STAGE_TERMINAL: {
TRACE_1("STAGE_TERMINAL","");
//_returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget * 0.02];
_returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget * 0.002];
_returnTargetPos = _seekerTargetPos;
};
};

View File

@ -92,6 +92,10 @@ if(accTime > 0) then {
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _projectilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"];
drawLine3D [ASLtoATL _projectilePos, ASLtoATL _profileAdjustedTargetPos, [1,0,0,1]];
_ps = "#particlesource" createVehicleLocal (ASLtoATL _projectilePos);
_PS setParticleParams [["\A3\Data_f\cl_basic", 8, 3, 1], "", "Billboard", 1, 3.0141, [0, 0, 2], [0, 0, 0], 1, 1.275, 1, 0, [1, 1], [[1, 0, 0, 1], [1, 0, 0, 1], [1, 0, 0, 1]], [1], 1, 0, "", "", nil];
_PS setDropInterval 3.0;
hintSilent format["d: %1", _distanceToTarget];
#endif

View File

@ -17,6 +17,7 @@ TRACE_1("", _launchParams);
_foundTargetPos = [0,0,0];
if(!isNil "_target") then {
_foundTargetPos = getPosASL _target;
//_foundTargetPos = (_target modelToWorldVisual (getCenterOfMass _target));
};
// @TODO: This is seeker LOS and angle checks for LOAL only; LOBL does not need visual

View File

@ -13,6 +13,9 @@
<Hungarian>Fejlett rakétairányító</Hungarian>
<Russian>Расширенный ракетой</Russian>
</Key>
<Key ID="STR_ACE_MissileGuidance_Desc">
<English>Advanced missile guidance, or AMG, provides multiple enhancements to missile locking and firing. It is also a framework required for missile weapon types.</English>
</Key>
<Key ID="STR_ACE_Hydra70_DAGR">
<English>Hydra-70 DAGR Missile</English>
<Spanish></Spanish>