diff --git a/core/common/modules.sqf b/core/common/modules.sqf
index 4af2e7fd..982df27d 100644
--- a/core/common/modules.sqf
+++ b/core/common/modules.sqf
@@ -35,6 +35,7 @@ GVAR(modules) = [
"drag",
"event",
["event_checkpoint", "event\types\checkpoint"],
+ ["event_tower", "event\types\tower"],
"gear",
"gesture",
"halo",
diff --git a/diary/handle.sqf b/diary/handle.sqf
index fbac300c..c3db0c3d 100644
--- a/diary/handle.sqf
+++ b/diary/handle.sqf
@@ -61,6 +61,10 @@ if (hasInterface) then {
if !(isNil QMODULE(mission_main)) then {"
The flag generated from completion of main targets cannot be used to HALO jump - this is a base facility."} else {""}
]] call FUNC(THIS_MODULE,create);
+ if (!isNil QMODULE(event)) then {
+ __submodulePP(event);
+ };
+
if (!isNil QMODULE(construction)) then {
__submodulePP(construction);
};
diff --git a/event/functions/fn_create.sqf b/event/functions/fn_create.sqf
index c3482224..f3ed1859 100644
--- a/event/functions/fn_create.sqf
+++ b/event/functions/fn_create.sqf
@@ -58,7 +58,11 @@ _location setVariable [QGVAR(units), _target select 2];
[_position, (_objects + _units)] spawn FUNC(THIS_MODULE,cleanup);
- [_type, true] spawn FUNC(THIS_MODULE,create);
+ _type spawn {
+ sleep GVAR(event_time_delay);
+
+ [_this, true] spawn FUNC(THIS_MODULE,create);
+ };
}];
} forEach (_target select 2);
diff --git a/event/handle.sqf b/event/handle.sqf
index 580568d7..5243d469 100644
--- a/event/handle.sqf
+++ b/event/handle.sqf
@@ -10,7 +10,7 @@ if (isServer) then {
_capacity = call compile format ["d_%1_%2_positions", QUOTE(THIS_MODULE), _x];
for "_i" from 1 to (_amount min (count _capacity)) do {
- sleep 10;
+ sleep 3;
[_x] call FUNC(THIS_MODULE,create);
};
diff --git a/event/init.sqf b/event/init.sqf
index 956bbaee..799ce21c 100644
--- a/event/init.sqf
+++ b/event/init.sqf
@@ -12,14 +12,17 @@
GVAR(event_types) = [];
// Minimum distance all players must be before cleaning a cleared event
-GVAR(event_distance_cleanup) = 1000;
+GVAR(event_distance_cleanup) = 500;
// Minimum distance from any other player before creating event
-GVAR(event_distance_create) = 2000;
+GVAR(event_distance_create) = 1500;
-// Time of delay following an event clearing to process cleanup
+// Time following completion before removing the existing creation and any orphans
GVAR(event_time_cleanup) = 600;
+// Time following completion to delay next event generation
+GVAR(event_time_delay) = 1800;
+
__cppfln(FUNC(THIS_MODULE,create),THIS_MODULE\functions\fn_create.sqf);
__cppfln(FUNC(THIS_MODULE,cleanup),THIS_MODULE\functions\fn_cleanup.sqf);
diff --git a/event/modules/diary.sqf b/event/modules/diary.sqf
new file mode 100644
index 00000000..d5941d4f
--- /dev/null
+++ b/event/modules/diary.sqf
@@ -0,0 +1,13 @@
+/**
+ * Vote Module - Diary Submodule
+ */
+
+#include "x_macros.sqf"
+
+["Events", [
+ "",
+ "
The resistance you come across during the mission won't be isolated to towns, but across the entire map.",
+ "
A small number of events can be discovered, these areas are randomly generated and will be occupied.",
+ "
Simply clearing this resistance will complete the event and schedule a new one for creation.",
+ if !(isNil QMODULE(item)) then {"
Additionally, these areas can also provide an opportunity to discover items."} else {""}
+]] call FUNC(diary,create);
\ No newline at end of file
diff --git a/event/types/tower/functions/fn_create.sqf b/event/types/tower/functions/fn_create.sqf
new file mode 100644
index 00000000..8fcccb9e
--- /dev/null
+++ b/event/types/tower/functions/fn_create.sqf
@@ -0,0 +1,38 @@
+#include "x_macros.sqf"
+private ["_placement", "_position", "_direction", "_objects", "_group"];
+
+PARAMS_1(_placement);
+
+_position = _placement select 0;
+_direction = _placement select 1;
+
+if !([count (nearestObjects [_position, ["Land_tent_east", "Land_Com_tower_ep1"], 2000]), 0] call BIS_fnc_areEqual) exitWith {false};
+
+_objects = [
+ _position,
+ _direction,
+ GVAR(event_tower_composition),
+ [
+ ["KORD_TK_EP1", "Fort_Crate_wood"],
+ ["SearchLight_TK_EP1", "KORD_high_TK_EP1"],
+ ["TKBasicAmmunitionBox_EP1"],
+ ["TKLaunchers_EP1"],
+ ["ZSU_TK_EP1", "Land_Com_tower_ep1"]
+ ]
+] call FUNC(server,objectMapper);
+
+_group = [
+ _position,
+ east,
+ (configFile >> "CfgGroups" >> "East" >> "BIS_TK" >> "Infantry" >> "TK_InfantrySectionAA")
+] call FUNC(server,spawnGroup);
+
+if !(isNil QMODULE(unit)) then {
+ [_group, _position] call FUNC(unit,defend);
+};
+
+[
+ _position,
+ _objects,
+ units _group
+]
\ No newline at end of file
diff --git a/event/types/tower/init.sqf b/event/types/tower/init.sqf
new file mode 100644
index 00000000..b556934a
--- /dev/null
+++ b/event/types/tower/init.sqf
@@ -0,0 +1,46 @@
+/**
+ * Event - Tower Module
+ *
+ * Description: This module is responsible for handling the event
+ * to create TK occupied communication towers with AA.
+ */
+
+#define THIS_MODULE event_tower
+#include "x_macros.sqf"
+
+// Add to the list of possible types of events
+[GVAR(event_types), "Tower"] call BIS_fnc_arrayPush;
+
+// Set minimum number of events of this type to exist
+GVAR(event_tower_amount) = 2;
+
+// Set composition of the event
+GVAR(event_tower_composition) = "AntiAir1_TK_EP1";
+
+// Set possible positions to generate the event at
+GVAR(event_tower_positions) = [
+ [[-112.213,9524.68,0], random 360],
+ [[1029.54,4594.24,0], random 360],
+ [[2268.7,8594.85,0], random 360],
+ [[2634.34,4084.24,0], random 360],
+ [[2657.21,3852.52,0], random 360],
+ [[3129.69,11815,0], random 360],
+ [[3251.33,1356.75,0], random 360],
+ [[3609.56,1905.61,0], random 360],
+ [[3905.07,6887.76,0], random 360],
+ [[5088.56,2666.48,0], random 360],
+ [[5728.15,4094.09,0], random 360],
+ [[5934.88,5056.68,0], random 360],
+ [[6172.33,3699.6,0], random 360],
+ [[6578.21,6793.1,0], random 360],
+ [[6935.34,5360.3,0], random 360],
+ [[7775.62,5299.46,0], random 360],
+ [[9439.07,5694.56,0], random 360],
+ [[11056.2,7070.5,0], random 360],
+ [[11508.5,4465.03,0], random 360],
+ [[12503.6,8062.73,0], random 360]
+];
+
+__cppfln(FUNC(THIS_MODULE,create),event\types\tower\functions\fn_create.sqf);
+
+MODULE(THIS_MODULE) = true;
\ No newline at end of file