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

Tripflares - Change setting to different magazines #10757

Merged
merged 1 commit into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions addons/explosives/ACE_Triggers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,10 @@ class ACE_Triggers {
picture = QPATHTOF(Data\UI\Tripwire.paa);
onPlace = QUOTE(false);
};
class Tripwire_Airburst {
isAttachable = 0;
displayName = CSTRING(Tripwire_Airburst);
picture = QPATHTOF(Data\UI\Tripwire.paa);
onPlace = QUOTE((_this # 1) setVariable [ARR_3(QQGVAR(airburst),true,true)]; false);
};
};
16 changes: 12 additions & 4 deletions addons/explosives/CfgAmmo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ class CfgAmmo {
};

class ACE_FlareTripMine_Wire_Ammo: APERSTripMine_Wire_Ammo {
GVAR(flareClass) = "F_40mm_White";
SoundSetExplosion[] = {};
defaultMagazine = "ACE_FlareTripMine_Mag"; // Mag that gets dropped after defuse
hit = 0;
indirectHit = 0;
indirectHitRange = 0;
soundHit[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100};
explosionEffects = "ACE_TripflareEffect";
explosionEffects = "";
CraterEffects = "";
soundTrigger[] = {"",1,1};
class CamShakeExplode {
Expand All @@ -51,10 +52,17 @@ class CfgAmmo {
frequency = 0;
distance = 0;
};
class EventHandlers {
init = QUOTE(call FUNC(tripflare_init));
};
};
class ACE_FlareTripMine_Wire_Ammo_Red: ACE_FlareTripMine_Wire_Ammo {
defaultMagazine = "ACE_FlareTripMine_Mag_Red";
GVAR(flareClass) = "F_40mm_Red";
};
class ACE_FlareTripMineAir_Wire_Ammo: ACE_FlareTripMine_Wire_Ammo {
defaultMagazine = "ACE_FlareTripMineAir_Mag";
explosionEffects = "ACE_TripflareAirEffect";
class ACE_FlareTripMine_Wire_Ammo_Green: ACE_FlareTripMine_Wire_Ammo {
defaultMagazine = "ACE_FlareTripMine_Mag_Green";
GVAR(flareClass) = "F_40mm_Green";
};

class F_20mm_Red;
Expand Down
25 changes: 0 additions & 25 deletions addons/explosives/CfgCloudlets.hpp

This file was deleted.

15 changes: 12 additions & 3 deletions addons/explosives/CfgMagazines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,19 @@ class CfgMagazines {
displayName = CSTRING(TripFlare_Name);
descriptionShort = CSTRING(TripFlare_Description);
class Library {libTextDesc = CSTRING(TripFlare_Description);};
class ACE_Triggers {
SupportedTriggers[] = {"Tripwire", "Tripwire_Airburst"};
class Tripwire;
class Tripwire_Airburst;
};
};
class ACE_FlareTripMine_Mag_Red: ACE_FlareTripMine_Mag {
ammo = "ACE_FlareTripMine_Wire_Ammo_Red";
displayName = CSTRING(TripFlare_Name_Red);
};
class ACE_FlareTripMineAir_Mag: ACE_FlareTripMine_Mag {
ammo = "ACE_FlareTripMineAir_Wire_Ammo";
displayName = CSTRING(TripFlareAir_Name);
class ACE_FlareTripMine_Mag_Green: ACE_FlareTripMine_Mag {
ammo = "ACE_FlareTripMine_Wire_Ammo_Green";
displayName = CSTRING(TripFlare_Name_Green);
};

class ClaymoreDirectionalMine_Remote_Mag: CA_Magazine {
Expand Down
10 changes: 7 additions & 3 deletions addons/explosives/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,13 @@ class CfgVehicles {
ammo = "ACE_FlareTripMine_Wire_Ammo";
displayName = CSTRING(TripFlare_Name);
};
class ACE_FlareTripMineAir: ACE_FlareTripMine {
ammo = "ACE_FlareTripMineAir_Wire_Ammo";
displayName = CSTRING(TripFlareAir_Name);
class ACE_FlareTripMineRed: ACE_FlareTripMine {
ammo = "ACE_FlareTripMine_Wire_Ammo_Red";
displayName = CSTRING(TripFlare_Name_Red);
};
class ACE_FlareTripMineGreen: ACE_FlareTripMine {
ammo = "ACE_FlareTripMine_Wire_Ammo_Green";
displayName = CSTRING(TripFlare_Name_Green);
};

class Claymore_F: MineBase {
Expand Down
2 changes: 1 addition & 1 deletion addons/explosives/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class CfgWeapons {
muzzles[] += {QGVAR(muzzle)};
class PutMuzzle: Default {};
class GVAR(muzzle): PutMuzzle {
magazines[] = {"ACE_FlareTripMine_Mag", "ACE_APERSMine_ToePopper_Mag"};
magazines[] = {"ACE_FlareTripMine_Mag", "ACE_FlareTripMine_Mag_Red", "ACE_FlareTripMine_Mag_Green", "ACE_APERSMine_ToePopper_Mag"};
};
};

Expand Down
2 changes: 1 addition & 1 deletion addons/explosives/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ PREP(selectTrigger);
PREP(setupExplosive);
PREP(setPosition);
PREP(setSpeedDial);
PREP(spawnFlare);
PREP(startDefuse);
PREP(startTimer);
PREP(triggerType);
PREP(allowDefuse);
PREP(isAllowedDefuse);
PREP(checkDetonateHandlers);
PREP(woundsHandlerToePopper);
PREP(tripflare_init);
3 changes: 1 addition & 2 deletions addons/explosives/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {"ACE_ModuleMine_SLAMBottomMine", "ACE_ModuleExplosive_IEDUrbanBig_Range", "ACE_ModuleExplosive_IEDLandBig_Range", "ACE_ModuleExplosive_IEDUrbanSmall_Range", "ACE_ModuleExplosive_IEDLandSmall_Range", "ACE_APERSMine_ToePopper"};
units[] = {"ACE_ModuleMine_SLAMBottomMine", "ACE_ModuleExplosive_IEDUrbanBig_Range", "ACE_ModuleExplosive_IEDLandBig_Range", "ACE_ModuleExplosive_IEDUrbanSmall_Range", "ACE_ModuleExplosive_IEDLandSmall_Range", "ACE_APERSMine_ToePopper", "ACE_FlareTripMine_Mag", "ACE_FlareTripMine_Mag_Red", "ACE_FlareTripMine_Mag_Green"};
weapons[] = {"ACE_Clacker", "ACE_DefusalKit", "ACE_M26_Clacker", "ACE_DeadManSwitch", "ACE_Cellphone"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"};
Expand All @@ -21,7 +21,6 @@ class CfgPatches {
#include "CfgMagazines.hpp"
#include "CfgWeapons.hpp"
#include "CfgVehicles.hpp"
#include "CfgCloudlets.hpp"

#include "ACE_Triggers.hpp"
#include "ACE_Arsenal_Stats.hpp"
Expand Down
27 changes: 0 additions & 27 deletions addons/explosives/functions/fnc_spawnFlare.sqf

This file was deleted.

37 changes: 37 additions & 0 deletions addons/explosives/functions/fnc_tripflare_init.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include "..\script_component.hpp"
/*
* Author: VKing, MikeMF, PabstMirror
* Spawns a flare on the ground for tripflare trigger
*
* Arguments:
* 0: Ammo <OBJECT>
* 1: Position ASL <ARRAY>
*
* Return Value:
* None
*
* Example:
* [flare, [0,0,0]] call ace_explosives_fnc_tripflare_init
*
* Public: no
*/

params ["_mine"];
_mine addEventHandler ["Explode", { // runs where mine is local
params ["_projectile", "_posASL"];
TRACE_2("tripflare-explode",_projectile,_posASL);

private _flareClass = getText ((configOf _projectile) >> QGVAR(flareClass));
if (_flareClass == "") exitWith { ERROR_1("bad flare cfg %1",typeOf _projectile) };

private _airburst = _projectile getVariable [QGVAR(airburst), false];
if (_airburst) then {
_posASL set [2, _posASL # 2 + 200];
};

private _flare = createVehicle [_flareClass, ASLToAGL _posASL, [], 0, "CAN_COLLIDE"];
_flare setVelocity [0, 0, -1]; // Used for air mode, does nothing if already on the ground.

TRACE_1("",_flare);
["ace_tripflareTriggered", [_flare, ASLToAGL _posASL]] call CBA_fnc_globalEvent;
}];
10 changes: 0 additions & 10 deletions addons/explosives/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,3 @@ private _categoryStr = format ["ACE %1", LLSTRING(Menu)];
[_categoryStr, LLSTRING(ExplosiveTimer)],
[0, 5999, TIMER_VALUE_DEFAULT]
] call CBA_fnc_addSetting;

// Tripflares
[
QGVAR(tripflareColour),
"LIST",
[LLSTRING(TripflareColour_DisplayName), LLSTRING(TripflareColour_Description)],
[_categoryStr, LLSTRING(Tripflares)],
[[0, 1, 2], ["$str_cfg_markercol_white", "$str_cfg_markercol_red", "$str_cfg_markercol_green"], 1],
1
] call CBA_fnc_addSetting;
22 changes: 0 additions & 22 deletions addons/explosives/scripts/TripflareAirEffect.sqf

This file was deleted.

20 changes: 0 additions & 20 deletions addons/explosives/scripts/TripflareEffect.sqf

This file was deleted.

21 changes: 9 additions & 12 deletions addons/explosives/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,12 @@
<Chinese>絆線閃光地雷</Chinese>
<Chinesesimp>绊线信号弹</Chinesesimp>
</Key>
<Key ID="STR_ACE_Explosives_TripFlare_Name_Red">
<English>Tripwire Flare (Red)</English>
</Key>
<Key ID="STR_ACE_Explosives_TripFlare_Name_Green">
<English>Tripwire Flare (Green)</English>
</Key>
<Key ID="STR_ACE_Explosives_TripWire">
<English>Tripwire</English>
<Czech>Nástražný drát</Czech>
Expand All @@ -1061,6 +1067,9 @@
<Turkish>Telli tuzak</Turkish>
<Hungarian>Botlódrót</Hungarian>
</Key>
<Key ID="STR_ACE_Explosives_TripWire_Airburst">
<English>Tripwire - Airburst</English>
</Key>
<Key ID="STR_ACE_Explosives_apersToePopper">
<English>APERS Mine (Toe-Popper)</English>
<French>Mine APERS (Toe-Popper)</French>
Expand Down Expand Up @@ -1187,17 +1196,5 @@
<Turkish>Zamanlayıcı</Turkish>
<Hungarian>Időzítő</Hungarian>
</Key>
<Key ID="STR_ACE_Explosives_Tripflares">
<English>Tripflares</English>
</Key>
<Key ID="STR_ACE_Explosives_TripflareColour_DisplayName">
<English>Tripflare Colour</English>
</Key>
<Key ID="STR_ACE_Explosives_TripflareColour_Description">
<English>What colour the tripflare will be</English>
</Key>
<Key ID="STR_ACE_Explosives_TripFlareAir_Name">
<English>Tripwire Flare (Air)</English>
</Key>
</Package>
</Project>