From 4abb16c93d6bcb1191123e5bdda3da1a837ded41 Mon Sep 17 00:00:00 2001 From: Alien314 <93859311+Alien314@users.noreply.github.com> Date: Sun, 1 Dec 2024 20:53:14 -0600 Subject: [PATCH 1/9] ACE No Med scripted damage compatibilities --- addons/compat_ace_fire/XEH_Prep.hpp | 1 + addons/compat_ace_fire/XEH_preInit.sqf | 17 ++ addons/compat_ace_fire/XEH_preStart.sqf | 6 + addons/compat_ace_fire/config.cpp | 48 +++++ .../functions/fnc_burnSimulation.sqf | 190 ++++++++++++++++++ addons/compat_ace_fire/initSettings.inc.sqf | 19 ++ .../compat_ace_fire/initSettingsACE.inc.sqf | 2 + addons/compat_ace_fire/script_component.hpp | 31 +++ addons/compat_ace_fire/stringtable.xml | 20 ++ 9 files changed, 334 insertions(+) create mode 100644 addons/compat_ace_fire/XEH_Prep.hpp create mode 100644 addons/compat_ace_fire/XEH_preInit.sqf create mode 100644 addons/compat_ace_fire/XEH_preStart.sqf create mode 100644 addons/compat_ace_fire/config.cpp create mode 100644 addons/compat_ace_fire/functions/fnc_burnSimulation.sqf create mode 100644 addons/compat_ace_fire/initSettings.inc.sqf create mode 100644 addons/compat_ace_fire/initSettingsACE.inc.sqf create mode 100644 addons/compat_ace_fire/script_component.hpp create mode 100644 addons/compat_ace_fire/stringtable.xml diff --git a/addons/compat_ace_fire/XEH_Prep.hpp b/addons/compat_ace_fire/XEH_Prep.hpp new file mode 100644 index 0000000..fe46ba3 --- /dev/null +++ b/addons/compat_ace_fire/XEH_Prep.hpp @@ -0,0 +1 @@ +[QPATHTOF(functions\fnc_burnSimulation.sqf), QUOTE(DOUBLES(REPLACEMOD,fnc_burnSimulation))] call CBA_fnc_compileFunction; \ No newline at end of file diff --git a/addons/compat_ace_fire/XEH_preInit.sqf b/addons/compat_ace_fire/XEH_preInit.sqf new file mode 100644 index 0000000..64988d1 --- /dev/null +++ b/addons/compat_ace_fire/XEH_preInit.sqf @@ -0,0 +1,17 @@ +#include "script_component.hpp" +ADDON = false; + +GVAR(aceMedicalLoaded) = isClass(configFile >> "CfgPatches" >> "ace_medical_engine"); +if (isClass(configFile >> "CfgPatches" >> "ace_medical") && {!GVAR(aceMedicalLoaded)}) exitWith { + INFO("PreInit: Disabled --> old ACE medical loaded"); +}; + +#include "XEH_PREP.hpp" +call compile preprocessFileLineNumbers format["%1\XEH_preInit.sqf",REPLACEPATH]; +if (GVAR(aceMedicalLoaded)) then { + //#include "initSettingsACE.inc.sqf" +} else { + #include "initSettings.inc.sqf" +}; + +ADDON = true; \ No newline at end of file diff --git a/addons/compat_ace_fire/XEH_preStart.sqf b/addons/compat_ace_fire/XEH_preStart.sqf new file mode 100644 index 0000000..0cfd497 --- /dev/null +++ b/addons/compat_ace_fire/XEH_preStart.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" +if (isClass(configFile >> "CfgPatches" >> "ace_medical") && {!isClass(configFile >> "CfgPatches" >> "ace_medical_engine")}) exitWith { + INFO("PreStart: Disabled --> old ACE medical loaded"); +}; +#include "XEH_PREP.hpp" +call compile preprocessFileLineNumbers format["%1\XEH_preStart.sqf",REPLACEPATH]; \ No newline at end of file diff --git a/addons/compat_ace_fire/config.cpp b/addons/compat_ace_fire/config.cpp new file mode 100644 index 0000000..afe8ff5 --- /dev/null +++ b/addons/compat_ace_fire/config.cpp @@ -0,0 +1,48 @@ +#include "script_component.hpp" + +#if __has_include("\z\ace\addons\fire\script_component.hpp") +#define PATCH_SKIP "ACE Fire" +#endif + +#ifndef PATCH_SKIP +class CfgPatches { + class DOUBLES(NAME,notLoaded) { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"diw_armor_plates_main"}; + VERSION_CONFIG; + }; +}; +class DOUBLES(COMPONENT_NAME,notLoaded) { + NAME = PATCH_SKIP; +}; +#else +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"diw_armor_plates_main",QUOTE(REPLACEMOD)}; + author = "Alien314"; + authors[] = {"Alien314","ACE-Team"}; + url = ""; + VERSION_CONFIG; + }; +}; + +class Extended_PreInit_EventHandlers { + class REPLACEMOD { + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); + }; +}; + +class Extended_PreStart_EventHandlers { + class REPLACEMOD { + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); + }; +}; + + +#endif \ No newline at end of file diff --git a/addons/compat_ace_fire/functions/fnc_burnSimulation.sqf b/addons/compat_ace_fire/functions/fnc_burnSimulation.sqf new file mode 100644 index 0000000..5ce8db5 --- /dev/null +++ b/addons/compat_ace_fire/functions/fnc_burnSimulation.sqf @@ -0,0 +1,190 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm, johnb43 + * Simulates fire intensity over time on burning units. + * Arbitrary values to ignite people. Assumed maximum is "10". + * + * Arguments: + * 0: Unit + * 1: Instigator + * + * Return Value: + * None + * + * Example: + * [player, player] call ace_fire_fnc_burnSimulation + * + * Public: No + */ + +params ["_unit", "_instigator"]; + +[{ + params ["_args", "_pfhID"]; + _args params ["_unit", "_instigator"]; + + if (isNull _unit) exitWith { + //TRACE_1("unit is null",_unit); + + _pfhID call CBA_fnc_removePerFrameHandler; + }; + + // Locality has changed + if (!local _unit) exitWith { + //TRACE_1("unit is no longer local",_unit); + + _pfhID call CBA_fnc_removePerFrameHandler; + + ["ace_fire_burnSimulation", [_unit, _instigator], _unit] call CBA_fnc_targetEvent; + }; + + // If the unit is invulnerable, in water or if the fire has died out, stop burning the unit + if ( + !(_unit call ace_fire_fnc_isBurning) || + {!(isDamageAllowed _unit && {_unit getVariable ["ace_medical_allowDamage", true]})} || + {private _eyePos = eyePos _unit; surfaceIsWater _eyePos && {(_eyePos select 2) < 0.1}} + ) exitWith { + //TRACE_3("unit is no longer burning, invulnerable or in water",_unit,_unit call FUNC(isBurning),isDamageAllowed _unit && {_unit getVariable [ARR_2(QEGVAR(medical,allowDamage),true)]}); + + // Remove global effects + (_unit getVariable ["ace_fire_jipID", ""]) call CBA_fnc_removeGlobalEventJIP; + + // Update globally that the unit isn't burning anymore + _unit setVariable ["ace_fire_intensity", nil, true]; + + _pfhID call CBA_fnc_removePerFrameHandler; + + if (!isNil {_unit getVariable "ace_fire_stopDropRoll"} && {!isPlayer _unit}) then { + _unit setUnitPos "AUTO"; + + _unit setVariable ["ace_fire_stopDropRoll", nil, true]; + }; + }; + + if (isGamePaused) exitWith {}; + + private _intensity = _unit getVariable ["ace_fire_intensity", 0]; + + // Propagate fire to other units (alive or dead) if it's intense + if (_intensity >= BURN_THRESHOLD_INTENSE) then { + //TRACE_2("check for other units",_unit,_intensity); + + { + private _distancePercent = 1 - ((_unit distance _x) / BURN_PROPAGATE_DISTANCE); + private _adjustedIntensity = _intensity * _distancePercent; + + // Don't burn if intensity is too low or already burning with higher intensity + if (BURN_MIN_INTENSITY > _adjustedIntensity || {(_x getVariable ["ace_fire_intensity", 0]) > _adjustedIntensity}) then { + continue; + }; + + ["ace_fire_burn", [_x, _adjustedIntensity, _instigator], _x] call CBA_fnc_targetEvent; + + //TRACE_3("propagate fire",_x,_intensity,_adjustedIntensity); + } forEach nearestObjects [_unit, ["CAManBase"], BURN_PROPAGATE_DISTANCE]; + }; + + // Update intensity/fire reactions + if (CBA_missionTime >= _unit getVariable ["ace_fire_intensityUpdate", 0]) then { + //TRACE_2("update intensity",_unit,_intensity); + + _unit setVariable ["ace_fire_intensityUpdate", CBA_missionTime + INTENSITY_UPDATE]; + + _intensity = _intensity - INTENSITY_LOSS - (rain / 10); + + if (_unit call ace_common_fnc_isAwake) then { + if (_unit call ace_common_fnc_isPlayer) then { + // Decrease intensity of burn if rolling around + if ((animationState _unit) in PRONE_ROLLING_ANIMS) then { + _intensity = _intensity * INTENSITY_DECREASE_MULT_ROLLING; + }; + } else { + private _sdr = _unit getVariable ["ace_fire_stopDropRoll", false]; + + private _vehicle = objectParent _unit; + + if (isNull _vehicle && {_sdr || {0.05 > random 1}}) then { + _unit setVariable ["ace_fire_stopDropRoll", true, true]; + + if (!_sdr) then { + //TRACE_1("stop, drop, roll!",_unit); + + _unit setUnitPos "DOWN"; + doStop _unit; + }; + + // Queue up a bunch of animations + for "_i" from 0 to 2 do { + [_unit, selectRandom ["amovppnemstpsnonwnondnon_amovppnemevasnonwnondl", "amovppnemstpsnonwnondnon_amovppnemevasnonwnondr"], 0] call ace_common_fnc_doAnimation; + }; + + _intensity = _intensity - (1 / _intensity); + } else { + // Make the unit leave the vehicle + if (_vehicle != _unit) then { + //TRACE_1("Ejecting",_unit); + + _unit leaveVehicle _vehicle; + unassignVehicle _unit; + + _unit action ["Eject", _vehicle]; + }; + + _unit disableAI "TARGET"; + _unit disableAI "AUTOTARGET"; + + // Run away, erraticly + if (leader group _unit != _unit) then { + [_unit] join grpNull; + }; + + _unit doMove ((getPosATL _unit) getPos [20 + random 35, floor (random 360)]); + _unit setSpeedMode "FULL"; + _unit setSuppression 1; + }; + }; + + // Play screams and throw weapon (if enabled) + _unit call ace_fire_fnc_burnReaction; + }; + + // Keep pain around unconsciousness limit to allow for more fun interactions + private _painPercieved = (0 max ((_unit getVariable ["ace_medical_pain", 0]) - (_unit getVariable ["ace_medical_painSuppress", 0])) min 1); + private _painUnconscious = missionNamespace getVariable ["ace_medical_painUnconsciousThreshold", 0]; + private _damageToAdd = [0.15, _intensity / BURN_MAX_INTENSITY] select (!alive _unit || {_painPercieved < _painUnconscious + random 0.2}); + + if (missionNamespace getVariable ["ace_medical_enabled", false]) then { + if (!isNull _instigator) then { + _unit setVariable ["ace_medical_lastDamageSource", _instigator]; + _unit setVariable ["ace_medical_lastInstigator", _instigator]; + }; + + // Common burn areas are the hands and face https://www.ncbi.nlm.nih.gov/pubmed/16899341/ + private _bodyPart = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"] selectRandomWeighted [0.77, 0.5, 0.8, 0.8, 0.3, 0.3]; + + // Use event directly, as ace_medical_fnc_addDamageToUnit requires unit to be alive + ["ace_medical_woundReceived", [_unit, [[_damageToAdd, _bodyPart, _damageToAdd]], _instigator, "burn"]] call CBA_fnc_localEvent; + } else { + private _bodyParts = [["HitFace", "HitNeck", "HitHead"], ["HitPelvis", "HitAbdomen", "HitDiaphragm", "HitChest", "HitBody"], ["HitArms", "HitHands"], ["HitLegs"]] selectRandomWeighted [0.77, 0.5, 0.8, 0.3]; + _damageToAdd = _damageToAdd * GVAR(fireMult); + + if (EGVAR(main,enable)) exitWith { + { + if (GVAR(ignoreArmor)) then { + private _vest = vestContainer _unit; + private _plates = _vest getVariable [QEGVAR(main,plates), []]; + _vest setVariable [QEGVAR(main,plates), []]; + [{params ["_vest","_plates"]; _vest setVariable [QEGVAR(main,plates), _plates];}, [_vest,_plates]] call CBA_fnc_execNextFrame; + }; + [_unit, _damageToAdd, _x, _instigator] call EFUNC(main,receiveDamage); + } forEach _bodyParts; + }; + + { + _unit setHitPointDamage [_x, (_unit getHitPointDamage _x) + _damageToAdd, true, _instigator, _instigator]; + } forEach _bodyParts; + }; + + _unit setVariable ["ace_fire_intensity", _intensity, true]; // Globally sync intensity across all clients to make sure simulation is deterministic + }; +}, BURN_PROPAGATE_UPDATE, [_unit, _instigator]] call CBA_fnc_addPerFrameHandler; \ No newline at end of file diff --git a/addons/compat_ace_fire/initSettings.inc.sqf b/addons/compat_ace_fire/initSettings.inc.sqf new file mode 100644 index 0000000..b9417d0 --- /dev/null +++ b/addons/compat_ace_fire/initSettings.inc.sqf @@ -0,0 +1,19 @@ +private _header = LELSTRING(main,category); +private _category = [_header, LLSTRING(subCategoryCompat)]; + +[ + QGVAR(ignoreArmor), "CHECKBOX", + [LLSTRING(ignoreArmor), LLSTRING(ignoreArmor_desc)], + _category, + false, + true +] call CBA_fnc_addSetting; + +[ + QGVAR(fireMult), "SLIDER", + [LLSTRING(nonMedBurnMult), LLSTRING(nonMedBurnMult_desc)], + _category, + [0, 10, 0.2, 2, false], + true, + {[QGVAR(fireMult), _this, true] call ace_common_fnc_cbaSettings_settingChanged} +] call CBA_fnc_addSetting; \ No newline at end of file diff --git a/addons/compat_ace_fire/initSettingsACE.inc.sqf b/addons/compat_ace_fire/initSettingsACE.inc.sqf new file mode 100644 index 0000000..7945295 --- /dev/null +++ b/addons/compat_ace_fire/initSettingsACE.inc.sqf @@ -0,0 +1,2 @@ +private _header = LELSTRING(main,category); +private _category = [_header, LLSTRING(subCategoryCompat)]; diff --git a/addons/compat_ace_fire/script_component.hpp b/addons/compat_ace_fire/script_component.hpp new file mode 100644 index 0000000..7e701cb --- /dev/null +++ b/addons/compat_ace_fire/script_component.hpp @@ -0,0 +1,31 @@ +#define COMPONENT compat_ace_fire +#define COMPONENT_BEAUTIFIED ACE Fire Compat +#define REPLACEMOD ace_fire +#define REPLACEPATH "z\ace\addons\fire" + +#include "\z\diw_armor_plates\addons\main\script_mod.hpp" + +#include "\z\diw_armor_plates\addons\main\script_macros.hpp" + +#define PRONE_ROLLING_ANIMS [\ + "amovppnemstpsnonwnondnon_amovppnemevasnonwnondl",\ + "amovppnemstpsnonwnondnon_amovppnemevasnonwnondr",\ + "amovppnemstpsraswrfldnon_amovppnemevaslowwrfldl",\ + "amovppnemstpsraswrfldnon_amovppnemevaslowwrfldr",\ + "amovppnemstpsraswpstdnon_amovppnemevaslowwpstdl",\ + "amovppnemstpsraswpstdnon_amovppnemevaslowwpstdr",\ + "amovppnemstpsoptwbindnon_amovppnemevasoptwbindl",\ + "amovppnemstpsoptwbindnon_amovppnemevasoptwbindr"\ +] + +#define BURN_MAX_INTENSITY 10 +#define BURN_MIN_INTENSITY 1 + +#define INTENSITY_DECREASE_MULT_PAT_DOWN 0.8 +#define INTENSITY_DECREASE_MULT_ROLLING INTENSITY_DECREASE_MULT_PAT_DOWN + +#define INTENSITY_LOSS 0.02 +#define INTENSITY_UPDATE 2 +#define BURN_PROPAGATE_UPDATE 1 +#define BURN_PROPAGATE_DISTANCE 2 +#define BURN_THRESHOLD_INTENSE 3 \ No newline at end of file diff --git a/addons/compat_ace_fire/stringtable.xml b/addons/compat_ace_fire/stringtable.xml new file mode 100644 index 0000000..e53a2d2 --- /dev/null +++ b/addons/compat_ace_fire/stringtable.xml @@ -0,0 +1,20 @@ + + + + + Compatibility + + + ACE Fire Ignore Armor + + + Whether fire damage should ignore armor plates. + + + ACE Fire Burn Damage Multiplier + + + Fire can randomly hit multiple parts, use this to tune it. (Default: 0.2) + + + \ No newline at end of file From e0421efb433b21afd69c6c9452b4daf399680ef7 Mon Sep 17 00:00:00 2001 From: Alien314 Date: Sun, 1 Dec 2024 21:08:19 -0600 Subject: [PATCH 2/9] Add Overpressure and Vehicle Damage --- addons/compat_ace_fire/XEH_preInit.sqf | 32 +- addons/compat_ace_fire/XEH_preStart.sqf | 10 +- addons/compat_ace_fire/config.cpp | 94 ++--- .../functions/fnc_burnSimulation.sqf | 378 +++++++++--------- addons/compat_ace_fire/initSettings.inc.sqf | 36 +- .../compat_ace_fire/initSettingsACE.inc.sqf | 4 +- addons/compat_ace_fire/script_component.hpp | 60 +-- addons/compat_ace_overpressure/$PBOPREFIX$ | 1 + addons/compat_ace_overpressure/XEH_Prep.hpp | 2 + .../compat_ace_overpressure/XEH_preInit.sqf | 17 + .../compat_ace_overpressure/XEH_preStart.sqf | 6 + addons/compat_ace_overpressure/config.cpp | 48 +++ .../functions/fnc_firedEHBB.sqf | 105 +++++ .../functions/fnc_overpressureDamage.sqf | 86 ++++ .../initSettings.inc.sqf | 27 ++ .../initSettingsACE.inc.sqf | 2 + .../script_component.hpp | 8 + .../compat_ace_overpressure/stringtable.xml | 26 ++ addons/compat_ace_vehicle_damage/$PBOPREFIX$ | 1 + addons/compat_ace_vehicle_damage/XEH_Prep.hpp | 1 + .../compat_ace_vehicle_damage/XEH_preInit.sqf | 17 + .../XEH_preStart.sqf | 6 + addons/compat_ace_vehicle_damage/config.cpp | 48 +++ .../functions/fnc_medicalDamage.sqf | 44 ++ .../initSettings.inc.sqf | 10 + .../initSettingsACE.inc.sqf | 2 + .../script_component.hpp | 8 + .../compat_ace_vehicle_damage/stringtable.xml | 14 + 28 files changed, 786 insertions(+), 307 deletions(-) create mode 100644 addons/compat_ace_overpressure/$PBOPREFIX$ create mode 100644 addons/compat_ace_overpressure/XEH_Prep.hpp create mode 100644 addons/compat_ace_overpressure/XEH_preInit.sqf create mode 100644 addons/compat_ace_overpressure/XEH_preStart.sqf create mode 100644 addons/compat_ace_overpressure/config.cpp create mode 100644 addons/compat_ace_overpressure/functions/fnc_firedEHBB.sqf create mode 100644 addons/compat_ace_overpressure/functions/fnc_overpressureDamage.sqf create mode 100644 addons/compat_ace_overpressure/initSettings.inc.sqf create mode 100644 addons/compat_ace_overpressure/initSettingsACE.inc.sqf create mode 100644 addons/compat_ace_overpressure/script_component.hpp create mode 100644 addons/compat_ace_overpressure/stringtable.xml create mode 100644 addons/compat_ace_vehicle_damage/$PBOPREFIX$ create mode 100644 addons/compat_ace_vehicle_damage/XEH_Prep.hpp create mode 100644 addons/compat_ace_vehicle_damage/XEH_preInit.sqf create mode 100644 addons/compat_ace_vehicle_damage/XEH_preStart.sqf create mode 100644 addons/compat_ace_vehicle_damage/config.cpp create mode 100644 addons/compat_ace_vehicle_damage/functions/fnc_medicalDamage.sqf create mode 100644 addons/compat_ace_vehicle_damage/initSettings.inc.sqf create mode 100644 addons/compat_ace_vehicle_damage/initSettingsACE.inc.sqf create mode 100644 addons/compat_ace_vehicle_damage/script_component.hpp create mode 100644 addons/compat_ace_vehicle_damage/stringtable.xml diff --git a/addons/compat_ace_fire/XEH_preInit.sqf b/addons/compat_ace_fire/XEH_preInit.sqf index 64988d1..f87c735 100644 --- a/addons/compat_ace_fire/XEH_preInit.sqf +++ b/addons/compat_ace_fire/XEH_preInit.sqf @@ -1,17 +1,17 @@ -#include "script_component.hpp" -ADDON = false; - -GVAR(aceMedicalLoaded) = isClass(configFile >> "CfgPatches" >> "ace_medical_engine"); -if (isClass(configFile >> "CfgPatches" >> "ace_medical") && {!GVAR(aceMedicalLoaded)}) exitWith { - INFO("PreInit: Disabled --> old ACE medical loaded"); -}; - -#include "XEH_PREP.hpp" -call compile preprocessFileLineNumbers format["%1\XEH_preInit.sqf",REPLACEPATH]; -if (GVAR(aceMedicalLoaded)) then { - //#include "initSettingsACE.inc.sqf" -} else { - #include "initSettings.inc.sqf" -}; - +#include "script_component.hpp" +ADDON = false; + +GVAR(aceMedicalLoaded) = isClass(configFile >> "CfgPatches" >> "ace_medical_engine"); +if (isClass(configFile >> "CfgPatches" >> "ace_medical") && {!GVAR(aceMedicalLoaded)}) exitWith { + INFO("PreInit: Disabled --> old ACE medical loaded"); +}; + +#include "XEH_PREP.hpp" +call compile preprocessFileLineNumbers format["%1\XEH_preInit.sqf",REPLACEPATH]; +if (GVAR(aceMedicalLoaded)) then { + //#include "initSettingsACE.inc.sqf" +} else { + #include "initSettings.inc.sqf" +}; + ADDON = true; \ No newline at end of file diff --git a/addons/compat_ace_fire/XEH_preStart.sqf b/addons/compat_ace_fire/XEH_preStart.sqf index 0cfd497..7ad3083 100644 --- a/addons/compat_ace_fire/XEH_preStart.sqf +++ b/addons/compat_ace_fire/XEH_preStart.sqf @@ -1,6 +1,6 @@ -#include "script_component.hpp" -if (isClass(configFile >> "CfgPatches" >> "ace_medical") && {!isClass(configFile >> "CfgPatches" >> "ace_medical_engine")}) exitWith { - INFO("PreStart: Disabled --> old ACE medical loaded"); -}; -#include "XEH_PREP.hpp" +#include "script_component.hpp" +if (isClass(configFile >> "CfgPatches" >> "ace_medical") && {!isClass(configFile >> "CfgPatches" >> "ace_medical_engine")}) exitWith { + INFO("PreStart: Disabled --> old ACE medical loaded"); +}; +#include "XEH_PREP.hpp" call compile preprocessFileLineNumbers format["%1\XEH_preStart.sqf",REPLACEPATH]; \ No newline at end of file diff --git a/addons/compat_ace_fire/config.cpp b/addons/compat_ace_fire/config.cpp index afe8ff5..645f5d5 100644 --- a/addons/compat_ace_fire/config.cpp +++ b/addons/compat_ace_fire/config.cpp @@ -1,48 +1,48 @@ -#include "script_component.hpp" - -#if __has_include("\z\ace\addons\fire\script_component.hpp") -#define PATCH_SKIP "ACE Fire" -#endif - -#ifndef PATCH_SKIP -class CfgPatches { - class DOUBLES(NAME,notLoaded) { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"diw_armor_plates_main"}; - VERSION_CONFIG; - }; -}; -class DOUBLES(COMPONENT_NAME,notLoaded) { - NAME = PATCH_SKIP; -}; -#else -class CfgPatches { - class ADDON { - name = COMPONENT_NAME; - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"diw_armor_plates_main",QUOTE(REPLACEMOD)}; - author = "Alien314"; - authors[] = {"Alien314","ACE-Team"}; - url = ""; - VERSION_CONFIG; - }; -}; - -class Extended_PreInit_EventHandlers { - class REPLACEMOD { - init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); - }; -}; - -class Extended_PreStart_EventHandlers { - class REPLACEMOD { - init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); - }; -}; - - +#include "script_component.hpp" + +#if __has_include("\z\ace\addons\fire\script_component.hpp") +#define PATCH_SKIP "ACE Fire" +#endif + +#ifndef PATCH_SKIP +class CfgPatches { + class DOUBLES(NAME,notLoaded) { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"diw_armor_plates_main"}; + VERSION_CONFIG; + }; +}; +class DOUBLES(COMPONENT_NAME,notLoaded) { + NAME = PATCH_SKIP; +}; +#else +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"diw_armor_plates_main",QUOTE(REPLACEMOD)}; + author = "Alien314"; + authors[] = {"Alien314","ACE-Team"}; + url = ""; + VERSION_CONFIG; + }; +}; + +class Extended_PreInit_EventHandlers { + class REPLACEMOD { + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); + }; +}; + +class Extended_PreStart_EventHandlers { + class REPLACEMOD { + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); + }; +}; + + #endif \ No newline at end of file diff --git a/addons/compat_ace_fire/functions/fnc_burnSimulation.sqf b/addons/compat_ace_fire/functions/fnc_burnSimulation.sqf index 5ce8db5..ed8197f 100644 --- a/addons/compat_ace_fire/functions/fnc_burnSimulation.sqf +++ b/addons/compat_ace_fire/functions/fnc_burnSimulation.sqf @@ -1,190 +1,190 @@ -#include "..\script_component.hpp" -/* - * Author: tcvm, johnb43 - * Simulates fire intensity over time on burning units. - * Arbitrary values to ignite people. Assumed maximum is "10". - * - * Arguments: - * 0: Unit - * 1: Instigator - * - * Return Value: - * None - * - * Example: - * [player, player] call ace_fire_fnc_burnSimulation - * - * Public: No - */ - -params ["_unit", "_instigator"]; - -[{ - params ["_args", "_pfhID"]; - _args params ["_unit", "_instigator"]; - - if (isNull _unit) exitWith { - //TRACE_1("unit is null",_unit); - - _pfhID call CBA_fnc_removePerFrameHandler; - }; - - // Locality has changed - if (!local _unit) exitWith { - //TRACE_1("unit is no longer local",_unit); - - _pfhID call CBA_fnc_removePerFrameHandler; - - ["ace_fire_burnSimulation", [_unit, _instigator], _unit] call CBA_fnc_targetEvent; - }; - - // If the unit is invulnerable, in water or if the fire has died out, stop burning the unit - if ( - !(_unit call ace_fire_fnc_isBurning) || - {!(isDamageAllowed _unit && {_unit getVariable ["ace_medical_allowDamage", true]})} || - {private _eyePos = eyePos _unit; surfaceIsWater _eyePos && {(_eyePos select 2) < 0.1}} - ) exitWith { - //TRACE_3("unit is no longer burning, invulnerable or in water",_unit,_unit call FUNC(isBurning),isDamageAllowed _unit && {_unit getVariable [ARR_2(QEGVAR(medical,allowDamage),true)]}); - - // Remove global effects - (_unit getVariable ["ace_fire_jipID", ""]) call CBA_fnc_removeGlobalEventJIP; - - // Update globally that the unit isn't burning anymore - _unit setVariable ["ace_fire_intensity", nil, true]; - - _pfhID call CBA_fnc_removePerFrameHandler; - - if (!isNil {_unit getVariable "ace_fire_stopDropRoll"} && {!isPlayer _unit}) then { - _unit setUnitPos "AUTO"; - - _unit setVariable ["ace_fire_stopDropRoll", nil, true]; - }; - }; - - if (isGamePaused) exitWith {}; - - private _intensity = _unit getVariable ["ace_fire_intensity", 0]; - - // Propagate fire to other units (alive or dead) if it's intense - if (_intensity >= BURN_THRESHOLD_INTENSE) then { - //TRACE_2("check for other units",_unit,_intensity); - - { - private _distancePercent = 1 - ((_unit distance _x) / BURN_PROPAGATE_DISTANCE); - private _adjustedIntensity = _intensity * _distancePercent; - - // Don't burn if intensity is too low or already burning with higher intensity - if (BURN_MIN_INTENSITY > _adjustedIntensity || {(_x getVariable ["ace_fire_intensity", 0]) > _adjustedIntensity}) then { - continue; - }; - - ["ace_fire_burn", [_x, _adjustedIntensity, _instigator], _x] call CBA_fnc_targetEvent; - - //TRACE_3("propagate fire",_x,_intensity,_adjustedIntensity); - } forEach nearestObjects [_unit, ["CAManBase"], BURN_PROPAGATE_DISTANCE]; - }; - - // Update intensity/fire reactions - if (CBA_missionTime >= _unit getVariable ["ace_fire_intensityUpdate", 0]) then { - //TRACE_2("update intensity",_unit,_intensity); - - _unit setVariable ["ace_fire_intensityUpdate", CBA_missionTime + INTENSITY_UPDATE]; - - _intensity = _intensity - INTENSITY_LOSS - (rain / 10); - - if (_unit call ace_common_fnc_isAwake) then { - if (_unit call ace_common_fnc_isPlayer) then { - // Decrease intensity of burn if rolling around - if ((animationState _unit) in PRONE_ROLLING_ANIMS) then { - _intensity = _intensity * INTENSITY_DECREASE_MULT_ROLLING; - }; - } else { - private _sdr = _unit getVariable ["ace_fire_stopDropRoll", false]; - - private _vehicle = objectParent _unit; - - if (isNull _vehicle && {_sdr || {0.05 > random 1}}) then { - _unit setVariable ["ace_fire_stopDropRoll", true, true]; - - if (!_sdr) then { - //TRACE_1("stop, drop, roll!",_unit); - - _unit setUnitPos "DOWN"; - doStop _unit; - }; - - // Queue up a bunch of animations - for "_i" from 0 to 2 do { - [_unit, selectRandom ["amovppnemstpsnonwnondnon_amovppnemevasnonwnondl", "amovppnemstpsnonwnondnon_amovppnemevasnonwnondr"], 0] call ace_common_fnc_doAnimation; - }; - - _intensity = _intensity - (1 / _intensity); - } else { - // Make the unit leave the vehicle - if (_vehicle != _unit) then { - //TRACE_1("Ejecting",_unit); - - _unit leaveVehicle _vehicle; - unassignVehicle _unit; - - _unit action ["Eject", _vehicle]; - }; - - _unit disableAI "TARGET"; - _unit disableAI "AUTOTARGET"; - - // Run away, erraticly - if (leader group _unit != _unit) then { - [_unit] join grpNull; - }; - - _unit doMove ((getPosATL _unit) getPos [20 + random 35, floor (random 360)]); - _unit setSpeedMode "FULL"; - _unit setSuppression 1; - }; - }; - - // Play screams and throw weapon (if enabled) - _unit call ace_fire_fnc_burnReaction; - }; - - // Keep pain around unconsciousness limit to allow for more fun interactions - private _painPercieved = (0 max ((_unit getVariable ["ace_medical_pain", 0]) - (_unit getVariable ["ace_medical_painSuppress", 0])) min 1); - private _painUnconscious = missionNamespace getVariable ["ace_medical_painUnconsciousThreshold", 0]; - private _damageToAdd = [0.15, _intensity / BURN_MAX_INTENSITY] select (!alive _unit || {_painPercieved < _painUnconscious + random 0.2}); - - if (missionNamespace getVariable ["ace_medical_enabled", false]) then { - if (!isNull _instigator) then { - _unit setVariable ["ace_medical_lastDamageSource", _instigator]; - _unit setVariable ["ace_medical_lastInstigator", _instigator]; - }; - - // Common burn areas are the hands and face https://www.ncbi.nlm.nih.gov/pubmed/16899341/ - private _bodyPart = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"] selectRandomWeighted [0.77, 0.5, 0.8, 0.8, 0.3, 0.3]; - - // Use event directly, as ace_medical_fnc_addDamageToUnit requires unit to be alive - ["ace_medical_woundReceived", [_unit, [[_damageToAdd, _bodyPart, _damageToAdd]], _instigator, "burn"]] call CBA_fnc_localEvent; - } else { - private _bodyParts = [["HitFace", "HitNeck", "HitHead"], ["HitPelvis", "HitAbdomen", "HitDiaphragm", "HitChest", "HitBody"], ["HitArms", "HitHands"], ["HitLegs"]] selectRandomWeighted [0.77, 0.5, 0.8, 0.3]; - _damageToAdd = _damageToAdd * GVAR(fireMult); - - if (EGVAR(main,enable)) exitWith { - { - if (GVAR(ignoreArmor)) then { - private _vest = vestContainer _unit; - private _plates = _vest getVariable [QEGVAR(main,plates), []]; - _vest setVariable [QEGVAR(main,plates), []]; - [{params ["_vest","_plates"]; _vest setVariable [QEGVAR(main,plates), _plates];}, [_vest,_plates]] call CBA_fnc_execNextFrame; - }; - [_unit, _damageToAdd, _x, _instigator] call EFUNC(main,receiveDamage); - } forEach _bodyParts; - }; - - { - _unit setHitPointDamage [_x, (_unit getHitPointDamage _x) + _damageToAdd, true, _instigator, _instigator]; - } forEach _bodyParts; - }; - - _unit setVariable ["ace_fire_intensity", _intensity, true]; // Globally sync intensity across all clients to make sure simulation is deterministic - }; +#include "..\script_component.hpp" +/* + * Author: tcvm, johnb43 + * Simulates fire intensity over time on burning units. + * Arbitrary values to ignite people. Assumed maximum is "10". + * + * Arguments: + * 0: Unit + * 1: Instigator + * + * Return Value: + * None + * + * Example: + * [player, player] call ace_fire_fnc_burnSimulation + * + * Public: No + */ + +params ["_unit", "_instigator"]; + +[{ + params ["_args", "_pfhID"]; + _args params ["_unit", "_instigator"]; + + if (isNull _unit) exitWith { + //TRACE_1("unit is null",_unit); + + _pfhID call CBA_fnc_removePerFrameHandler; + }; + + // Locality has changed + if (!local _unit) exitWith { + //TRACE_1("unit is no longer local",_unit); + + _pfhID call CBA_fnc_removePerFrameHandler; + + ["ace_fire_burnSimulation", [_unit, _instigator], _unit] call CBA_fnc_targetEvent; + }; + + // If the unit is invulnerable, in water or if the fire has died out, stop burning the unit + if ( + !(_unit call ace_fire_fnc_isBurning) || + {!(isDamageAllowed _unit && {_unit getVariable ["ace_medical_allowDamage", true]})} || + {private _eyePos = eyePos _unit; surfaceIsWater _eyePos && {(_eyePos select 2) < 0.1}} + ) exitWith { + //TRACE_3("unit is no longer burning, invulnerable or in water",_unit,_unit call FUNC(isBurning),isDamageAllowed _unit && {_unit getVariable [ARR_2(QEGVAR(medical,allowDamage),true)]}); + + // Remove global effects + (_unit getVariable ["ace_fire_jipID", ""]) call CBA_fnc_removeGlobalEventJIP; + + // Update globally that the unit isn't burning anymore + _unit setVariable ["ace_fire_intensity", nil, true]; + + _pfhID call CBA_fnc_removePerFrameHandler; + + if (!isNil {_unit getVariable "ace_fire_stopDropRoll"} && {!isPlayer _unit}) then { + _unit setUnitPos "AUTO"; + + _unit setVariable ["ace_fire_stopDropRoll", nil, true]; + }; + }; + + if (isGamePaused) exitWith {}; + + private _intensity = _unit getVariable ["ace_fire_intensity", 0]; + + // Propagate fire to other units (alive or dead) if it's intense + if (_intensity >= BURN_THRESHOLD_INTENSE) then { + //TRACE_2("check for other units",_unit,_intensity); + + { + private _distancePercent = 1 - ((_unit distance _x) / BURN_PROPAGATE_DISTANCE); + private _adjustedIntensity = _intensity * _distancePercent; + + // Don't burn if intensity is too low or already burning with higher intensity + if (BURN_MIN_INTENSITY > _adjustedIntensity || {(_x getVariable ["ace_fire_intensity", 0]) > _adjustedIntensity}) then { + continue; + }; + + ["ace_fire_burn", [_x, _adjustedIntensity, _instigator], _x] call CBA_fnc_targetEvent; + + //TRACE_3("propagate fire",_x,_intensity,_adjustedIntensity); + } forEach nearestObjects [_unit, ["CAManBase"], BURN_PROPAGATE_DISTANCE]; + }; + + // Update intensity/fire reactions + if (CBA_missionTime >= _unit getVariable ["ace_fire_intensityUpdate", 0]) then { + //TRACE_2("update intensity",_unit,_intensity); + + _unit setVariable ["ace_fire_intensityUpdate", CBA_missionTime + INTENSITY_UPDATE]; + + _intensity = _intensity - INTENSITY_LOSS - (rain / 10); + + if (_unit call ace_common_fnc_isAwake) then { + if (_unit call ace_common_fnc_isPlayer) then { + // Decrease intensity of burn if rolling around + if ((animationState _unit) in PRONE_ROLLING_ANIMS) then { + _intensity = _intensity * INTENSITY_DECREASE_MULT_ROLLING; + }; + } else { + private _sdr = _unit getVariable ["ace_fire_stopDropRoll", false]; + + private _vehicle = objectParent _unit; + + if (isNull _vehicle && {_sdr || {0.05 > random 1}}) then { + _unit setVariable ["ace_fire_stopDropRoll", true, true]; + + if (!_sdr) then { + //TRACE_1("stop, drop, roll!",_unit); + + _unit setUnitPos "DOWN"; + doStop _unit; + }; + + // Queue up a bunch of animations + for "_i" from 0 to 2 do { + [_unit, selectRandom ["amovppnemstpsnonwnondnon_amovppnemevasnonwnondl", "amovppnemstpsnonwnondnon_amovppnemevasnonwnondr"], 0] call ace_common_fnc_doAnimation; + }; + + _intensity = _intensity - (1 / _intensity); + } else { + // Make the unit leave the vehicle + if (_vehicle != _unit) then { + //TRACE_1("Ejecting",_unit); + + _unit leaveVehicle _vehicle; + unassignVehicle _unit; + + _unit action ["Eject", _vehicle]; + }; + + _unit disableAI "TARGET"; + _unit disableAI "AUTOTARGET"; + + // Run away, erraticly + if (leader group _unit != _unit) then { + [_unit] join grpNull; + }; + + _unit doMove ((getPosATL _unit) getPos [20 + random 35, floor (random 360)]); + _unit setSpeedMode "FULL"; + _unit setSuppression 1; + }; + }; + + // Play screams and throw weapon (if enabled) + _unit call ace_fire_fnc_burnReaction; + }; + + // Keep pain around unconsciousness limit to allow for more fun interactions + private _painPercieved = (0 max ((_unit getVariable ["ace_medical_pain", 0]) - (_unit getVariable ["ace_medical_painSuppress", 0])) min 1); + private _painUnconscious = missionNamespace getVariable ["ace_medical_painUnconsciousThreshold", 0]; + private _damageToAdd = [0.15, _intensity / BURN_MAX_INTENSITY] select (!alive _unit || {_painPercieved < _painUnconscious + random 0.2}); + + if (missionNamespace getVariable ["ace_medical_enabled", false]) then { + if (!isNull _instigator) then { + _unit setVariable ["ace_medical_lastDamageSource", _instigator]; + _unit setVariable ["ace_medical_lastInstigator", _instigator]; + }; + + // Common burn areas are the hands and face https://www.ncbi.nlm.nih.gov/pubmed/16899341/ + private _bodyPart = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"] selectRandomWeighted [0.77, 0.5, 0.8, 0.8, 0.3, 0.3]; + + // Use event directly, as ace_medical_fnc_addDamageToUnit requires unit to be alive + ["ace_medical_woundReceived", [_unit, [[_damageToAdd, _bodyPart, _damageToAdd]], _instigator, "burn"]] call CBA_fnc_localEvent; + } else { + private _bodyParts = [["HitFace", "HitNeck", "HitHead"], ["HitPelvis", "HitAbdomen", "HitDiaphragm", "HitChest", "HitBody"], ["HitArms", "HitHands"], ["HitLegs"]] selectRandomWeighted [0.77, 0.5, 0.8, 0.3]; + _damageToAdd = _damageToAdd * GVAR(fireMult); + + if (EGVAR(main,enable)) exitWith { + { + if (GVAR(ignoreArmor)) then { + private _vest = vestContainer _unit; + private _plates = _vest getVariable [QEGVAR(main,plates), []]; + _vest setVariable [QEGVAR(main,plates), []]; + [{params ["_vest","_plates"]; _vest setVariable [QEGVAR(main,plates), _plates];}, [_vest,_plates]] call CBA_fnc_execNextFrame; + }; + [_unit, _damageToAdd, _x, _instigator] call EFUNC(main,receiveDamage); + } forEach _bodyParts; + }; + + { + _unit setHitPointDamage [_x, (_unit getHitPointDamage _x) + _damageToAdd, true, _instigator, _instigator]; + } forEach _bodyParts; + }; + + _unit setVariable ["ace_fire_intensity", _intensity, true]; // Globally sync intensity across all clients to make sure simulation is deterministic + }; }, BURN_PROPAGATE_UPDATE, [_unit, _instigator]] call CBA_fnc_addPerFrameHandler; \ No newline at end of file diff --git a/addons/compat_ace_fire/initSettings.inc.sqf b/addons/compat_ace_fire/initSettings.inc.sqf index b9417d0..f473249 100644 --- a/addons/compat_ace_fire/initSettings.inc.sqf +++ b/addons/compat_ace_fire/initSettings.inc.sqf @@ -1,19 +1,19 @@ -private _header = LELSTRING(main,category); -private _category = [_header, LLSTRING(subCategoryCompat)]; - -[ - QGVAR(ignoreArmor), "CHECKBOX", - [LLSTRING(ignoreArmor), LLSTRING(ignoreArmor_desc)], - _category, - false, - true -] call CBA_fnc_addSetting; - -[ - QGVAR(fireMult), "SLIDER", - [LLSTRING(nonMedBurnMult), LLSTRING(nonMedBurnMult_desc)], - _category, - [0, 10, 0.2, 2, false], - true, - {[QGVAR(fireMult), _this, true] call ace_common_fnc_cbaSettings_settingChanged} +private _header = LELSTRING(main,category); +private _category = [_header, LLSTRING(subCategoryCompat)]; + +[ + QGVAR(ignoreArmor), "CHECKBOX", + [LLSTRING(ignoreArmor), LLSTRING(ignoreArmor_desc)], + _category, + false, + true +] call CBA_fnc_addSetting; + +[ + QGVAR(fireMult), "SLIDER", + [LLSTRING(nonMedBurnMult), LLSTRING(nonMedBurnMult_desc)], + _category, + [0, 10, 0.2, 2, false], + true, + {[QGVAR(fireMult), _this, true] call ace_common_fnc_cbaSettings_settingChanged} ] call CBA_fnc_addSetting; \ No newline at end of file diff --git a/addons/compat_ace_fire/initSettingsACE.inc.sqf b/addons/compat_ace_fire/initSettingsACE.inc.sqf index 7945295..27e5c04 100644 --- a/addons/compat_ace_fire/initSettingsACE.inc.sqf +++ b/addons/compat_ace_fire/initSettingsACE.inc.sqf @@ -1,2 +1,2 @@ -private _header = LELSTRING(main,category); -private _category = [_header, LLSTRING(subCategoryCompat)]; +private _header = LELSTRING(main,category); +private _category = [_header, LLSTRING(subCategoryCompat)]; diff --git a/addons/compat_ace_fire/script_component.hpp b/addons/compat_ace_fire/script_component.hpp index 7e701cb..3ddbbe4 100644 --- a/addons/compat_ace_fire/script_component.hpp +++ b/addons/compat_ace_fire/script_component.hpp @@ -1,31 +1,31 @@ -#define COMPONENT compat_ace_fire -#define COMPONENT_BEAUTIFIED ACE Fire Compat -#define REPLACEMOD ace_fire -#define REPLACEPATH "z\ace\addons\fire" - -#include "\z\diw_armor_plates\addons\main\script_mod.hpp" - -#include "\z\diw_armor_plates\addons\main\script_macros.hpp" - -#define PRONE_ROLLING_ANIMS [\ - "amovppnemstpsnonwnondnon_amovppnemevasnonwnondl",\ - "amovppnemstpsnonwnondnon_amovppnemevasnonwnondr",\ - "amovppnemstpsraswrfldnon_amovppnemevaslowwrfldl",\ - "amovppnemstpsraswrfldnon_amovppnemevaslowwrfldr",\ - "amovppnemstpsraswpstdnon_amovppnemevaslowwpstdl",\ - "amovppnemstpsraswpstdnon_amovppnemevaslowwpstdr",\ - "amovppnemstpsoptwbindnon_amovppnemevasoptwbindl",\ - "amovppnemstpsoptwbindnon_amovppnemevasoptwbindr"\ -] - -#define BURN_MAX_INTENSITY 10 -#define BURN_MIN_INTENSITY 1 - -#define INTENSITY_DECREASE_MULT_PAT_DOWN 0.8 -#define INTENSITY_DECREASE_MULT_ROLLING INTENSITY_DECREASE_MULT_PAT_DOWN - -#define INTENSITY_LOSS 0.02 -#define INTENSITY_UPDATE 2 -#define BURN_PROPAGATE_UPDATE 1 -#define BURN_PROPAGATE_DISTANCE 2 +#define COMPONENT compat_ace_fire +#define COMPONENT_BEAUTIFIED ACE Fire Compat +#define REPLACEMOD ace_fire +#define REPLACEPATH "z\ace\addons\fire" + +#include "\z\diw_armor_plates\addons\main\script_mod.hpp" + +#include "\z\diw_armor_plates\addons\main\script_macros.hpp" + +#define PRONE_ROLLING_ANIMS [\ + "amovppnemstpsnonwnondnon_amovppnemevasnonwnondl",\ + "amovppnemstpsnonwnondnon_amovppnemevasnonwnondr",\ + "amovppnemstpsraswrfldnon_amovppnemevaslowwrfldl",\ + "amovppnemstpsraswrfldnon_amovppnemevaslowwrfldr",\ + "amovppnemstpsraswpstdnon_amovppnemevaslowwpstdl",\ + "amovppnemstpsraswpstdnon_amovppnemevaslowwpstdr",\ + "amovppnemstpsoptwbindnon_amovppnemevasoptwbindl",\ + "amovppnemstpsoptwbindnon_amovppnemevasoptwbindr"\ +] + +#define BURN_MAX_INTENSITY 10 +#define BURN_MIN_INTENSITY 1 + +#define INTENSITY_DECREASE_MULT_PAT_DOWN 0.8 +#define INTENSITY_DECREASE_MULT_ROLLING INTENSITY_DECREASE_MULT_PAT_DOWN + +#define INTENSITY_LOSS 0.02 +#define INTENSITY_UPDATE 2 +#define BURN_PROPAGATE_UPDATE 1 +#define BURN_PROPAGATE_DISTANCE 2 #define BURN_THRESHOLD_INTENSE 3 \ No newline at end of file diff --git a/addons/compat_ace_overpressure/$PBOPREFIX$ b/addons/compat_ace_overpressure/$PBOPREFIX$ new file mode 100644 index 0000000..d2448f3 --- /dev/null +++ b/addons/compat_ace_overpressure/$PBOPREFIX$ @@ -0,0 +1 @@ +z\diw_armor_plates\addons\compat_ace_overpressure \ No newline at end of file diff --git a/addons/compat_ace_overpressure/XEH_Prep.hpp b/addons/compat_ace_overpressure/XEH_Prep.hpp new file mode 100644 index 0000000..069a33c --- /dev/null +++ b/addons/compat_ace_overpressure/XEH_Prep.hpp @@ -0,0 +1,2 @@ +[QPATHTOF(functions\fnc_overpressureDamage.sqf), QUOTE(DOUBLES(REPLACEMOD,fnc_overpressureDamage))] call CBA_fnc_compileFunction; +[QPATHTOF(functions\fnc_firedEHBB.sqf), QUOTE(DOUBLES(REPLACEMOD,fnc_firedEHBB))] call CBA_fnc_compileFunction; \ No newline at end of file diff --git a/addons/compat_ace_overpressure/XEH_preInit.sqf b/addons/compat_ace_overpressure/XEH_preInit.sqf new file mode 100644 index 0000000..f87c735 --- /dev/null +++ b/addons/compat_ace_overpressure/XEH_preInit.sqf @@ -0,0 +1,17 @@ +#include "script_component.hpp" +ADDON = false; + +GVAR(aceMedicalLoaded) = isClass(configFile >> "CfgPatches" >> "ace_medical_engine"); +if (isClass(configFile >> "CfgPatches" >> "ace_medical") && {!GVAR(aceMedicalLoaded)}) exitWith { + INFO("PreInit: Disabled --> old ACE medical loaded"); +}; + +#include "XEH_PREP.hpp" +call compile preprocessFileLineNumbers format["%1\XEH_preInit.sqf",REPLACEPATH]; +if (GVAR(aceMedicalLoaded)) then { + //#include "initSettingsACE.inc.sqf" +} else { + #include "initSettings.inc.sqf" +}; + +ADDON = true; \ No newline at end of file diff --git a/addons/compat_ace_overpressure/XEH_preStart.sqf b/addons/compat_ace_overpressure/XEH_preStart.sqf new file mode 100644 index 0000000..7ad3083 --- /dev/null +++ b/addons/compat_ace_overpressure/XEH_preStart.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" +if (isClass(configFile >> "CfgPatches" >> "ace_medical") && {!isClass(configFile >> "CfgPatches" >> "ace_medical_engine")}) exitWith { + INFO("PreStart: Disabled --> old ACE medical loaded"); +}; +#include "XEH_PREP.hpp" +call compile preprocessFileLineNumbers format["%1\XEH_preStart.sqf",REPLACEPATH]; \ No newline at end of file diff --git a/addons/compat_ace_overpressure/config.cpp b/addons/compat_ace_overpressure/config.cpp new file mode 100644 index 0000000..5c5cac4 --- /dev/null +++ b/addons/compat_ace_overpressure/config.cpp @@ -0,0 +1,48 @@ +#include "script_component.hpp" + +#if __has_include("\z\ace\addons\overpressure\script_component.hpp") +#define PATCH_SKIP "ACE Overpressure" +#endif + +#ifndef PATCH_SKIP +class CfgPatches { + class DOUBLES(NAME,notLoaded) { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"diw_armor_plates_main"}; + VERSION_CONFIG; + }; +}; +class DOUBLES(COMPONENT_NAME,notLoaded) { + NAME = PATCH_SKIP; +}; +#else +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"diw_armor_plates_main",QUOTE(REPLACEMOD)}; + author = "Alien314"; + authors[] = {"Alien314","ACE-Team"}; + url = ""; + VERSION_CONFIG; + }; +}; + +class Extended_PreInit_EventHandlers { + class REPLACEMOD { + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); + }; +}; + +class Extended_PreStart_EventHandlers { + class REPLACEMOD { + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); + }; +}; + + +#endif \ No newline at end of file diff --git a/addons/compat_ace_overpressure/functions/fnc_firedEHBB.sqf b/addons/compat_ace_overpressure/functions/fnc_firedEHBB.sqf new file mode 100644 index 0000000..0839cec --- /dev/null +++ b/addons/compat_ace_overpressure/functions/fnc_firedEHBB.sqf @@ -0,0 +1,105 @@ +#include "..\script_component.hpp" +/* + * Author: joko // Jonas + * Handle fire of local launchers. Called from the unified fired EH only for the local player. + * + * Arguments: + * None. Parameters inherited from EFUNC(common,firedEH) + * + * Return Value: + * None + * + * Example: + * [player, "launch_RPG32_F", "launch_RPG32_F", "Single", "R_PG32V_F", "RPG32_F", projectile] call ace_overpressure_fnc_firedEHBB; + * + * Public: No + */ + +//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; +//TRACE_8("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunner); + +// Retrieve backblast values +private _bbValues = [_weapon, _ammo, _magazine] call ace_overpressure_fnc_getOverPressureValues; + +_bbValues params ["_backblastAngle", "_backblastRange", "_backblastDamage", "_offset"]; +_backblastRange = _backblastRange * ace_overpressure_backblastDistanceCoefficient; + +//TRACE_4("cache",_backblastAngle,_backblastRange,_backblastDamage,_offset); + +if (_backblastDamage <= 0) exitWith {}; + +private _direction = (vectorDir _projectile) vectorMultiply -1; +private _position = (getPosASL _projectile) vectorAdd (_direction vectorMultiply _offset); + +// Damage to others +private _affected = (ASLToAGL _position) nearEntities ["CAManBase", _backblastRange]; + +// Let each client handle their own affected units +["ace_overpressure", [_unit, _position, _direction, _weapon, _magazine, _ammo], _affected] call CBA_fnc_targetEvent; + +// Damage to the firer +private _distance = 2 * ([_position, _direction, _backblastRange, _unit] call ace_overpressure_fnc_getDistance); + +//TRACE_1("Distance",_distance); + +if (_distance < _backblastRange) then { + //TRACE_2("",isDamageAllowed _unit,_unit getVariable [ARR_2(QEGVAR(medical,allowDamage),true)]); + + // Skip damage if not allowed + if (isDamageAllowed _unit && {_unit getVariable ["ace_medical_allowDamage", true]}) then { + private _alpha = sqrt (1 - _distance / _backblastRange); + private _beta = sqrt 0.5; + + private _damage = _alpha * _beta * _backblastDamage; + //TRACE_1("",_damage); + + [_damage * 100] call BIS_fnc_bloodEffect; + + if (missionNamespace getVariable ["ace_medical_enabled", false]) then { + [_unit, _damage, "body", "backblast", _unit] call ace_medical_fnc_addDamageToUnit; + } else { + if ( EGVAR(main,enable) && {!(GVAR(finishDowns) && {lifestate _unit isEqualTo "INCAPACITATED"} ) } ) exitWith { + _damage = _damage * GVAR(bbdmgCoef); + if (GVAR(ignoreArmor)) then { + private _vest = vestContainer _unit; + private _plates = _vest getVariable [QEGVAR(main,plates), []]; + _vest setVariable [QEGVAR(main,plates), []]; + [{params ["_vest","_plates"]; _vest setVariable [QEGVAR(main,plates), _plates];}, [_vest,_plates]] call CBA_fnc_execNextFrame; + }; + [_unit, _damage, "", _unit] call EFUNC(main,receiveDamage); + }; + _unit setDamage (damage _unit + _damage); + }; + }; +}; + +// Draw debug lines +#ifdef DEBUG_MODE_FULL + [ _position, + _position vectorAdd (_direction vectorMultiply _backblastRange), + [1,1,0,1] + ] call ace_common_fnc_addLineToDebugDraw; + + private _ref = _direction call ace_common_fnc_createOrthonormalReference; + [ _position, + _position vectorAdd (_direction vectorMultiply _backblastRange) vectorAdd ((_ref select 1) vectorMultiply _backblastRange * tan _backblastAngle), + [1,1,0,1] + ] call ace_common_fnc_addLineToDebugDraw; + [ _position, + _position vectorAdd (_direction vectorMultiply _backblastRange) vectorDiff ((_ref select 1) vectorMultiply _backblastRange * tan _backblastAngle), + [1,1,0,1] + ] call ace_common_fnc_addLineToDebugDraw; + [ _position, + _position vectorAdd (_direction vectorMultiply _backblastRange) vectorAdd ((_ref select 2) vectorMultiply _backblastRange * tan _backblastAngle), + [1,1,0,1] + ] call ace_common_fnc_addLineToDebugDraw; + [ _position, + _position vectorAdd (_direction vectorMultiply _backblastRange) vectorDiff ((_ref select 2) vectorMultiply _backblastRange * tan _backblastAngle), + [1,1,0,1] + ] call ace_common_fnc_addLineToDebugDraw; + + [ _position, + _position vectorAdd (_direction vectorMultiply ((_distance/2) min _backblastRange)), + [1,0,0,1] + ] call ace_common_fnc_addLineToDebugDraw; +#endif \ No newline at end of file diff --git a/addons/compat_ace_overpressure/functions/fnc_overpressureDamage.sqf b/addons/compat_ace_overpressure/functions/fnc_overpressureDamage.sqf new file mode 100644 index 0000000..83759aa --- /dev/null +++ b/addons/compat_ace_overpressure/functions/fnc_overpressureDamage.sqf @@ -0,0 +1,86 @@ +#include "..\script_component.hpp" +/* + * Author: commy2 and esteldunedain + * Calculate and apply backblast damage to potentially affected local units + * Handles the "overpressure" event. + * + * Arguments: + * 0: Unit that fired + * 1: Pos ASL of the projectile + * 2: Direction of the projectile (reversed for launcher backblast) + * 3: Weapon fired + * 4: Magazine + * 5: Ammo + * + * Return Value: + * None + * + * Example: + * [tank, [1727.57,5786.15,7.24899], [-0.982474,-0.185998,-0.0122501], "cannon_125mm", "24Rnd_125mm_APFSDS_T_Green", "Sh_125mm_APFSDS_T_Green"] call ace_overpressure_fnc_overpressureDamage + * + * Public: No + */ + +params ["_firer", "_posASL", "_direction", "_weapon", "_magazine", "_ammo"]; + +// Retrieve overpressure values +private _opValues = [_weapon, _ammo, _magazine] call ace_overpressure_fnc_getOverPressureValues; + +_opValues params ["_overpressureAngle", "_overpressureRange", "_overpressureDamage"]; +//TRACE_3("cache",_overpressureAngle,_overpressureRange,_overpressureDamage); + +{ + if (local _x && {_x != _firer} && {isNull objectParent _x}) then { + private _targetPositionASL = eyePos _x; + private _relativePosition = _targetPositionASL vectorDiff _posASL; + private _axisDistance = _relativePosition vectorDotProduct _direction; + private _distance = vectorMagnitude _relativePosition; + private _angle = acos (_axisDistance / _distance); + + private _line = [_posASL, _targetPositionASL, _firer, _x]; + private _line2 = [_posASL, _targetPositionASL]; + //TRACE_4("Affected:",_x,_axisDistance,_distance,_angle); + + if (_angle < _overpressureAngle && {_distance < _overpressureRange} && {!lineIntersects _line} && {!terrainIntersectASL _line2}) then { + //TRACE_2("",isDamageAllowed _unit,_unit getVariable [ARR_2(QEGVAR(medical,allowDamage),true)]); + + // Skip damage if not allowed + if (isDamageAllowed _x && {_x getVariable ["ace_medical_allowDamage", true]}) then { + private _alpha = sqrt (1 - _distance / _overpressureRange); + private _beta = sqrt (1 - _angle / _overpressureAngle); + + private _damage = _alpha * _beta * _overpressureDamage; + //TRACE_1("",_damage); + + // If the target is the ACE_player + if (_x isEqualTo ACE_player) then { + [_damage * 100] call BIS_fnc_bloodEffect; + }; + + if (missionNamespace getVariable ["ace_medical_enabled", false]) then { + [_x, _damage, "body", "backblast", _firer] call ace_medical_fnc_addDamageToUnit; + } else { + if ( EGVAR(main,enable) && {!(GVAR(finishDowns) && {lifestate _x isEqualTo "INCAPACITATED"} ) } ) exitWith { + _damage = _damage * GVAR(bbdmgCoef); + if (GVAR(ignoreArmor)) then { + private _vest = vestContainer _unit; + private _plates = _vest getVariable [QEGVAR(main,plates), []]; + _vest setVariable [QEGVAR(main,plates), []]; + [{params ["_vest","_plates"]; _vest setVariable [QEGVAR(main,plates), _plates];}, [_vest,_plates]] call CBA_fnc_execNextFrame; + }; + [_x, _damage, "", _firer] call EFUNC(main,receiveDamage); + }; + _x setDamage (damage _x + _damage); + }; + }; + + #ifdef DEBUG_MODE_FULL + //Shows damage lines in green + [ _posASL, + _targetPositionASL, + [0,1,0,1] + ] call ace_common_fnc_addLineToDebugDraw; + #endif + }; + }; +} forEach ((ASLToAGL _posASL) nearEntities ["CAManBase", _overpressureRange]); \ No newline at end of file diff --git a/addons/compat_ace_overpressure/initSettings.inc.sqf b/addons/compat_ace_overpressure/initSettings.inc.sqf new file mode 100644 index 0000000..edd2a2a --- /dev/null +++ b/addons/compat_ace_overpressure/initSettings.inc.sqf @@ -0,0 +1,27 @@ +private _header = LELSTRING(main,category); +private _category = [_header, LLSTRING(subCategoryCompat)]; + +[ + QGVAR(bbdmgCoef), "SLIDER", + [LLSTRING(bbdmgCoef), LLSTRING(bbdmgCoef_desc)], + _category, + [0, 10, 2.0, 2, false], + true, + {[QGVAR(bbdmgCoef), _this, true] call ace_common_fnc_cbaSettings_settingChanged} +] call CBA_fnc_addSetting; + +[ + QGVAR(ignoreArmor), "CHECKBOX", + [LLSTRING(ignoreArmor), LLSTRING(ignoreArmor_desc)], + _category, + false, + true +] call CBA_fnc_addSetting; + +[ + QGVAR(finishDowns), "CHECKBOX", + [LLSTRING(finishDowns), LLSTRING(finishDowns_desc)], + _category, + false, + true +] call CBA_fnc_addSetting; \ No newline at end of file diff --git a/addons/compat_ace_overpressure/initSettingsACE.inc.sqf b/addons/compat_ace_overpressure/initSettingsACE.inc.sqf new file mode 100644 index 0000000..27e5c04 --- /dev/null +++ b/addons/compat_ace_overpressure/initSettingsACE.inc.sqf @@ -0,0 +1,2 @@ +private _header = LELSTRING(main,category); +private _category = [_header, LLSTRING(subCategoryCompat)]; diff --git a/addons/compat_ace_overpressure/script_component.hpp b/addons/compat_ace_overpressure/script_component.hpp new file mode 100644 index 0000000..bc5834c --- /dev/null +++ b/addons/compat_ace_overpressure/script_component.hpp @@ -0,0 +1,8 @@ +#define COMPONENT compat_ace_overpressure +#define COMPONENT_BEAUTIFIED ACE Overpressure Compat +#define REPLACEMOD ace_overpressure +#define REPLACEPATH "z\ace\addons\overpressure" + +#include "\z\diw_armor_plates\addons\main\script_mod.hpp" + +#include "\z\diw_armor_plates\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/compat_ace_overpressure/stringtable.xml b/addons/compat_ace_overpressure/stringtable.xml new file mode 100644 index 0000000..dee03fe --- /dev/null +++ b/addons/compat_ace_overpressure/stringtable.xml @@ -0,0 +1,26 @@ + + + + + Compatibility + + + ACE Overpressure Damage Multiplier + + + Backblast damage is weak with plates, use this to tune it(default: 2.0). + + + ACE Overpressure Ignore Armor + + + Whether overpressure damage should ignore armor plates. + + + ACE Overpressure Finish downed units + + + Whether overpressure damage should kill units that in the downed state. + + + \ No newline at end of file diff --git a/addons/compat_ace_vehicle_damage/$PBOPREFIX$ b/addons/compat_ace_vehicle_damage/$PBOPREFIX$ new file mode 100644 index 0000000..e9b082a --- /dev/null +++ b/addons/compat_ace_vehicle_damage/$PBOPREFIX$ @@ -0,0 +1 @@ +z\diw_armor_plates\addons\compat_ace_vehicle_damage \ No newline at end of file diff --git a/addons/compat_ace_vehicle_damage/XEH_Prep.hpp b/addons/compat_ace_vehicle_damage/XEH_Prep.hpp new file mode 100644 index 0000000..c411a83 --- /dev/null +++ b/addons/compat_ace_vehicle_damage/XEH_Prep.hpp @@ -0,0 +1 @@ +[QPATHTOF(functions\fnc_medicalDamage.sqf), QUOTE(DOUBLES(REPLACEMOD,fnc_medicalDamage))] call CBA_fnc_compileFunction; \ No newline at end of file diff --git a/addons/compat_ace_vehicle_damage/XEH_preInit.sqf b/addons/compat_ace_vehicle_damage/XEH_preInit.sqf new file mode 100644 index 0000000..f87c735 --- /dev/null +++ b/addons/compat_ace_vehicle_damage/XEH_preInit.sqf @@ -0,0 +1,17 @@ +#include "script_component.hpp" +ADDON = false; + +GVAR(aceMedicalLoaded) = isClass(configFile >> "CfgPatches" >> "ace_medical_engine"); +if (isClass(configFile >> "CfgPatches" >> "ace_medical") && {!GVAR(aceMedicalLoaded)}) exitWith { + INFO("PreInit: Disabled --> old ACE medical loaded"); +}; + +#include "XEH_PREP.hpp" +call compile preprocessFileLineNumbers format["%1\XEH_preInit.sqf",REPLACEPATH]; +if (GVAR(aceMedicalLoaded)) then { + //#include "initSettingsACE.inc.sqf" +} else { + #include "initSettings.inc.sqf" +}; + +ADDON = true; \ No newline at end of file diff --git a/addons/compat_ace_vehicle_damage/XEH_preStart.sqf b/addons/compat_ace_vehicle_damage/XEH_preStart.sqf new file mode 100644 index 0000000..7ad3083 --- /dev/null +++ b/addons/compat_ace_vehicle_damage/XEH_preStart.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" +if (isClass(configFile >> "CfgPatches" >> "ace_medical") && {!isClass(configFile >> "CfgPatches" >> "ace_medical_engine")}) exitWith { + INFO("PreStart: Disabled --> old ACE medical loaded"); +}; +#include "XEH_PREP.hpp" +call compile preprocessFileLineNumbers format["%1\XEH_preStart.sqf",REPLACEPATH]; \ No newline at end of file diff --git a/addons/compat_ace_vehicle_damage/config.cpp b/addons/compat_ace_vehicle_damage/config.cpp new file mode 100644 index 0000000..12c830b --- /dev/null +++ b/addons/compat_ace_vehicle_damage/config.cpp @@ -0,0 +1,48 @@ +#include "script_component.hpp" + +#if __has_include("\z\ace\addons\vehicle_damage\script_component.hpp") +#define PATCH_SKIP "ACE Vehicle Damage" +#endif + +#ifndef PATCH_SKIP +class CfgPatches { + class DOUBLES(NAME,notLoaded) { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"diw_armor_plates_main"}; + VERSION_CONFIG; + }; +}; +class DOUBLES(COMPONENT_NAME,notLoaded) { + NAME = PATCH_SKIP; +}; +#else +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"diw_armor_plates_main",QUOTE(REPLACEMOD)}; + author = "Alien314"; + authors[] = {"Alien314","ACE-Team"}; + url = ""; + VERSION_CONFIG; + }; +}; + +class Extended_PreInit_EventHandlers { + class REPLACEMOD { + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); + }; +}; + +class Extended_PreStart_EventHandlers { + class REPLACEMOD { + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); + }; +}; + + +#endif \ No newline at end of file diff --git a/addons/compat_ace_vehicle_damage/functions/fnc_medicalDamage.sqf b/addons/compat_ace_vehicle_damage/functions/fnc_medicalDamage.sqf new file mode 100644 index 0000000..58b73d8 --- /dev/null +++ b/addons/compat_ace_vehicle_damage/functions/fnc_medicalDamage.sqf @@ -0,0 +1,44 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Applies medical damage to a unit. + * + * Arguments: + * 0: Target + * 1: Source + * 2: Instigator + * 3: Guarantee death? (default: false) + * + * Return Value: + * None + * + * Example: + * [cursorObject, player, player] call ace_vehicle_damage_fnc_medicalDamage; + * + * Public: No + */ + +params ["_unit", "_source", "_instigator", ["_guaranteeDeath", false]]; + +// Check if unit is invulnerable +if !(isDamageAllowed _unit && {_unit getVariable ["ace_medical_allowDamage", true]}) exitWith {}; + +if (missionNamespace getVariable ["ace_medical_enabled", false]) then { + for "_i" from 0 to floor (4 + random 3) do { + [_unit, random [0, 0.66, 1], selectRandom ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"], selectRandom ["bullet", "shell", "explosive"], _instigator] call ace_medical_fnc_addDamageToUnit; + }; +} else { + if (EGVAR(main,enable)) exitWith { + for "_i" from 0 to floor (4 + random 3) do { + [_unit, random [0, 0.66, 1], selectRandom ["HitFace", "HitNeck", "HitHead", "HitPelvis", "HitAbdomen", "HitDiaphragm", "HitChest", "HitBody", "HitArms", "HitHands", "HitLegs"], _instigator] call EFUNC(main,receiveDamage); + }; + }; + { + _unit setHitPointDamage [_x, (_unit getHitPointDamage _x) + random [0, 0.66, 1], true, _source, _instigator]; + } forEach ["HitFace", "HitNeck", "HitHead", "HitPelvis", "HitAbdomen", "HitDiaphragm", "HitChest", "HitBody", "HitArms", "HitHands", "HitLegs"]; +}; + +// If guaranteed death is wished +if (!GVAR(preventScriptedDeath) && {_guaranteeDeath && {alive _unit}}) then { + [_unit, "ace_vehicle_damage_medicalDamage", _source, _instigator] call ace_common_fnc_setDead; +}; \ No newline at end of file diff --git a/addons/compat_ace_vehicle_damage/initSettings.inc.sqf b/addons/compat_ace_vehicle_damage/initSettings.inc.sqf new file mode 100644 index 0000000..84f2385 --- /dev/null +++ b/addons/compat_ace_vehicle_damage/initSettings.inc.sqf @@ -0,0 +1,10 @@ +private _header = LELSTRING(main,category); +private _category = [_header, LLSTRING(subCategoryCompat)]; + +[ + QGVAR(preventScriptedDeath), "CHECKBOX", + [LLSTRING(preventScriptedDeath), LLSTRING(preventScriptedDeath_desc)], + _category, + true, + true +] call CBA_fnc_addSetting; \ No newline at end of file diff --git a/addons/compat_ace_vehicle_damage/initSettingsACE.inc.sqf b/addons/compat_ace_vehicle_damage/initSettingsACE.inc.sqf new file mode 100644 index 0000000..27e5c04 --- /dev/null +++ b/addons/compat_ace_vehicle_damage/initSettingsACE.inc.sqf @@ -0,0 +1,2 @@ +private _header = LELSTRING(main,category); +private _category = [_header, LLSTRING(subCategoryCompat)]; diff --git a/addons/compat_ace_vehicle_damage/script_component.hpp b/addons/compat_ace_vehicle_damage/script_component.hpp new file mode 100644 index 0000000..7666497 --- /dev/null +++ b/addons/compat_ace_vehicle_damage/script_component.hpp @@ -0,0 +1,8 @@ +#define COMPONENT compat_ace_vehicle_damage +#define COMPONENT_BEAUTIFIED ACE Vehicle Damage Compat +#define REPLACEMOD ace_vehicle_damage +#define REPLACEPATH "z\ace\addons\vehicle_damage" + +#include "\z\diw_armor_plates\addons\main\script_mod.hpp" + +#include "\z\diw_armor_plates\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/compat_ace_vehicle_damage/stringtable.xml b/addons/compat_ace_vehicle_damage/stringtable.xml new file mode 100644 index 0000000..bd65002 --- /dev/null +++ b/addons/compat_ace_vehicle_damage/stringtable.xml @@ -0,0 +1,14 @@ + + + + + Compatibility + + + ACE Vehicle Damage Prevent Guaranteed Death + + + Whether crew should die instantly from vehicle detonation. (Other APS Settings may still lead to instant death) + + + \ No newline at end of file From ec5860412e5cf83284c36996ead8df35166fc1f3 Mon Sep 17 00:00:00 2001 From: Alien314 Date: Sun, 1 Dec 2024 21:16:48 -0600 Subject: [PATCH 3/9] fire compat prefix --- addons/compat_ace_fire/$PBOPREFIX$ | 1 + 1 file changed, 1 insertion(+) create mode 100644 addons/compat_ace_fire/$PBOPREFIX$ diff --git a/addons/compat_ace_fire/$PBOPREFIX$ b/addons/compat_ace_fire/$PBOPREFIX$ new file mode 100644 index 0000000..f067ec0 --- /dev/null +++ b/addons/compat_ace_fire/$PBOPREFIX$ @@ -0,0 +1 @@ +z\diw_armor_plates\addons\compat_ace_fire \ No newline at end of file From ff1915fe1a36afa413dc2456153f84e1b536c6c2 Mon Sep 17 00:00:00 2001 From: Alien314 Date: Sun, 1 Dec 2024 21:25:45 -0600 Subject: [PATCH 4/9] Fixing caps --- addons/compat_ace_fire/XEH_Prep.hpp | 1 - addons/compat_ace_overpressure/XEH_Prep.hpp | 2 -- addons/compat_ace_overpressure/functions/fnc_firedEHBB.sqf | 2 +- .../functions/fnc_overpressureDamage.sqf | 2 +- addons/compat_ace_vehicle_damage/XEH_Prep.hpp | 1 - 5 files changed, 2 insertions(+), 6 deletions(-) delete mode 100644 addons/compat_ace_fire/XEH_Prep.hpp delete mode 100644 addons/compat_ace_overpressure/XEH_Prep.hpp delete mode 100644 addons/compat_ace_vehicle_damage/XEH_Prep.hpp diff --git a/addons/compat_ace_fire/XEH_Prep.hpp b/addons/compat_ace_fire/XEH_Prep.hpp deleted file mode 100644 index fe46ba3..0000000 --- a/addons/compat_ace_fire/XEH_Prep.hpp +++ /dev/null @@ -1 +0,0 @@ -[QPATHTOF(functions\fnc_burnSimulation.sqf), QUOTE(DOUBLES(REPLACEMOD,fnc_burnSimulation))] call CBA_fnc_compileFunction; \ No newline at end of file diff --git a/addons/compat_ace_overpressure/XEH_Prep.hpp b/addons/compat_ace_overpressure/XEH_Prep.hpp deleted file mode 100644 index 069a33c..0000000 --- a/addons/compat_ace_overpressure/XEH_Prep.hpp +++ /dev/null @@ -1,2 +0,0 @@ -[QPATHTOF(functions\fnc_overpressureDamage.sqf), QUOTE(DOUBLES(REPLACEMOD,fnc_overpressureDamage))] call CBA_fnc_compileFunction; -[QPATHTOF(functions\fnc_firedEHBB.sqf), QUOTE(DOUBLES(REPLACEMOD,fnc_firedEHBB))] call CBA_fnc_compileFunction; \ No newline at end of file diff --git a/addons/compat_ace_overpressure/functions/fnc_firedEHBB.sqf b/addons/compat_ace_overpressure/functions/fnc_firedEHBB.sqf index 0839cec..af8a0e5 100644 --- a/addons/compat_ace_overpressure/functions/fnc_firedEHBB.sqf +++ b/addons/compat_ace_overpressure/functions/fnc_firedEHBB.sqf @@ -58,7 +58,7 @@ if (_distance < _backblastRange) then { if (missionNamespace getVariable ["ace_medical_enabled", false]) then { [_unit, _damage, "body", "backblast", _unit] call ace_medical_fnc_addDamageToUnit; } else { - if ( EGVAR(main,enable) && {!(GVAR(finishDowns) && {lifestate _unit isEqualTo "INCAPACITATED"} ) } ) exitWith { + if ( EGVAR(main,enable) && {!(GVAR(finishDowns) && {lifeState _unit isEqualTo "INCAPACITATED"} ) } ) exitWith { _damage = _damage * GVAR(bbdmgCoef); if (GVAR(ignoreArmor)) then { private _vest = vestContainer _unit; diff --git a/addons/compat_ace_overpressure/functions/fnc_overpressureDamage.sqf b/addons/compat_ace_overpressure/functions/fnc_overpressureDamage.sqf index 83759aa..1b62d58 100644 --- a/addons/compat_ace_overpressure/functions/fnc_overpressureDamage.sqf +++ b/addons/compat_ace_overpressure/functions/fnc_overpressureDamage.sqf @@ -60,7 +60,7 @@ _opValues params ["_overpressureAngle", "_overpressureRange", "_overpressureDama if (missionNamespace getVariable ["ace_medical_enabled", false]) then { [_x, _damage, "body", "backblast", _firer] call ace_medical_fnc_addDamageToUnit; } else { - if ( EGVAR(main,enable) && {!(GVAR(finishDowns) && {lifestate _x isEqualTo "INCAPACITATED"} ) } ) exitWith { + if ( EGVAR(main,enable) && {!(GVAR(finishDowns) && {lifeState _x isEqualTo "INCAPACITATED"} ) } ) exitWith { _damage = _damage * GVAR(bbdmgCoef); if (GVAR(ignoreArmor)) then { private _vest = vestContainer _unit; diff --git a/addons/compat_ace_vehicle_damage/XEH_Prep.hpp b/addons/compat_ace_vehicle_damage/XEH_Prep.hpp deleted file mode 100644 index c411a83..0000000 --- a/addons/compat_ace_vehicle_damage/XEH_Prep.hpp +++ /dev/null @@ -1 +0,0 @@ -[QPATHTOF(functions\fnc_medicalDamage.sqf), QUOTE(DOUBLES(REPLACEMOD,fnc_medicalDamage))] call CBA_fnc_compileFunction; \ No newline at end of file From b768d67cbc03300bc0ddab527e257c226f18b019 Mon Sep 17 00:00:00 2001 From: Alien314 Date: Sun, 1 Dec 2024 21:27:17 -0600 Subject: [PATCH 5/9] fixed Caps --- addons/compat_ace_fire/XEH_PREP.hpp | 1 + addons/compat_ace_overpressure/XEH_PREP.hpp | 2 ++ addons/compat_ace_vehicle_damage/XEH_PREP.hpp | 1 + 3 files changed, 4 insertions(+) create mode 100644 addons/compat_ace_fire/XEH_PREP.hpp create mode 100644 addons/compat_ace_overpressure/XEH_PREP.hpp create mode 100644 addons/compat_ace_vehicle_damage/XEH_PREP.hpp diff --git a/addons/compat_ace_fire/XEH_PREP.hpp b/addons/compat_ace_fire/XEH_PREP.hpp new file mode 100644 index 0000000..fe46ba3 --- /dev/null +++ b/addons/compat_ace_fire/XEH_PREP.hpp @@ -0,0 +1 @@ +[QPATHTOF(functions\fnc_burnSimulation.sqf), QUOTE(DOUBLES(REPLACEMOD,fnc_burnSimulation))] call CBA_fnc_compileFunction; \ No newline at end of file diff --git a/addons/compat_ace_overpressure/XEH_PREP.hpp b/addons/compat_ace_overpressure/XEH_PREP.hpp new file mode 100644 index 0000000..069a33c --- /dev/null +++ b/addons/compat_ace_overpressure/XEH_PREP.hpp @@ -0,0 +1,2 @@ +[QPATHTOF(functions\fnc_overpressureDamage.sqf), QUOTE(DOUBLES(REPLACEMOD,fnc_overpressureDamage))] call CBA_fnc_compileFunction; +[QPATHTOF(functions\fnc_firedEHBB.sqf), QUOTE(DOUBLES(REPLACEMOD,fnc_firedEHBB))] call CBA_fnc_compileFunction; \ No newline at end of file diff --git a/addons/compat_ace_vehicle_damage/XEH_PREP.hpp b/addons/compat_ace_vehicle_damage/XEH_PREP.hpp new file mode 100644 index 0000000..c411a83 --- /dev/null +++ b/addons/compat_ace_vehicle_damage/XEH_PREP.hpp @@ -0,0 +1 @@ +[QPATHTOF(functions\fnc_medicalDamage.sqf), QUOTE(DOUBLES(REPLACEMOD,fnc_medicalDamage))] call CBA_fnc_compileFunction; \ No newline at end of file From d67ccf82b666314810301d20c197fd93a2eb747a Mon Sep 17 00:00:00 2001 From: Alien314 Date: Sun, 1 Dec 2024 21:33:57 -0600 Subject: [PATCH 6/9] hemtt screm pe23 --- addons/compat_ace_fire/config.cpp | 1 + addons/compat_ace_overpressure/config.cpp | 1 + addons/compat_ace_vehicle_damage/config.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/addons/compat_ace_fire/config.cpp b/addons/compat_ace_fire/config.cpp index 645f5d5..b50e406 100644 --- a/addons/compat_ace_fire/config.cpp +++ b/addons/compat_ace_fire/config.cpp @@ -1,5 +1,6 @@ #include "script_component.hpp" +#pragma hemtt flag pe23_ignore_has_include #if __has_include("\z\ace\addons\fire\script_component.hpp") #define PATCH_SKIP "ACE Fire" #endif diff --git a/addons/compat_ace_overpressure/config.cpp b/addons/compat_ace_overpressure/config.cpp index 5c5cac4..369f142 100644 --- a/addons/compat_ace_overpressure/config.cpp +++ b/addons/compat_ace_overpressure/config.cpp @@ -1,5 +1,6 @@ #include "script_component.hpp" +#pragma hemtt flag pe23_ignore_has_include #if __has_include("\z\ace\addons\overpressure\script_component.hpp") #define PATCH_SKIP "ACE Overpressure" #endif diff --git a/addons/compat_ace_vehicle_damage/config.cpp b/addons/compat_ace_vehicle_damage/config.cpp index 12c830b..1a7b98d 100644 --- a/addons/compat_ace_vehicle_damage/config.cpp +++ b/addons/compat_ace_vehicle_damage/config.cpp @@ -1,5 +1,6 @@ #include "script_component.hpp" +#pragma hemtt flag pe23_ignore_has_include #if __has_include("\z\ace\addons\vehicle_damage\script_component.hpp") #define PATCH_SKIP "ACE Vehicle Damage" #endif From 6d21e932476859f05c76499f5d442aeab416312d Mon Sep 17 00:00:00 2001 From: Alien314 Date: Sun, 1 Dec 2024 21:43:45 -0600 Subject: [PATCH 7/9] Fix wrong macro --- addons/compat_ace_fire/config.cpp | 6 +++--- addons/compat_ace_overpressure/config.cpp | 6 +++--- addons/compat_ace_vehicle_damage/config.cpp | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/compat_ace_fire/config.cpp b/addons/compat_ace_fire/config.cpp index b50e406..3428e7b 100644 --- a/addons/compat_ace_fire/config.cpp +++ b/addons/compat_ace_fire/config.cpp @@ -7,7 +7,7 @@ #ifndef PATCH_SKIP class CfgPatches { - class DOUBLES(NAME,notLoaded) { + class DOUBLES(ADDON,notLoaded) { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; @@ -15,8 +15,8 @@ class CfgPatches { VERSION_CONFIG; }; }; -class DOUBLES(COMPONENT_NAME,notLoaded) { - NAME = PATCH_SKIP; +class DOUBLES(PREFIX,notLoaded) { + ADDON = "ACE Fire"; }; #else class CfgPatches { diff --git a/addons/compat_ace_overpressure/config.cpp b/addons/compat_ace_overpressure/config.cpp index 369f142..1546550 100644 --- a/addons/compat_ace_overpressure/config.cpp +++ b/addons/compat_ace_overpressure/config.cpp @@ -7,7 +7,7 @@ #ifndef PATCH_SKIP class CfgPatches { - class DOUBLES(NAME,notLoaded) { + class DOUBLES(ADDON,notLoaded) { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; @@ -15,8 +15,8 @@ class CfgPatches { VERSION_CONFIG; }; }; -class DOUBLES(COMPONENT_NAME,notLoaded) { - NAME = PATCH_SKIP; +class DOUBLES(PREFIX,notLoaded) { + ADDON = "ACE Overpressure"; }; #else class CfgPatches { diff --git a/addons/compat_ace_vehicle_damage/config.cpp b/addons/compat_ace_vehicle_damage/config.cpp index 1a7b98d..bcbfed1 100644 --- a/addons/compat_ace_vehicle_damage/config.cpp +++ b/addons/compat_ace_vehicle_damage/config.cpp @@ -7,7 +7,7 @@ #ifndef PATCH_SKIP class CfgPatches { - class DOUBLES(NAME,notLoaded) { + class DOUBLES(ADDON,notLoaded) { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; @@ -15,8 +15,8 @@ class CfgPatches { VERSION_CONFIG; }; }; -class DOUBLES(COMPONENT_NAME,notLoaded) { - NAME = PATCH_SKIP; +class DOUBLES(PREFIX,notLoaded) { + ADDON = "ACE Vehicle Damage"; }; #else class CfgPatches { From 33bc4af1d35ba96a0bb431c1fac2c80baded55ec Mon Sep 17 00:00:00 2001 From: Alien314 Date: Mon, 2 Dec 2024 15:43:08 -0600 Subject: [PATCH 8/9] Add Vehicle Damage setting to ACE med settings --- addons/compat_ace_vehicle_damage/initSettingsACE.inc.sqf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/compat_ace_vehicle_damage/initSettingsACE.inc.sqf b/addons/compat_ace_vehicle_damage/initSettingsACE.inc.sqf index 27e5c04..7899736 100644 --- a/addons/compat_ace_vehicle_damage/initSettingsACE.inc.sqf +++ b/addons/compat_ace_vehicle_damage/initSettingsACE.inc.sqf @@ -1,2 +1,10 @@ private _header = LELSTRING(main,category); private _category = [_header, LLSTRING(subCategoryCompat)]; + +[ + QGVAR(preventScriptedDeath), "CHECKBOX", + [LLSTRING(preventScriptedDeath), LLSTRING(preventScriptedDeath_desc)], + _category, + false, + true +] call CBA_fnc_addSetting; \ No newline at end of file From 1639a55324f74f37f05669d8d35a35e15f602d9d Mon Sep 17 00:00:00 2001 From: Alien314 Date: Mon, 2 Dec 2024 17:30:57 -0600 Subject: [PATCH 9/9] Use skipWhenMiss... instead, Only replace preStart, Remove unused initSettingsACE --- addons/compat_ace_fire/XEH_preInit.sqf | 8 +++--- addons/compat_ace_fire/config.cpp | 27 +++---------------- .../compat_ace_fire/initSettingsACE.inc.sqf | 2 -- .../compat_ace_overpressure/XEH_preInit.sqf | 8 +++--- addons/compat_ace_overpressure/config.cpp | 27 +++---------------- .../initSettingsACE.inc.sqf | 2 -- .../compat_ace_vehicle_damage/XEH_preInit.sqf | 10 +++---- addons/compat_ace_vehicle_damage/config.cpp | 27 +++---------------- 8 files changed, 19 insertions(+), 92 deletions(-) delete mode 100644 addons/compat_ace_fire/initSettingsACE.inc.sqf delete mode 100644 addons/compat_ace_overpressure/initSettingsACE.inc.sqf diff --git a/addons/compat_ace_fire/XEH_preInit.sqf b/addons/compat_ace_fire/XEH_preInit.sqf index f87c735..a449162 100644 --- a/addons/compat_ace_fire/XEH_preInit.sqf +++ b/addons/compat_ace_fire/XEH_preInit.sqf @@ -6,12 +6,10 @@ if (isClass(configFile >> "CfgPatches" >> "ace_medical") && {!GVAR(aceMedicalLoa INFO("PreInit: Disabled --> old ACE medical loaded"); }; -#include "XEH_PREP.hpp" -call compile preprocessFileLineNumbers format["%1\XEH_preInit.sqf",REPLACEPATH]; -if (GVAR(aceMedicalLoaded)) then { +if (GVAR(aceMedicalLoaded)) exitWith { //#include "initSettingsACE.inc.sqf" -} else { - #include "initSettings.inc.sqf" }; +#include "initSettings.inc.sqf" + ADDON = true; \ No newline at end of file diff --git a/addons/compat_ace_fire/config.cpp b/addons/compat_ace_fire/config.cpp index 3428e7b..b04cd4c 100644 --- a/addons/compat_ace_fire/config.cpp +++ b/addons/compat_ace_fire/config.cpp @@ -1,24 +1,5 @@ #include "script_component.hpp" -#pragma hemtt flag pe23_ignore_has_include -#if __has_include("\z\ace\addons\fire\script_component.hpp") -#define PATCH_SKIP "ACE Fire" -#endif - -#ifndef PATCH_SKIP -class CfgPatches { - class DOUBLES(ADDON,notLoaded) { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"diw_armor_plates_main"}; - VERSION_CONFIG; - }; -}; -class DOUBLES(PREFIX,notLoaded) { - ADDON = "ACE Fire"; -}; -#else class CfgPatches { class ADDON { name = COMPONENT_NAME; @@ -30,11 +11,12 @@ class CfgPatches { authors[] = {"Alien314","ACE-Team"}; url = ""; VERSION_CONFIG; + skipWhenMissingDependencies = 1; }; }; class Extended_PreInit_EventHandlers { - class REPLACEMOD { + class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; @@ -43,7 +25,4 @@ class Extended_PreStart_EventHandlers { class REPLACEMOD { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; -}; - - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/addons/compat_ace_fire/initSettingsACE.inc.sqf b/addons/compat_ace_fire/initSettingsACE.inc.sqf deleted file mode 100644 index 27e5c04..0000000 --- a/addons/compat_ace_fire/initSettingsACE.inc.sqf +++ /dev/null @@ -1,2 +0,0 @@ -private _header = LELSTRING(main,category); -private _category = [_header, LLSTRING(subCategoryCompat)]; diff --git a/addons/compat_ace_overpressure/XEH_preInit.sqf b/addons/compat_ace_overpressure/XEH_preInit.sqf index f87c735..a449162 100644 --- a/addons/compat_ace_overpressure/XEH_preInit.sqf +++ b/addons/compat_ace_overpressure/XEH_preInit.sqf @@ -6,12 +6,10 @@ if (isClass(configFile >> "CfgPatches" >> "ace_medical") && {!GVAR(aceMedicalLoa INFO("PreInit: Disabled --> old ACE medical loaded"); }; -#include "XEH_PREP.hpp" -call compile preprocessFileLineNumbers format["%1\XEH_preInit.sqf",REPLACEPATH]; -if (GVAR(aceMedicalLoaded)) then { +if (GVAR(aceMedicalLoaded)) exitWith { //#include "initSettingsACE.inc.sqf" -} else { - #include "initSettings.inc.sqf" }; +#include "initSettings.inc.sqf" + ADDON = true; \ No newline at end of file diff --git a/addons/compat_ace_overpressure/config.cpp b/addons/compat_ace_overpressure/config.cpp index 1546550..b04cd4c 100644 --- a/addons/compat_ace_overpressure/config.cpp +++ b/addons/compat_ace_overpressure/config.cpp @@ -1,24 +1,5 @@ #include "script_component.hpp" -#pragma hemtt flag pe23_ignore_has_include -#if __has_include("\z\ace\addons\overpressure\script_component.hpp") -#define PATCH_SKIP "ACE Overpressure" -#endif - -#ifndef PATCH_SKIP -class CfgPatches { - class DOUBLES(ADDON,notLoaded) { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"diw_armor_plates_main"}; - VERSION_CONFIG; - }; -}; -class DOUBLES(PREFIX,notLoaded) { - ADDON = "ACE Overpressure"; -}; -#else class CfgPatches { class ADDON { name = COMPONENT_NAME; @@ -30,11 +11,12 @@ class CfgPatches { authors[] = {"Alien314","ACE-Team"}; url = ""; VERSION_CONFIG; + skipWhenMissingDependencies = 1; }; }; class Extended_PreInit_EventHandlers { - class REPLACEMOD { + class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; @@ -43,7 +25,4 @@ class Extended_PreStart_EventHandlers { class REPLACEMOD { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; -}; - - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/addons/compat_ace_overpressure/initSettingsACE.inc.sqf b/addons/compat_ace_overpressure/initSettingsACE.inc.sqf deleted file mode 100644 index 27e5c04..0000000 --- a/addons/compat_ace_overpressure/initSettingsACE.inc.sqf +++ /dev/null @@ -1,2 +0,0 @@ -private _header = LELSTRING(main,category); -private _category = [_header, LLSTRING(subCategoryCompat)]; diff --git a/addons/compat_ace_vehicle_damage/XEH_preInit.sqf b/addons/compat_ace_vehicle_damage/XEH_preInit.sqf index f87c735..cb89957 100644 --- a/addons/compat_ace_vehicle_damage/XEH_preInit.sqf +++ b/addons/compat_ace_vehicle_damage/XEH_preInit.sqf @@ -6,12 +6,10 @@ if (isClass(configFile >> "CfgPatches" >> "ace_medical") && {!GVAR(aceMedicalLoa INFO("PreInit: Disabled --> old ACE medical loaded"); }; -#include "XEH_PREP.hpp" -call compile preprocessFileLineNumbers format["%1\XEH_preInit.sqf",REPLACEPATH]; -if (GVAR(aceMedicalLoaded)) then { - //#include "initSettingsACE.inc.sqf" -} else { - #include "initSettings.inc.sqf" +if (GVAR(aceMedicalLoaded)) exitWith { + #include "initSettingsACE.inc.sqf" }; +#include "initSettings.inc.sqf" + ADDON = true; \ No newline at end of file diff --git a/addons/compat_ace_vehicle_damage/config.cpp b/addons/compat_ace_vehicle_damage/config.cpp index bcbfed1..b04cd4c 100644 --- a/addons/compat_ace_vehicle_damage/config.cpp +++ b/addons/compat_ace_vehicle_damage/config.cpp @@ -1,24 +1,5 @@ #include "script_component.hpp" -#pragma hemtt flag pe23_ignore_has_include -#if __has_include("\z\ace\addons\vehicle_damage\script_component.hpp") -#define PATCH_SKIP "ACE Vehicle Damage" -#endif - -#ifndef PATCH_SKIP -class CfgPatches { - class DOUBLES(ADDON,notLoaded) { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"diw_armor_plates_main"}; - VERSION_CONFIG; - }; -}; -class DOUBLES(PREFIX,notLoaded) { - ADDON = "ACE Vehicle Damage"; -}; -#else class CfgPatches { class ADDON { name = COMPONENT_NAME; @@ -30,11 +11,12 @@ class CfgPatches { authors[] = {"Alien314","ACE-Team"}; url = ""; VERSION_CONFIG; + skipWhenMissingDependencies = 1; }; }; class Extended_PreInit_EventHandlers { - class REPLACEMOD { + class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; @@ -43,7 +25,4 @@ class Extended_PreStart_EventHandlers { class REPLACEMOD { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; -}; - - -#endif \ No newline at end of file +}; \ No newline at end of file