Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overpressure - Add to vehicle/static Missile Launchers and Recoilless Guns #10270

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
79115a8
Add overpressure to vehicle missile/rocket launchers
mrschick Aug 28, 2024
b26e097
Tweak M47 Dragon Overpressure
mrschick Aug 28, 2024
f58d514
Isolate Compat RHS_AFRF Overpressure
mrschick Aug 28, 2024
4a9acf8
Soft-Launch for RHS_AFRF 9K38 Igla Turret
mrschick Aug 28, 2024
b75a3da
Correct RHS_AFRF SPG-9 Offset
mrschick Aug 28, 2024
318c5c1
Isolate Compat RHS_USAF Overpressure
mrschick Aug 28, 2024
801bd44
Soft-Launch for RHS_USAF Stinger Turret
mrschick Aug 28, 2024
3f571a4
Soft-Launch for RHS_USAF TOW
mrschick Aug 28, 2024
75e4f6b
Correct Vanilla AT Gun Offset
mrschick Aug 28, 2024
dfe8fa7
Fix duplicate class definition
mrschick Aug 28, 2024
dea6edf
Update Documentation
mrschick Aug 29, 2024
fad2c5a
Merge 'master' for recent Overpressure changes
mrschick Aug 31, 2024
0acf423
Fix inheritance
mrschick Aug 31, 2024
8da11c4
Move Javelin overpressure to own component
mrschick Aug 31, 2024
0e944ce
Rough working version of firedEHBB for Vehicles
mrschick Aug 31, 2024
8ce4e47
Use _unit in case _shooter would be undefined
mrschick Aug 31, 2024
b668682
Fix undefined _gunner for FFV shots
mrschick Aug 31, 2024
d6e4bc8
Prevent bb reflection damage when within heavy vehicles
mrschick Aug 31, 2024
6662938
Prevent bb reflection by own vehicle
mrschick Aug 31, 2024
e0b63bb
Fix comment typo
mrschick Aug 31, 2024
dc01de9
Revert negative offset
mrschick Aug 31, 2024
eadb5b9
Call overpressure "backblast" when it's rear-facing
mrschick Aug 31, 2024
70c64d2
Update Documentation
mrschick Aug 31, 2024
296a5a3
Optimize as advised by HEMTT
mrschick Aug 31, 2024
6f41328
Enable Offset for Cannon Overpressure
mrschick Sep 5, 2024
9119a29
Mortar Overpressure
mrschick Sep 5, 2024
cf1d32c
Allow negative Backblast Offset
mrschick Sep 5, 2024
0b9b97a
Correct Offset for MLRSs
mrschick Sep 5, 2024
e262208
Prevent Backblast being blocked by Firing Vehicle
mrschick Sep 6, 2024
a9ce879
Increase MLRS Backblast Damage
mrschick Sep 6, 2024
34c3ae9
Flag "noReflection" to prevent bb reflection inside closed vehicle
mrschick Sep 6, 2024
7e1d864
Set "noReflection" on BRDM2, BM21 and Vanilla MLRS Truck
mrschick Sep 6, 2024
9586765
Merge branch 'master' into feature/spg9-backblast
mrschick Sep 25, 2024
a2d3786
Requested Changes
mrschick Sep 25, 2024
3e86ccd
Mitigate dependency from addon/hearing
mrschick Sep 25, 2024
d6b002d
Moved playerVehAttenuation logic to common
mrschick Sep 26, 2024
83484d3
Revert overpressure subconfigs
mrschick Sep 26, 2024
5da1929
Merge branch 'master' into feature/spg9-backblast
mrschick Oct 15, 2024
370f1bf
Merge branch 'master' into feature/spg9-backblast
mrschick Nov 7, 2024
2bb02d7
Rephrase comments
mrschick Nov 7, 2024
f939383
Merge branch 'master' into feature/spg9-backblast
mrschick Dec 28, 2024
bbddf05
Suggestions from Review
mrschick Dec 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addons/common/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ PREP(unloadPerson);
PREP(unloadPersonLocal);
PREP(unloadUnitWeapon);
PREP(unmuteUnit);
PREP(updatePlayerVehAttenuation);
PREP(useItem);
PREP(useMagazine);
PREP(watchVariable);
Expand Down
9 changes: 9 additions & 0 deletions addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,15 @@ GVAR(OldIsCamera) = false;
["ace_activeCameraChanged", [_player, GVAR(OldIsCamera)]] call CBA_fnc_localEvent;
}, true] call CBA_fnc_addPlayerEventHandler;

// Update vehicle audio attenuation when player vehicle changes
GVAR(playerVehAttenuation) = 1;
["vehicle", {
params ["_player", "_vehicle"];
TRACE_2("vehicle change",_player,_vehicle);
_this call FUNC(updatePlayerVehAttenuation);
}, true] call CBA_fnc_addPlayerEventHandler;
["turret", LINKFUNC(updatePlayerVehAttenuation), false] call CBA_fnc_addPlayerEventHandler;

// Add event handler for UAV control change
ACE_controlledUAV = [objNull, objNull, [], ""];
addMissionEventHandler ["PlayerViewChanged", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Amount that unit can hear outside <NUMBER>
*
* Example:
* call ace_hearing_fnc_updatePlayerVehAttenuation
* call ace_common_fnc_updatePlayerVehAttenuation
*
* Public: No
*/
Expand All @@ -27,7 +27,7 @@ if (ACE_player != _vehicle) then {
private _effectType = getText (_vehicleConfig >> "attenuationEffectType");

if (_turretPath isNotEqualTo []) then {
private _turretConfig = [_vehicleConfig, _turretPath] call EFUNC(common,getTurretConfigPath);
private _turretConfig = [_vehicleConfig, _turretPath] call FUNC(getTurretConfigPath);

if ((getNumber (_turretConfig >> "disableSoundAttenuation")) == 1) then {
_effectType = "";
Expand Down
4 changes: 4 additions & 0 deletions addons/compat_rhs_afrf3/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ class CfgVehicles {
EGVAR(refuel,fuelCapacity) = 360;
};

class RHS_BM21_MSV_01: RHS_Ural_BaseTurret {
EGVAR(overpressure,noReflection) = 1;
};

class RHS_Ural_Base: RHS_Ural_BaseTurret {};
class RHS_Ural_MSV_Base: RHS_Ural_Base {};
class RHS_Ural_Support_MSV_Base_01: RHS_Ural_MSV_Base {};
Expand Down
43 changes: 29 additions & 14 deletions addons/compat_rhs_afrf3/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,39 +88,37 @@ class CfgWeapons {
EGVAR(overpressure,angle) = 40;
EGVAR(overpressure,offset) = 0.9;
};

class rhs_weap_rpg26: Launcher_Base_F {
EGVAR(overpressure,range) = 10;
EGVAR(overpressure,angle) = 50;
EGVAR(overpressure,offset) = 0.65;
};

class rhs_weap_rpg18: rhs_weap_rpg26 {
EGVAR(overpressure,angle) = 45;
EGVAR(overpressure,offset) = 1;
};

class rhs_weap_strela;
class rhs_weap_igla: rhs_weap_strela {
EGVAR(overpressure,range) = 6;
EGVAR(overpressure,angle) = 40;
EGVAR(overpressure,damage) = 0.6;
EGVAR(overpressure,offset) = 1.65;
};

class rhs_zsh7a;
class rhs_zsh7a_alt: rhs_zsh7a {
ACE_Protection = 1;
class missiles_titan_static;
class rhs_Igla_AA_pod_Base: missiles_titan_static { // Soft-launched Igla missile
EGVAR(overpressure,range) = 6;
EGVAR(overpressure,angle) = 40;
EGVAR(overpressure,damage) = 0.6;
EGVAR(overpressure,offset) = 1.8;
};
class rhs_zsh7a_mike;
class rhs_zsh7a_mike_alt: rhs_zsh7a_mike {
ACE_Protection = 1;
class RocketPods;
class rhs_weap_SPG9: RocketPods {
EGVAR(overpressure,offset) = 1.2;
};
class rhs_zsh7a_mike_green;
class rhs_zsh7a_mike_green_alt: rhs_zsh7a_mike_green {
ACE_Protection = 1;
class rhs_weap_grad;
class rhs_weap_bm21: rhs_weap_grad {
EGVAR(overpressure,offset) = 0;
};

class rhs_weap_d81;
class rhs_weap_2a70: rhs_weap_d81 { // "Low pressure" 100mm cannon
EGVAR(overpressure,range) = 15;
Expand All @@ -131,6 +129,23 @@ class CfgWeapons {
EGVAR(overpressure,range) = 15;
EGVAR(overpressure,damage) = 0.5;
};
class mortar_82mm;
class rhs_weap_2b14: mortar_82mm {
EGVAR(overpressure,offset) = 0.4;
};

class rhs_zsh7a;
class rhs_zsh7a_alt: rhs_zsh7a {
ACE_Protection = 1;
};
class rhs_zsh7a_mike;
class rhs_zsh7a_mike_alt: rhs_zsh7a_mike {
ACE_Protection = 1;
};
class rhs_zsh7a_mike_green;
class rhs_zsh7a_mike_green_alt: rhs_zsh7a_mike_green {
ACE_Protection = 1;
};

class rhs_uniform_flora;
class rhs_uniform_df15: rhs_uniform_flora {
Expand Down
1 change: 1 addition & 0 deletions addons/compat_rhs_gref3/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ class CfgVehicles {
GVAR(turretFireProb) = 0.7;
GVAR(engineFireProb) = 0.7;
GVAR(detonationDuringFireProb) = 0.5;
EGVAR(overpressure,noReflection) = 1;
};
};
43 changes: 34 additions & 9 deletions addons/compat_rhs_usf3/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,6 @@ class CfgWeapons {
};

// RHS launchers
class launch_O_Titan_F;

class rhs_weap_fim92: launch_O_Titan_F {
EGVAR(overpressure,range) = 6;
EGVAR(overpressure,angle) = 40;
EGVAR(overpressure,damage) = 0.6;
EGVAR(overpressure,offset) = 1.45;
};

class Launcher_Base_F;

class rhs_weap_smaw: Launcher_Base_F {
Expand All @@ -206,6 +197,40 @@ class CfgWeapons {
EGVAR(overpressure,offset) = 0.9;
};

class launch_O_Titan_F;
class rhs_weap_fim92: launch_O_Titan_F {
EGVAR(overpressure,range) = 6;
EGVAR(overpressure,angle) = 40;
EGVAR(overpressure,damage) = 0.6;
EGVAR(overpressure,offset) = 1.45;
};

class rhs_weap_stinger_Launcher;
class rhs_weap_stinger_Launcher_static: rhs_weap_stinger_Launcher {
EGVAR(overpressure,range) = 6;
EGVAR(overpressure,angle) = 40;
EGVAR(overpressure,damage) = 0.6;
EGVAR(overpressure,offset) = 1.2;
};

class missiles_titan;
class Rhs_weap_TOW_Launcher_static: missiles_titan {
EGVAR(overpressure,angle) = 40;
EGVAR(overpressure,range) = 4;
EGVAR(overpressure,damage) = 0.7;
EGVAR(overpressure,offset) = 0.8;
};

class rockets_230mm_GAT;
class rhs_weap_mlrs: rockets_230mm_GAT {
EGVAR(overpressure,offset) = 3.8;
};

class mortar_82mm;
class rhs_mortar_81mm: mortar_82mm {
EGVAR(overpressure,offset) = 0.2;
};

class rhsusf_hgu56p;
class rhsusf_hgu56p_visor: rhsusf_hgu56p {
ACE_Protection = 1;
Expand Down
5 changes: 3 additions & 2 deletions addons/dragon/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ class CfgWeapons {
};

class GVAR(superStatic): missiles_titan_static {
EGVAR(overpressure,angle) = 90;
EGVAR(overpressure,range) = 30;
EGVAR(overpressure,angle) = 60;
EGVAR(overpressure,range) = 10;
EGVAR(overpressure,damage) = 0.85;
EGVAR(overpressure,offset) = -0.4;

initSpeed = 120;

Expand Down
1 change: 0 additions & 1 deletion addons/hearing/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ PREP(moduleHearing);
PREP(putInEarPlugs);
PREP(removeEarPlugs);
PREP(updateHearingProtection);
PREP(updatePlayerVehAttenuation);
PREP(updateVolume);
4 changes: 0 additions & 4 deletions addons/hearing/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ GVAR(cacheAmmoLoudness) = createHashMap;
GVAR(deafnessDV) = 0;
GVAR(deafnessPrior) = 0;
GVAR(volume) = 1;
GVAR(playerVehAttenuation) = 1;
GVAR(time3) = 0;
GVAR(damageCoefficent) = 1;
GVAR(volumeAttenuation) = 1;
Expand All @@ -68,7 +67,6 @@ GVAR(lastPlayerVehicle) = objNull;
params ["_player", "_vehicle"];

TRACE_2("vehicle change",_player,_vehicle);
_this call FUNC(updatePlayerVehAttenuation);

if (!isNull GVAR(lastPlayerVehicle)) then {
private _firedEH = GVAR(lastPlayerVehicle) getVariable [QGVAR(firedEH), -1];
Expand All @@ -86,8 +84,6 @@ GVAR(lastPlayerVehicle) = objNull;
};
}, true] call CBA_fnc_addPlayerEventHandler;

["turret", LINKFUNC(updatePlayerVehAttenuation), false] call CBA_fnc_addPlayerEventHandler;

[QGVAR(firedNear), "FiredNear", LINKFUNC(firedNear), true] call CBA_fnc_addBISPlayerEventHandler;
[QGVAR(slotItemChanged), "SlotItemChanged", {(_this select 2) call FUNC(updateHearingProtection)}, true] call CBA_fnc_addBISPlayerEventHandler;

Expand Down
2 changes: 1 addition & 1 deletion addons/hearing/functions/fnc_explosion.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private _hit = getNumber (_ammoConfig >> "hit");
if (_hit < 0.5) exitWith { TRACE_1("ignore smoke/flare",_hit) };
private _explosive = getNumber (_ammoConfig >> "explosive");

private _vehAttenuation = [GVAR(playerVehAttenuation), 1] select (isNull objectParent ACE_player || {isTurnedOut ACE_player});
private _vehAttenuation = [EGVAR(common,playerVehAttenuation), 1] select (isNull objectParent ACE_player || {isTurnedOut ACE_player});

TRACE_4("",typeOf _projectile,_distance,_explosive,_vehAttenuation);

Expand Down
2 changes: 1 addition & 1 deletion addons/hearing/functions/fnc_firedNear.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if (_magazine == "") exitWith {

TRACE_6("mag",_magazine,_weapon,_muzzle,_ammo,_firer,_gunner);

private _vehAttenuation = [GVAR(playerVehAttenuation), 1] select (isNull objectParent ACE_player || {isTurnedOut ACE_player});
private _vehAttenuation = [EGVAR(common,playerVehAttenuation), 1] select (isNull objectParent ACE_player || {isTurnedOut ACE_player});
private _loudness = _magazine call FUNC(getAmmoLoudness);

_loudness = _loudness * _audibleFireCoef;
Expand Down
7 changes: 7 additions & 0 deletions addons/javelin/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ class CfgWeapons {
magazines[] = {"1Rnd_GAT_missiles"};
lockingTargetSound[] = {"",0,1};
lockedTargetSound[] = {"",0,1};

// Titan is a soft-launch launcher
EGVAR(overpressure,priority) = 1;
EGVAR(overpressure,angle) = 30;
EGVAR(overpressure,range) = 2;
EGVAR(overpressure,damage) = 0.5;
EGVAR(overpressure,offset) = -0.5;
};

class Launcher_Base_F;
Expand Down
6 changes: 6 additions & 0 deletions addons/overpressure/CfgVehicles.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class CfgVehicles {
class Truck_02_base_F;
class Truck_02_MRL_base_F: Truck_02_base_F {
GVAR(noReflection) = 1;
};
};
53 changes: 53 additions & 0 deletions addons/overpressure/CfgWeapons.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

class CfgWeapons {

// Man-Portable launchers, rear-facing backblast

class LauncherCore;
class Launcher: LauncherCore {
GVAR(priority) = 1;
Expand Down Expand Up @@ -61,6 +63,49 @@ class CfgWeapons {
GVAR(offset) = 0.9;
};

// Vehicle recoilless rifles and missile launchers, rear-facing backblast

class MissileLauncher: LauncherCore {
GVAR(priority) = 1;
GVAR(angle) = 60;
GVAR(range) = 10;
GVAR(damage) = 0.7;
GVAR(offset) = 0.8;
GVAR(backblast) = 1;
};

class missiles_titan;
class missiles_titan_static: missiles_titan {
GVAR(angle) = 40;
GVAR(range) = 8;
GVAR(damage) = 0.5;
};

class missiles_Vorona: MissileLauncher {
GVAR(angle) = 50;
GVAR(offset) = 0.5;
};

class launcher_SPG9: MissileLauncher {
GVAR(offset) = 1.25;
};

class RocketPods: LauncherCore {
GVAR(priority) = 1;
GVAR(angle) = 60;
GVAR(range) = 10;
GVAR(damage) = 0.7;
GVAR(offset) = 0.8;
GVAR(backblast) = 1;
};

class rockets_230mm_GAT: RocketPods {
GVAR(damage) = 0.85;
GVAR(offset) = 1;
};

// Vehicle cannons, forward-facing overpressure

class CannonCore;
class cannon_120mm: CannonCore {
GVAR(priority) = 1;
Expand Down Expand Up @@ -89,4 +134,12 @@ class CfgWeapons {
GVAR(range) = 60;
GVAR(damage) = 1;
};

class mortar_82mm: CannonCore {
GVAR(priority) = 1;
GVAR(angle) = 80;
GVAR(range) = 5;
GVAR(damage) = 0.7;
GVAR(offset) = 0.6;
};
};
8 changes: 7 additions & 1 deletion addons/overpressure/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
["ace_firedPlayer", LINKFUNC(firedEHBB)] call CBA_fnc_addEventHandler;
};
if (GVAR(overpressureDistanceCoefficient) > 0) then {
["ace_firedPlayerVehicle", LINKFUNC(firedEHOP)] call CBA_fnc_addEventHandler;
["ace_firedPlayerVehicle", {
if (getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(backblast)) == 1) then {
_this call FUNC(firedEHBB);
} else {
_this call FUNC(firedEHOP);
};
}] call CBA_fnc_addEventHandler;
};

GVAR(cacheHash) = createHashMap;
Expand Down
1 change: 1 addition & 0 deletions addons/overpressure/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class CfgPatches {
};

#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "ACE_Arsenal_Stats.hpp"
#include "CfgEden.hpp"
Loading