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

Explosives - Add Tripwire Flare Air Variant #10423

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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: 5 additions & 1 deletion addons/explosives/CfgAmmo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class CfgAmmo {
// GVAR(size) = 0; is small size
// GVAR(size) = 1; is large size
class ClaymoreDirectionalMine_Remote_Ammo;
class ACE_ClaymoreDirectionalMine_Remote_Ammo: ClaymoreDirectionalMine_Remote_Ammo { // Wrapper class to avoid unintentional changes to third-party mods. Ref #10105
class ACE_ClaymoreDirectionalMine_Remote_Ammo: ClaymoreDirectionalMine_Remote_Ammo { // Wrapper class to avoid unintentional changes to third-party mods. Ref #10105
GVAR(magazine) = "ClaymoreDirectionalMine_Remote_Mag";
GVAR(size) = 0;
GVAR(defuseObjectPosition)[] = {0, 0, 0.038};
Expand Down Expand Up @@ -52,6 +52,10 @@ class CfgAmmo {
distance = 0;
};
};
class ACE_FlareTripMineAir_Wire_Ammo: ACE_FlareTripMine_Wire_Ammo {
defaultMagazine = "ACE_FlareTripMineAir_Mag";
explosionEffects = "ACE_TripflareAirEffect";
};

class F_20mm_Red;
class ACE_TripFlare_FlareEffect: F_20mm_Red {
Expand Down
10 changes: 10 additions & 0 deletions addons/explosives/CfgCloudlets.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ class CfgCloudlets {
lifeTime = 0;
beforeDestroyScript = "\z\ace\addons\explosives\scripts\TripflareEffect.sqf";
};
class ACE_TripFlareAir: ACE_TripFlare {
beforeDestroyScript = "\z\ace\addons\explosives\scripts\TripflareAirEffect.sqf";
};
};

class ACE_TripflareEffect {
Expand All @@ -13,3 +16,10 @@ class ACE_TripflareEffect {
position = "explosionPos";
};
};
class ACE_TripflareAirEffect {
class SpawnFlare {
simulation = "particles";
type = "ACE_TripFlareAir";
position = "explosionPos";
};
};
4 changes: 4 additions & 0 deletions addons/explosives/CfgMagazines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ class CfgMagazines {
descriptionShort = CSTRING(TripFlare_Description);
class Library {libTextDesc = CSTRING(TripFlare_Description);};
};
class ACE_FlareTripMineAir_Mag: ACE_FlareTripMine_Mag {
ammo = "ACE_FlareTripMineAir_Wire_Ammo";
displayName = CSTRING(TripFlareAir_Name);
};

class ClaymoreDirectionalMine_Remote_Mag: CA_Magazine {
useAction = 0;
Expand Down
4 changes: 4 additions & 0 deletions addons/explosives/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ 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 Claymore_F: MineBase {
ammo = "ACE_ClaymoreDirectionalMine_Remote_Ammo";
Expand Down
10 changes: 5 additions & 5 deletions addons/explosives/functions/fnc_spawnFlare.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "..\script_component.hpp"
/*
* Author: VKing
* Spawns a flare on the ground for tripflare trigger
* Author: VKing, MikeMF
* Spawns a flare for tripflare trigger
*
* Arguments:
* 0: Position <ARRAY>
Expand All @@ -18,10 +18,10 @@
params ["_posX","_posY","_posZ"];
TRACE_3("Params",_posX,_posY,_posZ);

private _flare = "ACE_TripFlare_FlareEffect" createVehicle [_posX,_posY,_posZ];
private _flareClass = ["F_40mm_White", "F_40mm_Red", "F_40mm_Green"] select GVAR(tripflareColour);
private _flare = createVehicle [_flareClass, [_posX, _posY, _posZ], [], 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, [_posX,_posY,_posZ]]] call CBA_fnc_globalEvent;

nil
10 changes: 10 additions & 0 deletions addons/explosives/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,13 @@ 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: 22 additions & 0 deletions addons/explosives/scripts/TripflareAirEffect.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Author: VKing, MikeMF
* Spawns a flare in the air for tripflare trigger
*
* Arguments:
* 0: Position <ARRAY>
*
* Return Value:
* None
*
* Example:
* beforeDestroyScript = "\z\ace\addons\explosives\scripts\TripflareAirEffect.sqf;
Mike-MF marked this conversation as resolved.
Show resolved Hide resolved
*
* Public: no
*/

// This is called from a CfgCloudlet's beforeDestroyScript config.
// It will be re-compiled each use, so avoid complex preProcessor includes and just call the prepared function.

_this set [2, ((_this select 2) + 200)];

[ace_explosives_fnc_spawnFlare, _this] call CBA_fnc_directCall;
12 changes: 12 additions & 0 deletions addons/explosives/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,9 @@
<Czech>Světlice na nástražném drátu</Czech>
<Spanish>Bengala con cable trampa</Spanish>
</Key>
<Key ID="STR_ACE_Explosives_TripFlareAir_Name">
<English>Tripwire Flare (Air)</English>
</Key>
<Key ID="STR_ACE_Explosives_TripFlare_Description">
<English>Type: Tripwire flare - Ignites a non-lethal flare when triggered.&lt;br /&gt;Rounds: 1&lt;br /&gt;Used on: Ground</English>
<Russian>Тип: Сигнальная растяжка - При срабатывании выпускает несмертельную сигнальную вспышку.&lt;br /&gt;Зарядов: 1&lt;br /&gt;Используется на: Земле</Russian>
Expand Down Expand Up @@ -1209,5 +1212,14 @@
<Korean>초 단위로, 기본 폭발 타이머 시간을 정합니다</Korean>
<Portuguese>Tempo padrão (em segundos) para o temporizador do explosivo.</Portuguese>
</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>
</Package>
</Project>