Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
Stage work
Browse files Browse the repository at this point in the history
  • Loading branch information
thojkooi committed Oct 3, 2016
1 parent 517b108 commit b3b0ba2
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 24 deletions.
63 changes: 45 additions & 18 deletions addons/ieds/CfgVehicles.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CfgVehicles {
class ACE_Module;
class GVAR(createIed): ACE_Module {
author = "STR_ACE_common_ACETeam";
author = ACECSTRING(common,ACETeam);
category = "ACE_missionModules";
displayName = CSTRING(Module);
function = QFUNC(moduleInit);
Expand All @@ -10,37 +10,64 @@ class CfgVehicles {
isTriggerActivated = 0;
isDisposable = 0;
// icon = ""; // TODO add module icon
class Arguments {
class Arguments {
class typeOfIED {
displayName = "Type";
description = "The Type of the IED";
displayName = CSTRING(Type);
description = CSTRING(Type_Description);
typeName = "NUMBER";
class values {
class land {name="Normal"; value=0; default=1; };
class urban {name="Urban"; value=1; };
class land {
name = CSTRING(Type_Normal);
value = 0; default = 1;
};
class urban {
name = CSTRING(Type_Urban);
value = 1;
};
};
};

class sizeOfIED {
displayName = "Size";
description = "The size of the IED";
displayName = CSTRING(Size);
description = CSTRING(Size_Description);
typeName = "NUMBER";
class values {
class small {name="Small"; value=1; default=1; };
class large {name="Large"; value=0; };
class small {
name = CSTRING(Size_Normal);
value = 0; default = 1;
};
class large {
name = CSTRING(Size_Urban);
value = 1;
};
};
};

class heightOfIED {
displayName = "Height";
description = "The height that the IED is burried";
displayName = CSTRING(Height);
description = CSTRING(Height_Description);
typeName = "NUMBER";
class values {
class Above {name="Above Ground"; value=0; default=1; };
class slightly {name="Slightly burried"; value=1; };
class medium {name="Medium burried"; value=2; };
class almost {name="Almost burried"; value=3; };
class fully {name="Fully burried"; value=4; };
class Above {
name = CSTRING(Height_AboveGround);
value = 0;
default = 1;
};
class slightly {
name = CSTRING(Height_SlightlyBurried);
value = 1;
};
class medium {
name = CSTRING(Height_MediumBurried);
value = 2;
};
class almost {
name = CSTRING(Height_AlmostBurried);
value = 3;
};
class fully {
name = CSTRING(Height_FullyBurried);
value = 4;
};
};
};

Expand Down
4 changes: 3 additions & 1 deletion addons/ieds/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"acex_main", "ace_explosives"};
author[]= {"Glowbal"};
author = ACECSTRING(common,ACETeam);
authors[]= {"Glowbal"};
authorUrl = "https://github.com/glowbal";
VERSION_CONFIG;
};
Expand Down
10 changes: 5 additions & 5 deletions addons/ieds/functions/fnc_createIEDObject.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

params ["_logic"];

private ["_logic","_typeOfIED", "_sizeOfIED", "_heightOfIED", "_iedClass", "_iedCreated"];

if (isNull _logic) exitwith {};

private _typeOfIED = _logic getvariable ["typeOfIED", 0];
Expand All @@ -27,13 +25,13 @@ private _iedClass = switch (_typeOfIED) do {
case 1: { URBAN_IEDS select _sizeOfIED };
};

private _iedCreated = _iedClass createVehicle (getPos _logic);

private _iedCreated = _iedClass createVehicle [0,0,0];
_iedCreated setPos [getPos _Logic select 0, getPos _Logic select 1, (getPos _Logic select 2) + _heightOfIED];

if (_logic getvariable ["iedActivationType", 0] == 0) then {
private _mine = createMine [_iedClass, getPos _iedCreated, [], 0];
_mine setDir ((getDir _iedCreated)+90);
_mine setDir ((getDir _iedCreated) + 90);
_mine setPos _iedCreated;
_iedCreated setvariable [QGVAR(pressurePlate), _mine];
hideObjectGlobal _mine;
};
Expand Down Expand Up @@ -68,4 +66,6 @@ _iedCreated addEventHandler ["Killed", {
deleteVehicle _ied;
}];

["acex_iedCreated", [_iedCreated, _typeOfIED, _sizeOfIED, _heightOfIED]] call CBA_fnc_localEvent;

_iedCreated;
2 changes: 2 additions & 0 deletions addons/ieds/functions/fnc_onIEDActivated.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ private _chain = _logic getvariable [QGVAR(collection), []];

private _trigger = _iedLogic getvariable [QGVAR(linkedIED), objNull];
if (!(isNull _trigger)) then {
["acex_iedActivated", [_trigger]] call CBA_fnc_localEvent;

[_iedLogic, _trigger, _logic] spawn { // using a spawn because it doesn't matter to much if an ied isn't detonated at a reliable time
params ["_iedLogic", "_trigger", "_master"];
if (!isNull _trigger) then {
Expand Down
6 changes: 6 additions & 0 deletions addons/ieds/script_component.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#define COMPONENT ieds
#define COMPONENT_BEAUTIFIED IEDs
#include "\z\acex\addons\main\script_mod.hpp"

// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS

#ifdef DEBUG_ENABLED_IEDS
#define DEBUG_MODE_FULL
#endif
Expand Down
45 changes: 45 additions & 0 deletions addons/ieds/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,50 @@
<Key ID="STR_ACEX_ieds_Module">
<English>Create IED</English>
</Key>
<Key ID="STR_ACEX_ieds_Type">
<English>Type</English>
</Key>
<Key ID="STR_ACEX_ieds_Type_Description">
<English>The Type of the IED</English>
</Key>
<Key ID="STR_ACEX_ieds_Type_Urban">
<English>Urban</English>
</Key>
<Key ID="STR_ACEX_ieds_Type_Normal">
<English>Normal</English>
</Key>
<Key ID="STR_ACEX_ieds_Size">
<English>Size</English>
</Key>
<Key ID="STR_ACEX_ieds_Size_Description">
<English>The Size of the IED</English>
</Key>
<Key ID="STR_ACEX_ieds_Size_Small">
<English>Small</English>
</Key>
<Key ID="STR_ACEX_ieds_Size_Large">
<English>Large</English>
</Key>
<Key ID="STR_ACEX_ieds_Height">
<English>Height</English>
</Key>
<Key ID="STR_ACEX_ieds_Height_Description">
<English>The height that the IED is burried</English>
</Key>
<Key ID="STR_ACEX_ieds_Height_AboveGround">
<English>Above Ground</English>
</Key>
<Key ID="STR_ACEX_ieds_Height_SlightlyBurried">
<English>Slightly burried</English>
</Key>
<Key ID="STR_ACEX_ieds_Height_MediumBurried">
<English>Medium burried</English>
</Key>
<Key ID="STR_ACEX_ieds_Height_AlmostBurried">
<English>Almost burried</English>
</Key>
<Key ID="STR_ACEX_ieds_Height_FullyBurried">
<English>Fully burried</English>
</Key>
</Package>
</Project>

0 comments on commit b3b0ba2

Please sign in to comment.