From 75b81517f5b1015f9fcf975a37161a77e2d150c6 Mon Sep 17 00:00:00 2001 From: Zepheris Date: Wed, 19 Feb 2020 01:46:02 -0700 Subject: [PATCH 1/8] Disabled corpseManager and wrechManager --- .../mpmissions/epoch.Bornholm/epoch_config/sandbox_config.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Server/mpmissions/epoch.Bornholm/epoch_config/sandbox_config.hpp b/Server/mpmissions/epoch.Bornholm/epoch_config/sandbox_config.hpp index b5d44af..d0c02e0 100644 --- a/Server/mpmissions/epoch.Bornholm/epoch_config/sandbox_config.hpp +++ b/Server/mpmissions/epoch.Bornholm/epoch_config/sandbox_config.hpp @@ -39,12 +39,12 @@ joinUnassigned = 0; forceRotorLibSimulation = 1; saving = 0; -corpseManagerMode = 1; +corpseManagerMode = 0; corpseLimit = 10; corpseRemovalMinTime = 1200; corpseRemovalMaxTime = 3600; -wreckManagerMode = 1; +wreckManagerMode = 0; wreckLimit = 2; wreckRemovalMinTime = 60; wreckRemovalMaxTime = 360; From c150694e9c93e3a8973317c5e6584267ceed114c Mon Sep 17 00:00:00 2001 From: Zepheris Date: Wed, 19 Feb 2020 16:41:02 -0700 Subject: [PATCH 2/8] Added Spawn Mozzie for free --- .../Configs/CfgActionMenu/CfgActionMenu_self.hpp | 5 ++--- Server/mpmissions/epoch.Bornholm/scripts/ud/spawn_mozzie.sqf | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Server/mpmissions/epoch.Bornholm/epoch_config/Configs/CfgActionMenu/CfgActionMenu_self.hpp b/Server/mpmissions/epoch.Bornholm/epoch_config/Configs/CfgActionMenu/CfgActionMenu_self.hpp index 5f32d28..83af501 100644 --- a/Server/mpmissions/epoch.Bornholm/epoch_config/Configs/CfgActionMenu/CfgActionMenu_self.hpp +++ b/Server/mpmissions/epoch.Bornholm/epoch_config/Configs/CfgActionMenu/CfgActionMenu_self.hpp @@ -29,15 +29,14 @@ class spawn_Stuff tooltip = "Spawn Bike"; }; -/* class spawn_mozzie { - condition = "EPOCH_playerCrypto > 199"; + condition = "true"; action = "execVM 'scripts\ud\spawn_mozzie.sqf';"; icon = "x\addons\a3_epoch_code\Data\UI\buttons\epoch_coralkey.paa"; tooltip = "Spawn Mozzie"; }; - +/* class spawn_bicycle { condition = "true"; diff --git a/Server/mpmissions/epoch.Bornholm/scripts/ud/spawn_mozzie.sqf b/Server/mpmissions/epoch.Bornholm/scripts/ud/spawn_mozzie.sqf index d0abf49..4770b85 100644 --- a/Server/mpmissions/epoch.Bornholm/scripts/ud/spawn_mozzie.sqf +++ b/Server/mpmissions/epoch.Bornholm/scripts/ud/spawn_mozzie.sqf @@ -3,8 +3,8 @@ player playActionNow "Medic"; _spawnPos = player modelToWorld [0,2,0]; _spawnDir = (getDir player) -90; UDMOZZIE = [player, _spawnPos, _spawnDir]; -EPOCH_playerCrypto = EPOCH_playerCrypto - 200 ; +//EPOCH_playerCrypto = EPOCH_playerCrypto - 200 ; sleep 3; publicVariableServer "UDMOZZIE"; sleep 1; -['You bought a Mozzie for 200 crypto. Gone at restart!',0,0.7,2,0] spawn bis_fnc_dynamictext; \ No newline at end of file +['You spawned a Mozzie. Gone at restart!',0,0.7,2,0] spawn bis_fnc_dynamictext; From 3fe39a1d2564cbeb70d976545a0b3acf36961904 Mon Sep 17 00:00:00 2001 From: Zepheris Date: Wed, 19 Feb 2020 16:41:26 -0700 Subject: [PATCH 3/8] Added TCL AI mod --- .../epoch.Bornholm/TCL_System/$MIKERO$ | 1 + .../epoch.Bornholm/TCL_System/$PREFIX$ | 1 + .../epoch.Bornholm/TCL_System/$VERSION$ | 1 + .../epoch.Bornholm/TCL_System/Config.cpp | 113 +++ .../TCL/TCL_AddOns/TCL_Ambient/TCL_Church.sqf | 60 ++ .../TCL_AddOns/TCL_Ambient/TCL_Lighthouse.sqf | 35 + .../TCL_AddOns/TCL_Chatter/TCL_Chatter.sqf | 101 ++ .../TCL_AddOns/TCL_Chatter/TCL_Chatter_F.sqf | 198 ++++ .../TCL_AddOns/TCL_Chatter/TCL_Resource.hpp | 46 + .../TCL/TCL_AddOns/TCL_Crew_FX_F.sqf | 137 +++ .../TCL_Explosion_FX/TCL_Dirt_FX_F.sqf | 49 + .../TCL_Explosion_FX/TCL_Dust_FX_F.sqf | 84 ++ .../TCL_Explosion_FX/TCL_Flash_FX_F.sqf | 77 ++ .../TCL_Explosion_FX/TCL_Mud_FX_F.sqf | 44 + .../TCL_Explosion_FX/TCL_Shard_FX_F.sqf | 59 ++ .../TCL_Explosion_FX/TCL_Smoke_FX_F.sqf | 71 ++ .../TCL_Explosion_FX/TCL_Stone_FX_F.sqf | 56 ++ .../TCL/TCL_AddOns/TCL_Explosion_FX_F.sqf | 57 ++ .../TCL/TCL_AddOns/TCL_FX_F/TCL_Dirt_FX.sqf | 11 + .../TCL/TCL_AddOns/TCL_Fire_FX_F.sqf | 72 ++ .../TCL/TCL_AddOns/TCL_Impact_FX_F.sqf | 125 +++ .../TCL/TCL_AddOns/TCL_Whiz_FX_F.sqf | 92 ++ .../TCL_System/TCL/TCL_Database/TCL_AI.sqf | 48 + .../TCL_System/TCL/TCL_Database/TCL_Debug.sqf | 41 + .../TCL_System/TCL/TCL_Database/TCL_FX.sqf | 49 + .../TCL/TCL_Database/TCL_Feature.sqf | 88 ++ .../TCL_System/TCL/TCL_Database/TCL_IQ.sqf | 33 + .../TCL_System/TCL/TCL_Database/TCL_Radio.sqf | 29 + .../TCL/TCL_Database/TCL_Resource.sqf | 42 + .../TCL/TCL_Database/TCL_System.sqf | 62 ++ .../TCL_System/TCL/TCL_Database/TCL_Tweak.sqf | 36 + .../TCL/TCL_EH_F/TCL_EH_Fired_F.sqf | 172 ++++ .../TCL/TCL_EH_F/TCL_EH_Killed_F.sqf | 61 ++ .../TCL/TCL_EH_F/TCL_EH_Respawn_F.sqf | 116 +++ .../TCL_System/TCL/TCL_EH_F/TCL_EH_Zeus_F.sqf | 158 ++++ .../TCL_System/TCL/TCL_EH_F/TCL_Macros.hpp | 9 + .../TCL/TCL_ExecVM/TCL_EH_Fired.sqf | 31 + .../TCL/TCL_ExecVM/TCL_KnowsAbout.sqf | 76 ++ .../TCL_System/TCL/TCL_ExecVM/TCL_Macros.hpp | 9 + .../TCL_System/TCL/TCL_ExecVM/TCL_Monitor.sqf | 84 ++ .../TCL_System/TCL/TCL_ExecVM/TCL_Spawn.sqf | 103 +++ .../TCL_System/TCL/TCL_ExecVM/TCL_Zeus.sqf | 55 ++ .../TCL_System/TCL/TCL_Extension_F.sqf | 712 +++++++++++++++ .../TCL/TCL_Feature_F/TCL_Advancing_F.sqf | 276 ++++++ .../TCL/TCL_Feature_F/TCL_Artillery_F.sqf | 236 +++++ .../TCL/TCL_Feature_F/TCL_Feature_F.sqf | 138 +++ .../TCL/TCL_Feature_F/TCL_Flanking_F.sqf | 171 ++++ .../TCL/TCL_Feature_F/TCL_Flare_F.sqf | 106 +++ .../TCL/TCL_Feature_F/TCL_Follow_F.sqf | 22 + .../TCL/TCL_Feature_F/TCL_Garrison_F.sqf | 238 +++++ .../TCL/TCL_Feature_F/TCL_Heal_F.sqf | 256 ++++++ .../TCL/TCL_Feature_F/TCL_House_Search_F.sqf | 202 ++++ .../TCL/TCL_Feature_F/TCL_Macros.hpp | 10 + .../TCL/TCL_Feature_F/TCL_Mortar_F.sqf | 63 ++ .../TCL/TCL_Feature_F/TCL_Rearm_F.sqf | 437 +++++++++ .../TCL/TCL_Feature_F/TCL_Regroup_F.sqf | 92 ++ .../TCL/TCL_Feature_F/TCL_Simulate_F.sqf | 118 +++ .../TCL/TCL_Feature_F/TCL_Smoke_F.sqf | 130 +++ .../TCL/TCL_Feature_F/TCL_Static_Weapon_F.sqf | 266 ++++++ .../TCL/TCL_Feature_F/TCL_Suppressed_F.sqf | 69 ++ .../TCL/TCL_Feature_F/TCL_Surrender_F.sqf | 141 +++ .../TCL/TCL_Feature_F/TCL_Take_Cover_F.sqf | 475 ++++++++++ .../TCL/TCL_Feature_F/TCL_Tank_F.sqf | 117 +++ .../TCL/TCL_Feature_F/TCL_Watch_F.sqf | 82 ++ .../TCL_Feature_F/Temp/TCL_Artillery_F.sqf | 328 +++++++ .../TCL/TCL_Feature_F/Temp/TCL_Flanking_F.sqf | 139 +++ .../TCL/TCL_Feature_F/Temp/TCL_Mortar_F.sqf | 80 ++ .../TCL/TCL_Feature_F/Temp/TCL_Rearm_F.sqf | 523 +++++++++++ .../Temp/TCL_Static_Weapon_F.sqf | 210 +++++ .../TCL_Feature_F/Temp/TCL_Take_Cover_F.sqf | 521 +++++++++++ .../TCL_Feature_F/Temp/v1/TCL_Artillery_F.sqf | 227 +++++ .../TCL_Feature_F/Temp/v1/TCL_Flanking_F.sqf | 180 ++++ .../TCL/TCL_Feature_F/Temp/v1/TCL_Rearm_F.sqf | 521 +++++++++++ .../TCL_Feature_F/Temp/v1/TCL_Regroup_F.sqf | 82 ++ .../Temp/v1/TCL_Static_Weapon_F.sqf | 262 ++++++ .../TCL_Feature_F/Temp/v2/TCL_Artillery_F.sqf | 231 +++++ .../TCL/TCL_Initialize_F/TCL_Groups_F.sqf | 435 +++++++++ .../TCL/TCL_Initialize_F/TCL_Macros.hpp | 9 + .../TCL/TCL_Initialize_F/TCL_Players_F.sqf | 49 + .../TCL/TCL_Initialize_F/TCL_Units_F.sqf | 50 + .../TCL/TCL_Initialize_F/TCL_Vehicles_F.sqf | 33 + .../TCL_System/TCL/TCL_Macros.hpp | 9 + .../TCL/TCL_Reinforcement_F/TCL_Assign_F.sqf | 154 ++++ .../TCL_Reinforcement_F/TCL_Behaviour_F.sqf | 212 +++++ .../TCL/TCL_Reinforcement_F/TCL_Enemy_F.sqf | 136 +++ .../TCL_Reinforcement_F/TCL_Helicopter_F.sqf | 210 +++++ .../TCL/TCL_Reinforcement_F/TCL_Join_F.sqf | 87 ++ .../TCL_Reinforcement_F/TCL_KnowsAbout_F.sqf | 205 +++++ .../TCL/TCL_Reinforcement_F/TCL_Logic_F.sqf | 67 ++ .../TCL/TCL_Reinforcement_F/TCL_Macros.hpp | 9 + .../TCL/TCL_Reinforcement_F/TCL_Move_F.sqf | 244 +++++ .../TCL/TCL_Reinforcement_F/TCL_Radio_F.sqf | 108 +++ .../TCL/TCL_Reinforcement_F/TCL_Rating_F.sqf | 125 +++ .../TCL_Reinforcement_F.sqf | 285 ++++++ .../TCL/TCL_Reinforcement_F/TCL_Remount_F.sqf | 281 ++++++ .../TCL/TCL_Reinforcement_F/TCL_Reveal_F.sqf | 162 ++++ .../TCL/TCL_Reinforcement_F/TCL_Ship_F.sqf | 22 + .../TCL_Reinforcement_F/TCL_Sneaking_F.sqf | 58 ++ .../TCL/TCL_Reinforcement_F/TCL_Stuck_F.sqf | 89 ++ .../TCL/TCL_Reinforcement_F/TCL_System.fsm | 488 ++++++++++ .../TCL_Reinforcement_F/TCL_Unassign_F.sqf | 307 +++++++ .../TCL/TCL_Reinforcement_F/TCL_Vehicle_F.sqf | 187 ++++ .../TCL/TCL_Reinforcement_F/TCL_Waiting_F.sqf | 58 ++ .../TCL_Reinforcement_F/Temp/TCL_Move_F.sqf | 417 +++++++++ .../TCL/TCL_System_F/TCL_Debug_F.sqf | 222 +++++ .../TCL/TCL_System_F/TCL_Get_In_F.sqf | 194 ++++ .../TCL/TCL_System_F/TCL_Header_F.sqf | 68 ++ .../TCL/TCL_System_F/TCL_Marker_F.sqf | 861 ++++++++++++++++++ .../TCL/TCL_System_F/TCL_Public_F.sqf | 55 ++ .../TCL/TCL_System_F/TCL_Skill_F.sqf | 90 ++ .../TCL_System/TCL_Initialize.fsm | 646 +++++++++++++ .../TCL_System/TCL_Preprocess.sqf | 64 ++ Server/mpmissions/epoch.Bornholm/init.sqf | 4 + 113 files changed, 17153 insertions(+) create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/$MIKERO$ create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/$PREFIX$ create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/$VERSION$ create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/Config.cpp create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Ambient/TCL_Church.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Ambient/TCL_Lighthouse.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Chatter/TCL_Chatter.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Chatter/TCL_Chatter_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Chatter/TCL_Resource.hpp create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Crew_FX_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Dirt_FX_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Dust_FX_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Flash_FX_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Mud_FX_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Shard_FX_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Smoke_FX_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Stone_FX_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_FX_F/TCL_Dirt_FX.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Fire_FX_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Impact_FX_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Whiz_FX_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_AI.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Debug.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_FX.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Feature.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_IQ.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Radio.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Resource.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_System.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Tweak.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Fired_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Killed_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Respawn_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Zeus_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_Macros.hpp create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_EH_Fired.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_KnowsAbout.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Macros.hpp create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Monitor.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Spawn.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Zeus.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Extension_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Advancing_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Artillery_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Feature_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Flanking_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Flare_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Follow_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Garrison_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Heal_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_House_Search_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Macros.hpp create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Mortar_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Rearm_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Regroup_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Simulate_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Smoke_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Static_Weapon_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Suppressed_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Surrender_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Take_Cover_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Tank_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Watch_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Artillery_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Flanking_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Mortar_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Rearm_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Static_Weapon_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Take_Cover_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Artillery_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Flanking_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Rearm_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Regroup_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Static_Weapon_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v2/TCL_Artillery_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Groups_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Macros.hpp create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Players_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Units_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Vehicles_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Macros.hpp create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Assign_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Behaviour_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Enemy_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Helicopter_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Join_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_KnowsAbout_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Logic_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Macros.hpp create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Move_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Radio_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Rating_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Reinforcement_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Remount_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Reveal_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Ship_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Sneaking_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Stuck_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_System.fsm create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Unassign_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Vehicle_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Waiting_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/Temp/TCL_Move_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Debug_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Get_In_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Header_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Marker_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Public_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Skill_F.sqf create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL_Initialize.fsm create mode 100644 Server/mpmissions/epoch.Bornholm/TCL_System/TCL_Preprocess.sqf diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/$MIKERO$ b/Server/mpmissions/epoch.Bornholm/TCL_System/$MIKERO$ new file mode 100644 index 0000000..226a23b --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/$MIKERO$ @@ -0,0 +1 @@ +DePbo.dll.7.16 \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/$PREFIX$ b/Server/mpmissions/epoch.Bornholm/TCL_System/$PREFIX$ new file mode 100644 index 0000000..4e399e1 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/$PREFIX$ @@ -0,0 +1 @@ +TCL_System \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/$VERSION$ b/Server/mpmissions/epoch.Bornholm/TCL_System/$VERSION$ new file mode 100644 index 0000000..fb2bdac --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/$VERSION$ @@ -0,0 +1 @@ +Fri Jun 28 18:09:53 2019 \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/Config.cpp b/Server/mpmissions/epoch.Bornholm/TCL_System/Config.cpp new file mode 100644 index 0000000..145f61e --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/Config.cpp @@ -0,0 +1,113 @@ +// //////////////////////////////////////////////////////////////////////////// +// Tactical Combat Link - ( TypeX ) - System Config +// By =\SNKMAN/= +// //////////////////////////////////////////////////////////////////////////// + +#define _ARMA_ + +class CfgPatches +{ + class TCL_System + { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.82; + requiredAddons[] = {"A3_Data_F","A3_Characters_F"}; + versionDesc = "Tactical Combat Link - ( TypeX )"; + version = "1.0.31"; + }; +}; + +class CfgMods +{ + class TCL_Mods + { + dir = "@TCL"; + name = "Tactical Combat Link - ( TypeX )"; + author = "=\SNKMAN/="; + action = "https://forums.bohemia.net/forums/topic/221659-tactical-combat-link-typex/"; + picture = "A3\Ui_f\data\Logos\arma3_expansion_alpha_ca"; + tooltip = "Tactical Combat Link"; + overview = "Tactical Combat Link - ( TypeX ) is a highly dynamic A.I. and F.X. improvement and enhancement modification for ARMA 3."; + }; +}; + +class TCL_Path +{ + // ///////////// PBO //////////////// + TCL_Root = "\TCL_System\"; + // ///////////////////////////////////// + + // ///////////// Script //////////////// + // TCL_Root = "\@TCL\AddOns\TCL_System\"; + // /////////////////////////////////////// +}; + +#define TCL_EH_System "if (isNil 'TCL_Path') then {TCL_Path = getText (configFile >> 'TCL_Path' >> 'TCL_Root'); call compile preProcessFileLineNumbers (TCL_Path+'TCL_Preprocess.sqf') }"; + +class CfgVehicles +{ + class Man; + class Land; + + class CAManBase : Man + { + class EventHandlers + { + class TCL_EH_Init + { + init = TCL_EH_System + }; + }; + }; +}; + +class RscText; + +class RscStandardDisplay; + +class RscDisplayMain : RscStandardDisplay +{ + class controls + { + class TCL_System_RscDisplayMain : RscText + { + style = 0x01 + 0x100; + + sizeEx = 0.05; + + x = "(SafeZoneH + SafeZoneX) - (1 - 0.45)"; + y = "(SafeZoneH + SafeZoneY) - (1 - 0.83)"; + + w = 0.5; + h = 0.05; + + text = "Tactical Combat Link - TypeX"; + }; + + class TCL_Version_RscDisplayMain : TCL_System_RscDisplayMain + { + sizeEx = 0.03; + + colortext[] = {1.0, 0.0, 0.0, 1.0}; + + x = "(SafeZoneH + SafeZoneX) - (1 - 0.45)"; + y = "(SafeZoneH + SafeZoneY) - (1 - 0.88)"; + + text = "Version: 1.0.31"; + }; + }; +}; + +class CfgAddOns +{ + class PreloadBanks {}; + + class PreloadAddOns + { + class TCL_System + { + list[] = {"TCL_System"}; + }; + }; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Ambient/TCL_Church.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Ambient/TCL_Church.sqf new file mode 100644 index 0000000..7bc9170 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Ambient/TCL_Church.sqf @@ -0,0 +1,60 @@ +// //////////////////////////////////////////////////////////////////////////// +// Church Ambient Sound +// //////////////////////////////////////////////////////////////////////////// +// Idea and Sounds by Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project ) +// By =\SNKMAN/= +// //////////////////////////////////////////////////////////////////////////// +private ["_objects","_church","_index","_sound","_time"]; + +sleep 5 - (random 5); + +while { (True) } do +{ + if ( [dayTime] call TCL_Daytime_F ) then + { + sleep 10 + (random 30); + + if (alive player) then + { + if (floor (random 100) < 50) then + { + _objects = nearestObjects [player, ["Land_Church_01_F","Land_Church_02_F","Land_Church_03_F"], 500]; + + if (count _objects > 0) then + { + _church = (_objects select 0); + + _index = [8,9,10] call TCL_Random_F; + + _sound = (TCL_Resource select _index) call TCL_Random_F; + + _time = 50 + (random 100); + + if (True) then + { + if (_index == 8) exitWith + { + _time = 130 + (random 130); + }; + + if (_index == 9) exitWith + { + _time = 150 + (random 150); + }; + + if (_index == 10) exitWith + { + _time = 170 + (random 170); + }; + }; + + _church say3D [_sound, 500]; + + sleep _time; + }; + }; + }; + }; + + sleep 150 + (random 170); +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Ambient/TCL_Lighthouse.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Ambient/TCL_Lighthouse.sqf new file mode 100644 index 0000000..29322b5 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Ambient/TCL_Lighthouse.sqf @@ -0,0 +1,35 @@ +// //////////////////////////////////////////////////////////////////////////// +// Lighthouse Ambient Sound +// //////////////////////////////////////////////////////////////////////////// +// Idea and Sounds by Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project ) +// By =\SNKMAN/= +// //////////////////////////////////////////////////////////////////////////// +private ["_objects","_lighthouse","_sound"]; + +sleep 10 + (random 30); + +while { (True) } do +{ + if ( [dayTime] call TCL_Daytime_F ) then + { + sleep 150 + (random 170); + } + else + { + if (fog > 0) then + { + _objects = nearestObjects [player, ["Land_LightHouse_F","Land_LightHouse_smalle_F","Land_LightHouse_03_green_F","Land_LightHouse_03_red_F"], 500]; + + if (count _objects > 0) then + { + _lighthouse = (_objects select 0); + + _sound = (TCL_Resource select 11) call TCL_Random_F; + + _lighthouse say3D [_sound, 1000]; + }; + }; + + sleep 150 + (random 170); + }; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Chatter/TCL_Chatter.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Chatter/TCL_Chatter.sqf new file mode 100644 index 0000000..00f624e --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Chatter/TCL_Chatter.sqf @@ -0,0 +1,101 @@ +// //////////////////////////////////////////////////////////////////////////// +// TCL v.1.0 +// //////////////////////////////////////////////////////////////////////////// +// Radio Chatter +// Script by =\SNKMAN/= +// //////////////////////////////////////////////////////////////////////////// +private ["_index","_vehicle","_turrets","_side","_string","_delay"]; + +// call compile preprocessFileLineNumbers (TCL_Path+"TCL\TCL_Database\TCL_Radio.sqf"); + +#define _define1 30 - (random 30); while { ( (_delay > 0) && (_vehicle == vehicle player) ) } do {_delay = _delay - 1; sleep 1}; _vehicle = [_vehicle] call (TCL_Chatter_F select 3) + +#include "TCL_Resource.hpp" + +_isAir = +{ + ( (_vehicle isKindOf "Air") && (isEngineOn _vehicle) && (TCL_Chatter select 0) && (_side == 1) ) +}; + +_isLand = +{ + ( ( (_vehicle isKindOf "Car") || (_vehicle isKindOf "Tank") ) && { (count _turrets > 0) } && { (isEngineOn _vehicle) } && { (TCL_Chatter select 0) } ) +}; + +waitUntil { !(isNull (finddisplay 46) ) }; + +_index = (findDisplay 46) displayAddEventHandler ["KeyDown", "_this call (TCL_Chatter_F select 1)"]; + +while { (TCL_FX select 6) } do +{ + if (player != vehicle player) then + { + _vehicle = (vehicle player); + + _turrets = (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "turrets"); + + _side = getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "side"); + + switch (True) do + { + case (call _isAir) : + { + [_vehicle, (TCL_Chatter select 2), True] call (TCL_Chatter_F select 2); + + while { (call _isAir) } do + { + if (floor (random 100) < 75) then + { + 0 fadeMusic (TCL_Chatter select 1); + + _string = ( (TCL_Resource select 2) + (TCL_Resource select 5) ) call TCL_Random_F; + + playMusic _string; + } + else + { + [_vehicle] call (TCL_Chatter_F select 0); + }; + + _delay = _define1; + }; + }; + + case (call _isLand) : + { + [_vehicle, (TCL_Chatter select 2), True] call (TCL_Chatter_F select 2); + + while { (call _isLand) } do + { + 0 fadeMusic (TCL_Chatter select 1); + + switch (_side) do + { + case 0 : + { + _string = (TCL_Resource select 4) call TCL_Random_F; + }; + + case 1 : + { + _string = ( (TCL_Resource select 3) + (TCL_Resource select 5) ) call TCL_Random_F; + }; + + case 2 : + { + _string = (TCL_Resource select 4) call TCL_Random_F; + }; + }; + + playMusic _string; + + _delay = _define1; + }; + }; + }; + }; + + sleep 5; +}; + +(findDisplay 46) displayRemoveEventHandler ["KeyDown", _index]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Chatter/TCL_Chatter_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Chatter/TCL_Chatter_F.sqf new file mode 100644 index 0000000..d6a4a80 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Chatter/TCL_Chatter_F.sqf @@ -0,0 +1,198 @@ +#include "TCL_Resource.hpp" + +TCL_Chatter_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Chatter Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Chatter + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {private ["_vehicle","_sounds","_delays","_count","_sound","_delay"]; + + _vehicle = _this select 0; + + if _getRandom(50) then + { + _sounds = ["West_Air_v56a","West_Air_v57a","West_Air_v58a","West_Air_v59a","West_Air_v60a","West_Air_v61a","West_Air_v62a","West_Air_v63a","West_Air_v64a","West_Air_v65a","West_Air_v66a","West_Air_v67a","West_Air_v68a","West_Air_v69a","West_Air_v70a","West_Air_v71a","West_Air_v72a","West_Air_v73a","West_Air_v74a","West_Air_v75a","West_Air_v76a","West_Air_v77a","West_Air_v78a","West_Air_v79a","West_Air_v80a","West_Air_v81a","West_Air_v82a","West_Air_v83a"]; + + _delays = [4.76, 3.4, 2.12, 2.56, 4.76, 1.5, 4.84, 2.16, 2.48, 4.4, 5.56, 2.36, 1.92, 2.72, 3.48, 5.56, 2.72, 2.92, 1.92, 2.24, 5.36, 4.36, 5.32, 4.48, 4.32, 5.12, 3.76, 10.96]; + } + else + { + _sounds = ["West_Air_v84a","West_Air_v85a","West_Air_v86a","West_Air_v87a","West_Air_v88a","West_Air_v89a","West_Air_v90a","West_Air_v91a","West_Air_v92a","West_Air_v93a","West_Air_v94a","West_Air_v95a","West_Air_v96a"]; + + _delays = [2.24, 5.6, 11.3, 2.6, 2.12, 1.5, 2.84, 4.56, 3.72, 4.8, 3.84, 5.2, 3.2]; + }; + + _count = 0; + + while { ( (alive _vehicle) && { (_vehicle == vehicle player) } && { (isEngineOn _vehicle) } && { (_count < count _sounds) } && { (TCL_Chatter select 0) } ) } do + { + 0 fadeMusic (TCL_Chatter select 1); + + _sound = (_sounds select _count); + + playMusic _sound; + + _delay = (_delays select _count); + + sleep _delay; + + _count = _count + 1; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Chatter Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Chatter + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {private ["_key","_vehicle","_volume"]; + + _key = _this select 1; + + _vehicle = (vehicle player); + + if ( ( (_vehicle isKindOf "Car") || (_vehicle isKindOf "Tank") || (_vehicle isKindOf "Air") ) && { (isEngineOn _vehicle) } ) then + { + if ( (_key == (TCL_FX select 9) ) && ( (TCL_Chatter select 2) != 10) ) exitWith + { + _volume = (TCL_Chatter select 2); + + _volume = _volume + 1; + + if (_volume >= 10) then + { + _volume = 10; + }; + + [_vehicle, _volume, False] call (TCL_Chatter_F select 2); + }; + + if ( (_key == (TCL_FX select 10) ) && ( (TCL_Chatter select 2) != 0) ) exitWith + { + _volume = (TCL_Chatter select 2); + + _volume = _volume - 1; + + if (_volume <= 0) then + { + _volume = 0; + }; + + [_vehicle, _volume, False] call (TCL_Chatter_F select 2); + }; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Chatter Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Chatter + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {private ["_vehicle","_volume","_type","_displayName","_value","_count","_status","_string"]; + + _vehicle = _this select 0; + _volume = _this select 1; + _type = _this select 2; + + _displayName = getText (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName"); + + if (_volume > 0) then + { + _value = ""; + + _count = 0; + + for "_count" from _count to (_volume - 1) do + { + _value = _value + "|"; + }; + + TCL_Chatter set [0, True]; + + TCL_Chatter set [1, (_volume / 10) ]; + } + else + { + _value = "Disabled"; + + TCL_Chatter set [0, False]; + + TCL_Chatter set [1, _volume]; + }; + + TCL_Chatter set [2, _volume]; + + [_type, _displayName, _value] spawn + { + _text = + { + parseText format ["Radio Chatter
%1 %2", _this, _status]; + }; + + if (_this select 0) then + { + _status = "Enabled"; + + _string = (_this select 1) call _text; + + hint _string; + + sleep 3; + }; + + _status = (_this select 2); + + _string = (_this select 1) call _text; + + hint _string; + }; + + True; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Chatter Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Chatter + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {private ["_vehicle","_volume"]; + + _vehicle = _this select 0; + + if (_vehicle != vehicle player) then + { + _volume = (TCL_Chatter select 1); + + while { (_volume > 0) } do + { + _volume = _volume - 0.1; + + 0 fadeMusic _volume; + + sleep 0.1; + }; + + sleep 1; + + playMusic ""; + + hint ""; + + 0 fadeMusic 0.5; + }; + + _vehicle = (vehicle player); + + _vehicle + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Chatter/TCL_Resource.hpp b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Chatter/TCL_Resource.hpp new file mode 100644 index 0000000..4169f12 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Chatter/TCL_Resource.hpp @@ -0,0 +1,46 @@ +// Vehicle Macro +#define _getVehicle(type) (_vehicle isKindOf type) +#define _isMan(object) (object == vehicle object) + +// Side Macro +#define _getSide(object) (side object in _getArray(TCL_Core,1) ) + +// Array Macro +#define _getDebug(index) (TCL_Debug select index) +#define _getLocal(index) (TCL_Local select index) +#define _getGlobal(index) (TCL_Global select index) +#define _getArray(array,index) (array select index) +#define _spawn(array,index) spawn (array select index) +#define _call(array,index) call (array select index) +#define _setIn(array,index,value) [array,index,value] call TCL_Array_F +#define _isIn(group,array,index) (group in (array select index) ) +#define _setOut(array,index,value) array set [index, (array select index) - [value] ] + +// Unit Macro +#define _isLeader(object) (object == leader object) +#define _getUnit(index) units _group select (count units _group - index) +#define _getUnits(group) { (alive _x) } count (units group) + +// Number Macro +#define _getRandom(value) (floor (random 100) < value) +#define _getTime(value) (time + (value) ) + +// Enemy and Friend Macro +#define _getKnows(object) knowsAbout vehicle object +#define _isKnown(object) ( (alive object) && (_group _getKnows(object) > 0) ) + +#define _getEnemy(object) ( { ( (alive _x) && _isLeader(_x) && (side _x getFriend side object < 0.6) ) } count (units _group) > 0) +#define _getFriend(group) ( { ( (alive _x) && _isLeader(_x) && (side _x getFriend side leader group > 0.6) ) } count (units _group) > 0) + +#define _isEnemy(object) (_isKnown(object) && _getEnemy(object) ) +#define _isFriend(object) (_isKnown(object) && _getFriend(object) ) + +// Vehicle Macro +#define _unAssignVehicle(object) unAssignVehicle object; [object] orderGetIn False + +// Variable Macro +#define _getVariable(object,string) [object,string] call TCL_Get_Variable_F + +// uiNameSpace +#define _callUI(string,index) call (uiNameSpace getVariable string select index) +#define _spawnUI(string,index) spawn (uiNameSpace getVariable string select index) \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Crew_FX_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Crew_FX_F.sqf new file mode 100644 index 0000000..35e4891 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Crew_FX_F.sqf @@ -0,0 +1,137 @@ +TCL_Crew_FX_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Crew FX Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Crew FX + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_crew","_vehicle"]; + + private _driver = (driver _vehicle); + + private _side = (side _driver); + + private _group = createGroup _side; + + while { (getPos _vehicle select 2 > 3) } do + { + sleep 1; + }; + + private ["_unit","_type","_spawn"]; + + while { (count _crew > 0) } do + { + _unit = (_crew select 0); + + if (floor (random 100) < 35) then + { + _type = (typeOf _unit); + + _spawn = _group createUnit [_type, [ (getPos _unit select 0), (getPos _unit select 1), - 5], [], 0, "CAN_COLLIDE"]; + + _spawn setDammage (random 0.3); + + _spawn allowDamage False; + + [_spawn, _vehicle] spawn (TCL_Crew_FX_F select 1); + + // _type createUnit [ [ (getPos _unit select 0), (getPos _unit select 1), - 5], _group, "if (TCL_Multiplayer) then {if (isServer) then {this allowDamage False; [this, _vehicle] spawn (TCL_Crew_FX_F select 1) } else { [this] spawn (TCL_Fire_FX_F select 0) } } else {this allowDamage False; [this, _vehicle] spawn (TCL_Crew_FX_F select 1) }"]; + }; + + _crew deleteAt (_crew find _unit); + + deleteVehicle _unit; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Crew Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Crew FX + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_vehicle"]; + + [_unit] join grpNull; + + private _group = (group _unit); + + (TCL_Disabled select 0) pushBack _group; + + removeAllWeapons _unit; + + _unit allowFleeing 0; + + _unit setCaptive True; + + _unit setUnitPos "UP"; + + _unit setSpeedMode "FULL"; + + _unit setCombatMode "BLUE"; + + _unit disableAI "AUTOCOMBAT"; + + _unit setBehaviour "CARELESS"; + + sleep 10 + (random 30); + + if (TCL_Multiplayer) then + { + TCL_Public = [_unit]; + + publicVariable "TCL_Public"; + + if (TCL_Dedicated) exitWith {}; + + [_unit] spawn (TCL_Fire_FX_F select 0); + } + else + { + [_unit] spawn (TCL_Fire_FX_F select 0); + }; + + _unit setDir (random 360); + + _unit setPos (getPos _vehicle); + + _unit allowDamage True; + + private _array = ["AmovPpneMstpSnonWnonDnon_AmovPpneMevaSnonWnonDr","AmovPpneMstpSnonWnonDnon_AmovPpneMevaSnonWnonDl"]; + + while { (alive _unit) } do + { + _unit doMove [ ( (getPos _unit select 0) + (random 100 - random 100) ), ( (getPos _unit select 1) + (random 100 - random 100) ), 0]; + + if (floor (random 100) < 35) then + { + if (_unit distance _vehicle > 5) then + { + if (animationState _unit in _array) exitWith {}; + + if (floor (random 100) < 50) then + { + _unit playMove "AmovPpneMstpSnonWnonDnon_AmovPpneMevaSnonWnonDr"; + } + else + { + _unit playMove "AmovPpneMstpSnonWnonDnon_AmovPpneMevaSnonWnonDl"; + }; + }; + }; + + _unit setDamage (damage _unit + random 0.1); + + if (damage _unit > 0.5) then + { + _unit setDamage 1; + }; + + sleep 5; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Dirt_FX_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Dirt_FX_F.sqf new file mode 100644 index 0000000..fdc9c9c --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Dirt_FX_F.sqf @@ -0,0 +1,49 @@ +TCL_Dirt_FX_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Dirt FX Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Dirt FX + // Script by =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle","_size"]; + + if (isOnRoad _vehicle) exitWith {}; + + private "_random"; + + private _count = (_size + random _size); + + while { (_count > 0) } do + { + _random = [0.5 + (random 0.7), [ (random 10 - random 10), (random 10 - random 10), 5 + (random 7) ], [0.3 + random 0.7, 0.7 - random 0.3] ]; + + drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, 12, 9, 0], "", "Billboard", 0.05, (_random select 0), + + [0,0,-1], (_random select 1), 0, 1, 0, 0, + + (_random select 2), [ [0.1,0.1,0.1,1],[0.1,0.1,0.1,0.5],[0.1,0.1,0.1,0.3] ], [1], + + 1, 1, (TCL_Path+"TCL\TCL_AddOns\TCL_FX_F\TCL_Dirt_FX.sqf"), "", _vehicle, random 360]; + + _count = _count - 3; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Dirt FX Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Dirt FX + // Script by =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + { + + drop [ ["\A3\Data_f\ParticleEffects\Universal\Universal.p3d", 16, 12, 9, 0], "", "Billboard", 10, 1, + + _this, [0,0,0], 0, 1.5, 1, 0, + + [1 + random 1, 1 - random 1], [ [0.1,0.1,0.1,1],[0.1,0.1,0.1,0] ], [1000], 0, 0, "", "", ""]; + + } +]; diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Dust_FX_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Dust_FX_F.sqf new file mode 100644 index 0000000..cc4bbc9 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Dust_FX_F.sqf @@ -0,0 +1,84 @@ +TCL_Dust_FX_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Dust FX Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Dust FX + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle","_size"]; + + private "_random"; + + private _array = [ [0.345,0.345,0.168], [0.345,0.29,0.168], [0.4,0.3,0.2], [0.2,0.2,0.1] ] call TCL_Random_F; + + private _color = [_array + [-0.1], _array + [-0.1], _array + [- random 0.5], _array + [-0.05] ]; + + if (floor (random 100) < 100) then + { + _d = 360; + + while { (_d > 0) } do + { + _e = 3; + + while { (_e > 0) } do + { + // _random = [7.5, [sin _d * 1, cos _d * 1, -2.0 + random 0.5 - random 1.5], [ (random 7 - random 7), (random 7 - random 7), (random 2 - random 2) ], [10 - random 2, 10 - random 4, 8] ]; + + // _random = [5, [sin _d * 3, cos _d * 3, - 3 + random 0.5 - random 1.5], [sin _d * 3, cos _d * 3, (random 3 - random 3) ], [_size] ]; + + _random = + [ + 10, + [sin _d * 1, cos _d * 1, - 3 + random 1], + [ (random 13 - random 13) * 3, (random 13 - random 13) * 3, (random 3 - random 3) ], + [random _size] + ]; + + if (floor (random 100) < 50) then + { + // _random set [2, [70 * sin _d, 70 * cos _d, (random 3 - random 3) ] ]; + }; + + drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, 12, 8, 0], "", "Billboard", 1, (_random select 0), + + (_random select 1), (_random select 2), 0, 1, 0.7, 0.1, + + (_random select 3), _color, [0,1,0], 0.6, 0.3, "", "", _vehicle, random 360]; + + _e = _e - 1; + }; + + _d = _d - 1; + + // sleep 0.01; + }; + } + else + { + _d = 0; + + while { (_d < 361) } do + { + _e = 0; + + while { (_e < 2) } do + { + _random = [7.5, [sin _d * 1, cos _d * 1, -2.0 + random 0.5 - random 1.5], [ (random 7 - random 7), (random 7 - random 7), (random 2 - random 2) ], [7 - random 4, 7 - random 4, 1] ]; + + drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, 12, 8, 0], "", "Billboard", 1, (_random select 0), + + (_random select 1), (_random select 2), 1, 2, 1.55, 0.10, + + (_random select 3), _color, [0,1,0], 0.6, 0.3, "", "", _vehicle, random 360]; + + _e = _e + 1; + }; + + _d = _d + 1; + }; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Flash_FX_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Flash_FX_F.sqf new file mode 100644 index 0000000..e302e59 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Flash_FX_F.sqf @@ -0,0 +1,77 @@ +TCL_Flash_FX_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Flash FX Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Flash FX + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle","_size"]; + + private "_random"; + + private _count = _size; + + _count = _count + (random _size); + + while { (_count > 0) } do + { + _random = + [ + round 1 + random 1, + 0.1 + random 0.1, + [ (random _size), (random _size), (random _size) ] + ]; + + drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, (_random select 0), 32, 1], "", "Billboard", 1, (_random select 1), + + "destructionEffect1", [0,0,0], 0, 1, 0, 0, + + (_random select 2), [ [1,1,1,-1],[1,1,1,-3],[1,1,1,-1] ], [ (random _size) ], + + 1, 1, "", "", _vehicle, random 360]; + + _count = _count - 1; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Flash FX Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Flash FX + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle","_size"]; + + private "_random"; + + private _count = _size; + + _count = _count + (random _size); + + while { (_count > 0) } do + { + _random = + [ + 0.1 + random 0.3, + [ (random 10 - random 10), (random 10 - random 10), (random _size) ] + ]; + + drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, 0, 16, 1], "", "Billboard", 1, (_random select 0), + + "destructionEffect1", (_random select 1), 0, 1, 0, 0, + + [_size / 5, _size / 3], [ [1,1,1,-3],[1,1,1,-2],[1,1,1,-1],[1,1,1,-0] ], [ (random _size) + (random _size) ], + + 1, 1, "", "", _vehicle, random 360]; + + _count = _count - 1; + }; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Mud_FX_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Mud_FX_F.sqf new file mode 100644 index 0000000..c515ede --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Mud_FX_F.sqf @@ -0,0 +1,44 @@ +TCL_Mud_FX_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Mud FX Function #9 + // //////////////////////////////////////////////////////////////////////////// + // Mud FX + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle","_size"]; + + if (isOnRoad _vehicle) exitWith {}; + + private "_random"; + + private _count = (_size * 3); + + _count = (_count + random _size); + + while { (_count > 0) } do + { + _random = + [ + 1 + random 3, + [ (random 7 - random 7), (random 7 - random 7), 1 + (random 3) ], + [_size / 3], + [ [0.1,0.1,0.1,1],[0.1,0.1,0.1,0.5],[0.1,0.1,0.1,0.3] ] + ]; + + if (floor (random 100) < 35) then + { + _random set [3, [ [0.3,0.3,0.3,1],[0.3,0.3,0.3,0.5],[0.3,0.3,0.3,0.3] ] ]; + }; + + drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, 12, 9, 0], "", "Billboard", 1, (_random select 0), + + [0,0,-1], (_random select 1), 0, 1, 0, 0, + + (_random select 2), (_random select 3), [1000], 0, 0, "", "", _vehicle, random 360]; + + _count = _count - 1; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Shard_FX_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Shard_FX_F.sqf new file mode 100644 index 0000000..49d1e6e --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Shard_FX_F.sqf @@ -0,0 +1,59 @@ +TCL_Shard_FX_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Shard FX Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Shrad FX + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle","_size"]; + + private _shard = ["Shard.p3d","Shard2.p3d","Shard3.p3d","Shard4.p3d"] call TCL_Random_F; + + private _string = "\A3\Data_F\ParticleEffects\Shard\"; + + _string = _string + _shard; + + private "_random"; + + private _count = _size; + + _count = _count + (random _size); + + while { (_count > 0) } do + { + _random = + [ + 50, + [ (random _size - random _size), (random _size - random _size), (random _size) + (random _size) ], + 3 + random 5, + [0.7 + random 0.3], + 0.5 - random 0.1 + ]; + + if (floor (random 100) < 50) then + { + _random set [1, [ (random _size - random _size) * 5, (random _size - random _size) * 5, (random _size) + (random _size) ] ]; + }; + + if (_size < 10) then + { + _random set [3, [0.3 + random 0.7] ]; + }; + + if (_random select 3 select 0 > 0.5) then + { + _random set [4, 0.5 - random 0.3]; + }; + + drop [_string, "", "SpaceObject", 1, (_random select 0), + + "destructionEffect1", (_random select 1), (_random select 2), 1, 0, 0, + + (_random select 3), [ [1,1,1,1] ], [1000], random 0.5, random 1, "", "", _vehicle, random 360, True, (_random select 4) ]; + + _count = _count - 1; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Smoke_FX_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Smoke_FX_F.sqf new file mode 100644 index 0000000..1a3d011 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Smoke_FX_F.sqf @@ -0,0 +1,71 @@ +TCL_Smoke_FX_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Smoke FX Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Smoke FX + // Script by =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle","_size"]; + + _fuel = (fuel _vehicle); + + private ["_count","_random"]; + + private _smoke = "#particlesource" createVehicleLocal (getPos _vehicle); + _smoke setDropInterval 0.1; + + while { (_fuel > 0) } do + { + _fuel = _fuel - (random 0.005); + + _random = + [ + 5 + random 7, + [ (random 5 - random 5), (random 5 - random 5), 5 + random 7], + [_size / 5, _size / 3] + ]; + + + _smoke setParticleParams [ ["\A3\Data_F\ParticleEffects\Universal\Universal_02.p3d", 8, 0, 8, 1], "", "Billboard", 1, (_random select 0), + + "destructionEffect1", (_random select 1), 1, 1, 1, 1, + + (_random select 2), [ [-1,-1,-1,0.1],[-1,-1,-1,0.3],[-1,-1,-1,0.5],[-1,-1,-1,1],[-1,-1,-1,0.5],[-1,-1,-1,0.3],[-1,-1,-1,0.1] ], [random 3], 0, 0, "", "", _vehicle, random 360]; + + // _smoke setParticleRandom [0.5, [0.1, 0.1, 0.1], [0.1, 0.1, 0.1], 0.1, 0.5, [0.1,0.1,0.1,0], 0, 0]; + + hint str _fuel; + + if (False) then + { + + _count = 5; + + while { (_count > 0) } do + { + _random = + [ + 5 + random 7, + [ (random 5 - random 5), (random 5 - random 5), 5 + random 7], + [_size / 5, _size / 3] + ]; + + drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal_02.p3d", 8, 0, 8, 1], "", "Billboard", 1, (_random select 0), + + "destructionEffect1", (_random select 1), 1, 1, 1, 1, + + (_random select 2), [ [-1,-1,-1,0.1],[-1,-1,-1,0.3],[-1,-1,-1,0.5],[-1,-1,-1,1],[-1,-1,-1,0.5],[-1,-1,-1,0.3],[-1,-1,-1,0.1] ], [random 3], 0, 0, "", "", _vehicle, random 360]; + + _count = _count - 1; + + sleep 1; + }; + + }; + + sleep 1; + }; + + } +]; diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Stone_FX_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Stone_FX_F.sqf new file mode 100644 index 0000000..87fece0 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX/TCL_Stone_FX_F.sqf @@ -0,0 +1,56 @@ +TCL_Stone_FX_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Stone FX Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Stone FX + // Script by =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle","_size"]; + + private "_random"; + + _count = _size; + + _count = _count + (random _size); + + while { (_count > 0) } do + { + _random = + [ + 50, + [ (random _size - random _size), (random _size - random _size), (random _size) ], + 1 + random 5, + [0.1 + random 0.5], + 0.5 - random 0.1 + ]; + + if (floor (random 100) < 50) then + { + if (_random select 3 select 0 < 0.3) then + { + _random set [1, [ (random _size - random _size) * 3, (random _size - random _size) * 3, (random _size) ] ]; + }; + }; + + if (_size < 10) then + { + _random set [3, [0.1 + random 0.3] ]; + }; + + if (_random select 3 select 0 > 0.3) then + { + _random set [4, 0.3 - random 0.1]; + }; + + drop ["\A3\Data_F\ParticleEffects\Pstone\PStone.p3d", "", "SpaceObject", 1, (_random select 0), + + "destructionEffect1", (_random select 1), (_random select 2), 1, 0, 0, + + (_random select 3), [ [1,1,1,1] ], [1000], 0, 0, "", "", _vehicle, random 360, True, (_random select 4) ]; + + _count = _count - 1; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX_F.sqf new file mode 100644 index 0000000..b726166 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Explosion_FX_F.sqf @@ -0,0 +1,57 @@ +TCL_Explosion_FX_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Explosion FX Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Explosion FX + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle"]; + + private _size = (sizeOf typeOf _vehicle); + + [_vehicle, _size] call (TCL_Flash_FX_F select 0); + + [_vehicle, _size] call (TCL_Flash_FX_F select 1); + + [_vehicle, _size] call (TCL_Shard_FX_F select 0); + + private _detector = objNull; + + if (TCL_Sound) then + { + _detector = "EmptyDetector" createVehicleLocal (getPos _vehicle); + + private _sound = (TCL_Resource select 14) call TCL_Random_F; + + private _distance = (_size * 50); + + _detector say [_sound, _distance]; + }; + + while { (getPos _vehicle select 2 > 3) } do + { + sleep 1; + }; + + if (surfaceIsWater getPos _vehicle) exitWith {}; + + [_vehicle, _size] call (TCL_Dust_FX_F select 0); + + [_vehicle, _size] spawn (TCL_Mud_FX_F select 0); + + [_vehicle, _size] spawn (TCL_Dirt_FX_F select 0); + + [_vehicle, _size] spawn (TCL_Stone_FX_F select 0); + + // [_vehicle, _size] spawn (TCL_Smoke_FX_F select 0); + + if (alive _detector) then + { + sleep 5; + + deleteVehicle _detector; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_FX_F/TCL_Dirt_FX.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_FX_F/TCL_Dirt_FX.sqf new file mode 100644 index 0000000..4b7cce2 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_FX_F/TCL_Dirt_FX.sqf @@ -0,0 +1,11 @@ +// //////////////////////////////////////////////////////////////////////////// +// Dirt F.X. +// //////////////////////////////////////////////////////////////////////////// +// By =\SNKMAN/= +// //////////////////////////////////////////////////////////////////////////// + +drop [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, 12, 9, 0], "", "Billboard", 1, 1 + random 1, + +_this, [0,0,0], 0, 1.3 + random 0.7, 1, 0, + +[1 + random 1, 1 - random 1, random 1], [ [0.1,0.1,0.1,1],[0.1,0.1,0.1,0] ], [1000], 0, 0, "", "", ""]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Fire_FX_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Fire_FX_F.sqf new file mode 100644 index 0000000..ba37d6e --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Fire_FX_F.sqf @@ -0,0 +1,72 @@ +TCL_Fire_FX_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Fire FX Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Fire FX + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit"]; + + private _position = (getPos _unit); + + private _offset = 0.3 + (random 0.5); + + private _fire = "#particlesource" createVehicleLocal _position; + _fire setDropInterval 0.01; + _fire attachTo [_unit, [0,0,_offset] ]; + + private _light = "#lightpoint" createVehicleLocal _position; + _light setLightBrightness 0; + _light setLightAmbient [3,1,0]; + _light setLightColor [3,1,0]; + _light lightAttachObject [_unit, [0,0,_offset] ]; + + private _sound = createSoundSource ["Sound_Fire", _position, [], 0]; + _sound attachto [_unit, [0,0,_offset] ]; + + private _value = 1 + (random 1); + + while { (_value > 1) } do + { + _fire setParticleParams [ ["\A3\Data_F\ParticleEffects\Universal\Universal.p3d", 16, 10, 32, 1], "", "Billboard", 1, 0.3 + random 0.5, + + [0, 0, (getPos _unit select 2) + _offset], [0, 0, 0], 0, 1, 1, 0.7, + + [_value / 3, _value / 7], [ [1,1,1,-0],[1,1,1,-1],[1,1,1,-1],[1,1,1,-1],[1,1,1,-1],[1,1,1,0] ], [3 - random 1], 0, 0, "", "", _unit]; + + _fire setParticleRandom [0.5, [0.1, 0.1, 0.1], [0.1, 0.1, 0.1], 0.1, 0.5, [0.1,0.1,0.1,0], 0, 0]; + + _light setLightBrightness (_value / 7); + + if (alive _unit) then + { + _value = _value + (random 0.01); + + if (floor (random 100) < 35) then + { + private _scream = (TCL_Resource select 15) call TCL_Random_F; + + _unit say _scream; + }; + } + else + { + _offset = 0.5; + + _value = _value - (random 0.01); + + _value = _value - (rain / 7); + }; + + sleep 1; + }; + + deleteVehicle _fire; + + deleteVehicle _light; + + deleteVehicle _sound; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Impact_FX_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Impact_FX_F.sqf new file mode 100644 index 0000000..a201348 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Impact_FX_F.sqf @@ -0,0 +1,125 @@ +TCL_Impact_FX_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Impact FX Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Impact FX + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_bullet"]; + + private _distance = (_bullet distance player); + + while { (alive _bullet) } do + { + _distance = (_bullet distance player); + + sleep 0.01; + }; + + if (_distance < 5) then + { + TCL_Impact_FX set [0, (TCL_Impact_FX select 0) + 0.5]; + + private _value = (3 / _distance); + + addCamShake [_value, 1, 50]; + + private["_delay1", "_delay2", "_fatigue"]; + + // BIS_fnc_feedback_fatiguePP = false; + + BIS_fnc_feedback_fatigueCC = ppEffectCreate ["ColorCorrections", 1615]; + BIS_fnc_feedback_fatigueRadialBlur = ppEffectCreate ["RadialBlur", 275]; + + // BIS_fnc_feedback_fatigueBlur = ppEffectCreate ["DynamicBlur", 175]; + + // BIS_fnc_feedback_fatigueCC ppEffectEnable FALSE; + + // init PPs to avoid fullscreen color at the beginning (used same values as for FADE OUT)------------- + /* BIS_fnc_feedback_fatigueRadialBlur ppEffectAdjust [0,0,0.5,0.5]; //================================= hotfix of blur ================================= + // BIS_fnc_feedback_fatigueRadialBlur ppEffectCommit 0;*/ + + // add gaussian blur to make radial blur look better - LOWER + /* BIS_fnc_feedback_fatigueBlur ppEffectAdjust [0]; //================================= hotfix of blur ================================= + // BIS_fnc_feedback_fatigueBlur ppEffectCommit 0; */ + + //RED + BIS_fnc_feedback_fatigueCC ppEffectAdjust [1,1,0,[0.15, 0.15, 0.15, 0],[1, 1, 1, 1],[0.587, 0.587, 0.587, 0],[1, 1, 0, 0, 0, 0.2, 1]]; + + // BIS_fnc_feedback_fatigueCC ppEffectCommit 0; + // init PPs ------------------------------------------------------------------------------------------ + // _fatigue = ((getFatigue player) - 0.5) * 2; + + _fatigue = (TCL_Impact_FX select 0); + + // FADE PPs IN --------------------------------------------------------------------------------------- + _delay1 = 0.1 * acctime; + + // slight radial blur + BIS_fnc_feedback_fatigueRadialBlur ppEffectAdjust [0, 0, 0, 0]; + BIS_fnc_feedback_fatigueRadialBlur ppEffectCommit 0; + BIS_fnc_feedback_fatigueRadialBlur ppEffectEnable TRUE; + + // BIS_fnc_feedback_fatigueRadialBlur ppEffectAdjust [((0.005*_fatigue)+0.001067), ((0.005*_fatigue)+0.001067), 0.3, 0.3]; //================================= hotfix of blur ================================= + BIS_fnc_feedback_fatigueRadialBlur ppEffectAdjust [((0.0004*_fatigue)+0.001067), ((0.0004*_fatigue)+0.001067), 0.04, 0.04]; //================================= hotfix of blur ================================= + BIS_fnc_feedback_fatigueRadialBlur ppEffectCommit _delay1; + + // add gaussian blur to make radial blur look better - when player incapacitated switch this off + /* BIS_fnc_feedback_fatigueBlur ppEffectAdjust [_fatigue/1.5]; //================================= hotfix of blur ================================= + BIS_fnc_feedback_fatigueBlur ppEffectEnable TRUE; + BIS_fnc_feedback_fatigueBlur ppEffectCommit _delay1;*/ + + if (currentVisionMode player == 0) then + { + // In normal view use red (changes with damage from gray to red) + BIS_fnc_feedback_fatigueCC ppEffectAdjust [1,1,0,[0.15, 0.15, 0.15, ((0.466*_fatigue)+0.2)], + [1.0, 1.0, 1.0, 1-((1.3*_fatigue)-0.8)], + [0.587, 0.587, 0.587, 0.0], + [0.85, 0.85, 0, 0, 0, 0.2, 1]]; + } + else + { + // In NVG(1) or FLIR(2) use gray (consider using a little darker with NVGs) + BIS_fnc_feedback_fatigueCC ppEffectAdjust [1,1,0,[0.15, 0.15, 0.15, ((0.466*_fatigue)+0.2)], + [1, 1, 1, 1], + [0.3, 0.3, 0.3, 0], + [0.85, 0.85, 0, 0, 0, 0.2, 1]]; + }; + + BIS_fnc_feedback_fatigueCC ppEffectEnable TRUE; + BIS_fnc_feedback_fatigueCC ppEffectForceInNVG TRUE; + BIS_fnc_feedback_fatigueCC ppEffectCommit _delay1; + + sleep (_delay1 + 0.1); //added 0.1 to avoid flickering, see news:jubiqj$d5l$1@new-server.localdomain + + // FADE PPs OUT --------------------------------------------------------------------------------------- + _delay2 = (1.5 + random 0.5) * acctime; + + // _delay2 = 0.1; + + // slight radial blur - LOWER + BIS_fnc_feedback_fatigueRadialBlur ppEffectAdjust [0,0,0.5,0.5]; + BIS_fnc_feedback_fatigueRadialBlur ppEffectCommit _delay2; + + // add gaussian blur to make radial blur look better - LOWER + /* BIS_fnc_feedback_fatigueBlur ppEffectAdjust [0]; //================================= hotfix of blur ================================= + BIS_fnc_feedback_fatigueBlur ppEffectCommit _delay2; */ + + BIS_fnc_feedback_fatigueCC ppEffectAdjust [1,1,0,[0.15, 0.15, 0.15, 0],[1, 1, 1, 1],[0.3, 0.3, 0.3, 0],[1, 1, 0, 0, 0, 0.2, 1]]; + BIS_fnc_feedback_fatigueCC ppEffectCommit _delay2; + + sleep (_delay2 + 0.1); //added 0.1 to avoid flickering, see news:jubiqj$d5l$1@new-server.localdomain + + // switch PPs off + // BIS_fnc_feedback_fatigueCC ppEffectEnable FALSE; + // BIS_fnc_feedback_fatigueRadialBlur ppEffectEnable FALSE; + // BIS_fnc_feedback_fatigueBlur ppEffectEnable FALSE; //================================= hotfix of blur ================================= + + TCL_Impact_FX set [0, (TCL_Impact_FX select 0) - 0.5]; + + // BIS_fnc_feedback_fatiguePP = false; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Whiz_FX_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Whiz_FX_F.sqf new file mode 100644 index 0000000..9692c11 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_AddOns/TCL_Whiz_FX_F.sqf @@ -0,0 +1,92 @@ +#define TCL_DeleteAT(_array, _index, _object); (_array select _index) deleteAt ( (_array select _index) find _object); + +TCL_Whiz_FX_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Whiz FX Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Whiz FX + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_bullet"]; + + private _direction = [_unit, player] call TCL_Rel_Dir_To_F; + + if ( (_direction > 340) || (_direction < 20) ) then + { + (TCL_Whiz_FX select 0) pushBack _bullet; + + private _array = (TCL_Whiz_FX select 1); + + private _detector = (_array select 0); + + TCL_DeleteAT(TCL_Whiz_FX,1,_detector); + + [_bullet, _detector] spawn (TCL_Whiz_FX_F select 1); + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Whiz FX Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Whiz FX + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_bullet","_detector"]; + + if (alive _bullet) then + { + private _sound = (TCL_Resource select 0) call TCL_Random_F; + + private _random = 1 + (random 3); + + _detector say3D [_sound, 100, _random]; + + private _time = (time + 1); + + while { ( (alive _bullet) && { (time < _time) } ) } do + { + _detector setPos (getPos _bullet); + + sleep 0.01; + }; + + _detector setPos [0,0,0]; + }; + + TCL_DeleteAT(TCL_Whiz_FX,0,_bullet); + + (TCL_Whiz_FX select 1) pushBack _detector; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Whiz FX Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Whiz FX + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_shell"]; + + private _detector = "EmptyDetector" createVehicleLocal (getPos _shell); + + private _sound = (TCL_Resource select 1) call TCL_Random_F; + + _detector say3D [_sound, 300]; + + private _time = (time + 1); + + while { ( (alive _shell) && { (time < _time) } ) } do + { + _detector setPos (getPos _shell); + + sleep 0.01; + }; + + deleteVehicle _detector; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_AI.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_AI.sqf new file mode 100644 index 0000000..5c2c055 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_AI.sqf @@ -0,0 +1,48 @@ +// //////////////////////////////////////////////////////////////////////////// +// Tactical Combat Link +// //////////////////////////////////////////////////////////////////////////// +// A.I. Database +// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project ) +// By =\SNKMAN/= +// //////////////////////////////////////////////////////////////////////////// + +if (TCL_Server) then +{ + if (isNil "TCL_AI") then + { + TCL_AI = [ + + // 0 - 2 ( Reinforcement ) + 1, + 0.15, + 3, + + // 3 - 6 ( Additional ) + False, + 3, + 700, + True, + + // 7 - 8 ( Disable ) + False, + False, + + // 9 ( Regroup ) + True, + + // 10 ( Timeout ) + 170, + + // 11 ( Synchronize ) + False + ]; + + if (TCL_FilePatching) then + { + if ("UserConfig\TCL\TCL_AI.sqf" call TCL_Exist_F) then + { + call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_AI.sqf"; + }; + }; + }; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Debug.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Debug.sqf new file mode 100644 index 0000000..12cf866 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Debug.sqf @@ -0,0 +1,41 @@ +// //////////////////////////////////////////////////////////////////////////// +// Tactical Combat Link +// //////////////////////////////////////////////////////////////////////////// +// Debug Database +// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project ) +// By =\SNKMAN/= +// //////////////////////////////////////////////////////////////////////////// + +if (isNil "TCL_Debug") then +{ + TCL_Debug = [ + + // 0 ( System Debug ) + False, + + // 1 - 3 ( Marker Debug ) + False, + False, + False, + + // 4 ( Cursor ) + False, + + // 5 ( Mission Debug ) + False, + + // 6 ( Development Debug ) + False + ]; + + if (TCL_Server) then + { + if (TCL_FilePatching) then + { + if ("UserConfig\TCL\TCL_Debug.sqf" call TCL_Exist_F) then + { + call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_Debug.sqf"; + }; + }; + }; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_FX.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_FX.sqf new file mode 100644 index 0000000..6ff6d09 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_FX.sqf @@ -0,0 +1,49 @@ +// //////////////////////////////////////////////////////////////////////////// +// Tactical Combat Link +// //////////////////////////////////////////////////////////////////////////// +// FX Database +// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project ) +// By =\SNKMAN/= +// //////////////////////////////////////////////////////////////////////////// + +if (isNil "TCL_FX") then +{ + TCL_FX = [ + + // 0 ( Bullet ) + True, + 5, + + // 2 ( Shell ) + True, + 50, + + // 4 ( Church ) + True, + + // 5 ( Lighthouse ) + True, + + // 6 - 10 ( Radio ) + True, + 3, + 3, + 199, + 210, + + // 11 ( Crew ) + True, + 35, + + // 13 ( Explosion ) + True + ]; + + if (TCL_FilePatching) then + { + if ("UserConfig\TCL\TCL_FX.sqf" call TCL_Exist_F) then + { + call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_FX.sqf"; + }; + }; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Feature.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Feature.sqf new file mode 100644 index 0000000..fed3d1d --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Feature.sqf @@ -0,0 +1,88 @@ +// //////////////////////////////////////////////////////////////////////////// +// Tactical Combat Link +// //////////////////////////////////////////////////////////////////////////// +// Feature Database +// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project ) +// By =\SNKMAN/= +// //////////////////////////////////////////////////////////////////////////// + +if (TCL_Server) then +{ + if (isNil "TCL_Feature") then + { + TCL_Feature = [ + + // 0 ( Watch ) + True, + 50, + + // 2 ( Garrison ) + True, + + // 3 - 6 ( Smoke ) + True, + 50, + True, + 75, + + // 7 ( Flare ) + True, + 50, + + // 9 ( Artillery ) + True, + 15, + + // 11 ( House Search ) + True, + 50, + + // 13 ( Static Weapon ) + True, + 50, + + // 15 - 18 ( Take Cover ) + True, + 50, + 30, + 50, + + // 19 - 21 ( Flanking ) + True, + 50, + 50, + + // 22 - 26 ( Advancing ) + True, + 15, + 50, + 300, + 700, + + // 27 - 29 ( Suppressed ) + True, + 0.90, + 5, + + // 30 - 31 ( Heal ) + True, + 50, + + // 32 - 33 ( Rearm ) + True, + 50, + + // 34 - 35 ( Surrender ) + True, + 5 + ]; + + if (TCL_FilePatching) then + { + if ("UserConfig\TCL\TCL_Feature.sqf" call TCL_Exist_F) then + { + call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_Feature.sqf"; + }; + }; + }; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_IQ.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_IQ.sqf new file mode 100644 index 0000000..1e30d40 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_IQ.sqf @@ -0,0 +1,33 @@ +// //////////////////////////////////////////////////////////////////////////// +// Tactical Combat Link +// //////////////////////////////////////////////////////////////////////////// +// I.Q. Database +// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project ) +// By =\SNKMAN/= +// //////////////////////////////////////////////////////////////////////////// + +if (TCL_Server) then +{ + if (isNil "TCL_IQ") then + { + TCL_IQ = [ + + // 0 ( Knowledge ) + 1, + + // 1 ( Distance ) + 100, + + // 2 ( KnowsAbout ) + 3 + ]; + + if (TCL_FilePatching) then + { + if ("UserConfig\TCL\TCL_IQ.sqf" call TCL_Exist_F) then + { + call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_IQ.sqf"; + }; + }; + }; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Radio.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Radio.sqf new file mode 100644 index 0000000..ee27f27 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Radio.sqf @@ -0,0 +1,29 @@ +// //////////////////////////////////////////////////////////////////////////// +// Tactical Combat Link +// //////////////////////////////////////////////////////////////////////////// +// Radio Database +// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project ) +// By =\SNKMAN/= +// //////////////////////////////////////////////////////////////////////////// + +if (TCL_Server) then +{ + if (isNil "TCL_Radio") then + { + TCL_Radio = [ + + // 0 - 2 ( Radio ) + True, + 30, + [3000, 5000, 7000, 10000, 13000] + ]; + + if (TCL_FilePatching) then + { + if ("UserConfig\TCL\TCL_Radio.sqf" call TCL_Exist_F) then + { + call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_Radio.sqf"; + }; + }; + }; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Resource.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Resource.sqf new file mode 100644 index 0000000..082c34c --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Resource.sqf @@ -0,0 +1,42 @@ +// //////////////////////////////////////////////////////////////////////////// +// Tactical Combat Link +// //////////////////////////////////////////////////////////////////////////// +// Resource Database +// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project ) +// By =\SNKMAN/= +// //////////////////////////////////////////////////////////////////////////// + +TCL_Resource = [ + + // ( 0 - 1 ) + ["Bullet_v01","Bullet_v02","Bullet_v03","Bullet_v04","Bullet_v05","Bullet_v06","Bullet_v07","Bullet_v08","Bullet_v09","Bullet_v10","Bullet_v11","Bullet_v12","Bullet_v13","Bullet_v14","Bullet_v15","Bullet_v16","Bullet_v17","Bullet_v18","Bullet_v19","Bullet_v20","Bullet_v21","Bullet_v22","Bullet_v23","Bullet_v24","Bullet_v25","Bullet_v26","Bullet_v27","Bullet_v28","Bullet_v29","Bullet_v30","Bullet_v31","Bullet_v32","Bullet_v33","Bullet_v34","Bullet_v35","Bullet_v36","Bullet_v37","Bullet_v38","Bullet_v39","Bullet_v40","Bullet_v41","Bullet_v42","Bullet_v43"], + ["Shell_In_v01","Shell_In_v02","Shell_In_v03","Shell_In_v04","Shell_In_v05","Shell_In_v06","Shell_In_v07"], + + // ( 2 - 7 ) + ["West_Air_v01a","West_Air_v02a","West_Air_v03a","West_Air_v04a","West_Air_v05a","West_Air_v06a","West_Air_v07a","West_Air_v08a","West_Air_v09a","West_Air_v10a","West_Air_v11a","West_Air_v12a","West_Air_v13a","West_Air_v14a","West_Air_v15a","West_Air_v16a","West_Air_v17a","West_Air_v18a","West_Air_v19a","West_Air_v20a","West_Air_v21a","West_Air_v22a","West_Air_v23a","West_Air_v24a","West_Air_v25a","West_Air_v26a","West_Air_v27a","West_Air_v28a","West_Air_v29a","West_Air_v30a","West_Air_v31a","West_Air_v32a","West_Air_v33a","West_Air_v34a","West_Air_v35a","West_Air_v36a","West_Air_v37a","West_Air_v38a","West_Air_v39a","West_Air_v40a","West_Air_v41a","West_Air_v42a","West_Air_v43a","West_Air_v44a","West_Air_v45a","West_Air_v46a","West_Air_v47a","West_Air_v48a","West_Air_v49a","West_Air_v50a"], + ["West_Land_v01a","West_Land_v02a","West_Land_v03a","West_Land_v04a","West_Land_v05a","West_Land_v06a","West_Land_v07a","West_Land_v08a","West_Land_v09a","West_Land_v10a","West_Land_v11a","West_Land_v12a","West_Land_v13a","West_Land_v14a"], + ["East_Land_v01a","East_Land_v02a","East_Land_v03a","East_Land_v04a","East_Land_v05a","East_Land_v06a","East_Land_v07a","East_Land_v08a","East_Land_v09a","East_Land_v10a","East_Land_v11a","East_Land_v12a","East_Land_v13a","East_Land_v14a","East_Land_v15a","East_Land_v16a","East_Land_v17a","East_Land_v18a","East_Land_v19a","East_Land_v20a","East_Land_v21a","East_Land_v22a","East_Land_v23a","East_Land_v24a","East_Land_v25a","East_Land_v26a","East_Land_v27a","East_Land_v28a","East_Land_v29a","East_Land_v30a"], + ["West_Air_Land_v01a","West_Air_Land_v02a","West_Air_Land_v03a","West_Air_Land_v04a","West_Air_Land_v05a","West_Air_Land_v06a","West_Air_Land_v07a","West_Air_Land_v08a","West_Air_Land_v09a","West_Air_Land_v10a","West_Air_Land_v11a","West_Air_Land_v12a","West_Air_Land_v13a","West_Air_Land_v14a","West_Air_Land_v15a","West_Air_Land_v16a","West_Air_Land_v17a","West_Air_Land_v18a","West_Air_Land_v19a","West_Air_Land_v20a","West_Air_Land_v21a","West_Air_Land_v22a","West_Air_Land_v23a","West_Air_Land_v24a","West_Air_Land_v25a","West_Air_Land_v26a","West_Air_Land_v27a","West_Air_Land_v28a","West_Air_Land_v29a","West_Air_Land_v30a","West_Air_Land_v31a","West_Air_Land_v32a","West_Air_Land_v33a","West_Air_Land_v34a","West_Air_Land_v35a","West_Air_Land_v36a","West_Air_Land_v37a","West_Air_Land_v38a","West_Air_Land_v39a","West_Air_Land_v40a","West_Air_Land_v41a","West_Air_Land_v42a","West_Air_Land_v43a","West_Air_Land_v44a"], + + ["West_Land_v01b","West_Land_v02b","West_Land_v03b","West_Land_v04b","West_Land_v05b","West_Land_v06b","West_Land_v07b","West_Land_v08b","West_Land_v09b","West_Land_v10b","West_Land_v11b","West_Land_v12b","West_Land_v13b","West_Land_v14b"], + ["East_Land_v01b","East_Land_v02b","East_Land_v03b","East_Land_v04b","East_Land_v05b","East_Land_v06b","East_Land_v07b","East_Land_v08b","East_Land_v09b","East_Land_v10b","East_Land_v11b","East_Land_v12b","East_Land_v13b","East_Land_v14b","East_Land_v15b","East_Land_v16b","East_Land_v17b","East_Land_v18b","East_Land_v19b","East_Land_v20b","East_Land_v21b","East_Land_v22b","East_Land_v23b","East_Land_v24b","East_Land_v25b","East_Land_v26b","East_Land_v27b","East_Land_v28b","East_Land_v29b","East_Land_v30b"], + + // ( 8 - 10 ) + ["Church_v02","Church_v06","Church_v07"], + ["Church_v03","Church_v05"], + ["Church_v01","Church_v04"], + + // ( 11 ) + ["Lighthouse_v01","Lighthouse_v02","Lighthouse_v03","Lighthouse_v04"], + + // ( 12 - 13 ) + ["Bullet_Hit_v01","Bullet_Hit_v02","Bullet_Hit_v03","Bullet_Hit_v04","Bullet_Hit_v05","Bullet_Hit_v06"], + + ["Hit_v01","Hit_v02","Hit_v03","Hit_v04","Hit_v05","Hit_v06","Hit_v07","Hit_v08","Hit_v09","Hit_v10","Hit_v11","Hit_v12","Hit_v13","Hit_v14","Hit_v15"], + + // ( 14 ) + ["Explosion_v01","Explosion_v02","Explosion_v03","Explosion_v04","Explosion_v05","Explosion_v06","Explosion_v07","Explosion_v08","Explosion_v09","Explosion_v10","Explosion_v11","Explosion_v12","Explosion_v13","Explosion_v14","Explosion_v15","Explosion_v16","Explosion_v17","Explosion_v18","Explosion_v19","Explosion_v20","Explosion_v21","Explosion_v22","Explosion_v23","Explosion_v24","Explosion_v25","Explosion_v26","Explosion_v27","Explosion_v28"], + + // ( 15 ) + ["Scream_v01","Scream_v02","Scream_v03","Scream_v04","Scream_v05"] +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_System.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_System.sqf new file mode 100644 index 0000000..3423028 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_System.sqf @@ -0,0 +1,62 @@ +// //////////////////////////////////////////////////////////////////////////// +// Tactical Combat Link +// //////////////////////////////////////////////////////////////////////////// +// System Database +// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project ) +// By =\SNKMAN/= +// //////////////////////////////////////////////////////////////////////////// + +if (isNil "TCL_System") then +{ + TCL_System = [ + + // 0 ( Delay ) + 0, + + // 1 ( A.I. ) + True, + + // 2 ( Sides ) + [EAST, WEST, RESISTANCE], + + // 3 ( Combat System ) + True, + + // 4 ( Get In ) + True, + + // 5 ( Skill ) + True, + + // 6 ( Skill Divider ) + 5, + + // 7 ( Spawn ) + True, + + // 8 ( Delay ) + 0, + + // 9 ( F.X. ) + True, + + // 10 ( Respawn ) + False + ]; + + if (TCL_Server) then + { + if (TCL_FilePatching) then + { + if ("UserConfig\TCL\TCL_System.sqf" call TCL_Exist_F) then + { + call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_System.sqf"; + }; + }; + + if (TCL_Multiplayer) then + { + publicVariable "TCL_System"; + }; + }; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Tweak.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Tweak.sqf new file mode 100644 index 0000000..ca3cde0 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Database/TCL_Tweak.sqf @@ -0,0 +1,36 @@ +// //////////////////////////////////////////////////////////////////////////// +// Tactical Combat Link +// //////////////////////////////////////////////////////////////////////////// +// Tweak Database +// Based on Operation Flashpoint Mod E.C.P. ( Enhanced Configuration Project ) +// By =\SNKMAN/= +// //////////////////////////////////////////////////////////////////////////// + +if (TCL_Server) then +{ + if (isNil "TCL_Tweak") then + { + TCL_Tweak = [ + + // 0 ( Behaviour ) + 0, + + // 1 ( Push and Stop Distance ) + 300, + + // 2 ( Push Chance ) + 50, + + // 3 ( Push Factor ) + 1 + ]; + + if (TCL_FilePatching) then + { + if ("UserConfig\TCL\TCL_Tweak.sqf" call TCL_Exist_F) then + { + call compile preprocessFileLineNumbers "UserConfig\TCL\TCL_Tweak.sqf"; + }; + }; + }; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Fired_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Fired_F.sqf new file mode 100644 index 0000000..7939af2 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Fired_F.sqf @@ -0,0 +1,172 @@ +#include "TCL_Macros.hpp" + +TCL_EH_Fired_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Fired Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Fired + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit"]; + + if (False) then + { + _weapon = (currentWeapon _unit); + + _ammo = (_unit ammo _weapon); + + _ammo = _ammo + 1; + + _unit setAmmo [_weapon, _ammo]; + }; + + if (TCL_Server) then + { + if (_unit in (TCL_Players select 0) ) then + { + if (TCL_Feature select 22) then + { + _this call (TCL_EH_Fired_F select 1); + }; + + if (TCL_Feature select 27) then + { + _this call (TCL_EH_Fired_F select 2); + }; + }; + }; + + if (TCL_Dedicated) exitWith {}; + + private _ammo = _this select 4; + + if (_ammo isKindOf "BulletBase") then + { + if ( (TCL_FX select 0) && { (floor (random 100) < (TCL_FX select 1) ) } ) then + { + if (_unit == player) exitWith {}; + + if ( (_unit distance player < 300) && { (count (TCL_Whiz_FX select 0) < 3) } ) then + { + private _bullet = _this select 6; + + [_unit, _bullet] call (TCL_Whiz_FX_F select 0); + }; + }; + + private _bullet = _this select 6; + + // [_bullet] spawn (TCL_Impact_FX_F select 0); + } + else + { + if ( (TCL_FX select 2) && { (_ammo isKindOf "ShellBase") } && { (floor (random 100) < (TCL_FX select 3) ) } ) then + { + private _shell = _this select 6; + + [_shell] spawn (TCL_Whiz_FX_F select 2); + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Fired Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Fired Advancing + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_weapon","_muzzle"]; + + if (count (TCL_Advancing select 0) < 5) then + { + private _group = (group _unit); + + if (_group in (TCL_Advancing select 1) ) exitWith {}; + + (TCL_Advancing select 1) pushBack _group; + + [_group] spawn + { + params ["_group"]; + + sleep 10; + + TCL_DeleteAT(TCL_Advancing,1,_group); + }; + + private _ammo = _this select 4; + + private _distance = [_unit, _weapon, _muzzle, _ammo] call (TCL_Advancing_F select 0); + + // player sideChat format ["TCL_EH_Fired_F > Advancing > %1", _distance]; + + if (_distance > 0) then + { + private _array = ( (TCL_Advancing select 0) + (TCL_Reinforcement select 0) ); + + [_unit, _array, _distance] call (TCL_Feature_F select 2); + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Fired Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Fired Suppressed + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit"]; + + private _time = (_unit getVariable "TCL_Suppressed"); + + if ( (time - _time) < (TCL_Feature select 28) ) then + { + (TCL_Suppressed select 1) pushBack _unit; + + if ( { (_x == _unit) } count (TCL_Suppressed select 1) > (TCL_Feature select 29) ) then + { + TCL_Suppressed set [1, (TCL_Suppressed select 1) - [_unit] ]; + + // player sideChat format ["TCL_EH_Fired_F > Suppressed > %1", count (TCL_Suppressed select 1) ]; + + private _groups = (TCL_Groups select 0); + + _groups = _groups - (TCL_Suppressed select 0); + + private ["_group","_units"]; + + private _count = 0; + + for "_count" from _count to (count _groups - 1) do + { + _group = (_groups select _count); + + _units = (units _group); + + if (_units findIf { ( (alive _x) && { (isNull objectParent _x) } ) } > -1) then + { + [_unit, _group] call (TCL_Suppressed_F select 0); + }; + }; + }; + } + else + { + _unit setVariable ["TCL_Suppressed", time]; + + TCL_Suppressed set [1, (TCL_Suppressed select 1) - [_unit] ]; + }; + + // player sideChat format ["TCL_EH_Fired_F > Suppressed > %1", count (TCL_Suppressed select 1) ]; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Killed_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Killed_F.sqf new file mode 100644 index 0000000..c18e8f0 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Killed_F.sqf @@ -0,0 +1,61 @@ +TCL_EH_Killed_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Killed Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Killed + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle"]; + + if (TCL_Server) then + { + if (_vehicle isKindOf "Tank") then + { + if (TCL_FX select 11) then + { + if (floor (random 100) < (TCL_FX select 12) ) then + { + private _crew = (crew _vehicle); + + if (_crew isEqualTo [] ) exitWith {}; + + [_crew, _vehicle] spawn (TCL_Crew_FX_F select 0); + }; + }; + }; + + [_vehicle] call (TCL_EH_Killed_F select 1); + }; + + if (TCL_Dedicated) exitWith {}; + + if (TCL_FX select 13) then + { + [_vehicle] spawn (TCL_Explosion_FX_F select 0); + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Killed Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Killed + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle"]; + + private _size = (sizeOf typeOf _vehicle); + + private _distance = (_size * 50); + + private _array = ( (TCL_Garrison select 0) + (TCL_Advancing select 0) + (TCL_Reinforcement select 0) ); + + [_vehicle, _array, _distance] call (TCL_Feature_F select 2); + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Respawn_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Respawn_F.sqf new file mode 100644 index 0000000..034da99 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Respawn_F.sqf @@ -0,0 +1,116 @@ +TCL_EH_Respawn_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Respawn Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Respawn + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_kia"]; + + private _array = TCL_Respawn; + + _array set [0, (_array select 0) + 1]; + + private _count = (_array select 0); + + private _name = (_array select 1); + + private _string = format ["%1 Kill Count: %2", _name, _count]; + + "DynamicBlur" ppEffectAdjust [0.0]; + "DynamicBlur" ppEffectCommit 0; + + titleText [_string, "BLACK OUT", 3, True, True]; + + _weapon = (primaryWeapon _kia); + + _weaponItems = (primaryWeaponItems _kia); + + sleep 3; + + titleText [_string, "BLACK IN", 3, True, True]; + + private "_unit"; + + if (TCL_Multiplayer) then + { + waitUntil { (alive player) }; + + _unit = player; + } + else + { + private _hight = (getPos _kia select 2); + + private _position = (getPosATL _kia); + + _position set [2, (_position select 2) + _hight]; + + _unit = (group _kia) createUnit [ (typeOf _kia), _position, [], 0, "CAN_COLLIDE"]; + + selectPlayer _unit; + + addSwitchableUnit _unit; + }; + + _unit addEventHandler ["Killed", {_this spawn (TCL_EH_Respawn_F select 0) } ]; + + _unit setDir (getDir _kia); + + _unit setName (_array select 1); + + _unit setRank (_array select 2); + + private _stance = (stance _kia); + + if (True) then + { + if (_stance isEqualTo "STAND") exitWith + { + _unit setUnitPos "UP"; + }; + + if (_stance isEqualTo "CROUCH") exitWith + { + _unit setUnitPos "MIDDLE"; + }; + + if (_stance isEqualTo "PRONE") exitWith + { + _unit setUnitPos "DOWN"; + }; + + if (unitPos _kia isEqualTo "DOWN") exitWith + { + _unit setUnitPos "DOWN"; + }; + }; + + if (isStaminaEnabled _kia) then + { + _unit enableStamina True; + } + else + { + _unit enableStamina False; + }; + + _unit removeWeapon (primaryWeapon _unit); + + _unit addWeapon _weapon; + + {_unit removePrimaryWeaponItem _x} count (primaryWeaponItems _unit); + + {_unit addPrimaryWeaponItem _x} count _weaponItems; + + waitUntil { ( (alive player) && (player == player) ) }; + + {_knowsAbout = (_x knowsAbout vehicle _kia); if (_knowsAbout > 0) then {_x reveal [_unit, _knowsAbout] } } forEach allGroups; + + deleteVehicle _kia; + + _unit selectWeapon (primaryWeapon _unit); + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Zeus_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Zeus_F.sqf new file mode 100644 index 0000000..9632c54 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_EH_Zeus_F.sqf @@ -0,0 +1,158 @@ +#include "TCL_Macros.hpp" + +TCL_EH_Zeus_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Zeus Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Zeus + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_curator","_unit"]; + + private _group = (group _unit); + + private _leader = (leader _group); + + private _vehicle = (vehicle _leader); + + // player sideChat format ["TCL_EH_Zeus_F > Unit > %1", _unit]; + + if (_unit == _vehicle) then + { + // player sideChat format ["TCL_EH_Zeus_F > Vehicle > %1", (typeOf _unit) ]; + + if (TCL_Server) then + { + (TCL_Zeus select 0) pushBack _group; + } + else + { + TCL_Host = [_group]; publicVariable "TCL_Host"; + + // (TCL_Zeus select 0) pushBack _group; publicVariable "TCL_Zeus"; + }; + + [_group] spawn (TCL_EH_Zeus_F select 3); + + // player sideChat format ["TCL_EH_Zeus_F > Group > %1", _group]; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Zeus Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Zeus + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_curator","_group","_waypoint"]; + + if (TCL_Server) then + { + (TCL_Zeus select 1) pushBackUnique _group; + + (TCL_Freeze select 0) pushBackUnique _group; + + if (_group in (TCL_Garrison select 0) ) then + { + private _units = (units _group); + + private _leader = (leader _group); + + _units doFollow _leader; + + TCL_DeleteAT(TCL_Garrison,0,_group); + + private _array = (_group getVariable "TCL_Garrison"); + + TCL_Garrison set [1, (TCL_Garrison select 1) - _array]; + }; + } + else + { + TCL_Host = _this; publicVariable "TCL_Host"; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Zeus Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Zeus + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_curator","_group","_waypoint"]; + + if (TCL_Server) then + { + private _array = (waypoints _group); + + if (count _array == 1) then + { + TCL_DeleteAT(TCL_Zeus,1,_group); + + TCL_DeleteAT(TCL_Freeze,0,_group); + + [_group] spawn (TCL_Garrison_F select 0); + }; + + // player sideChat format ["TCL_EH_Zeus_F > Waypoints > %1 > %2", _array, (count _array) ]; + } + else + { + TCL_Host = _this; publicVariable "TCL_Host"; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Zeus Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Event Handler Zeus + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _id = (groupId _group); + + private _string = format ["%1 ( Zeus ) ", _id]; + + while { (True) } do + { + private _array = (waypoints _group); + + if (count _array == 1) then + { + _group setGroupId [_id]; + } + else + { + _group setGroupId [_string]; + }; + + if (False) then + { + + if (_group in (TCL_Zeus select 1) ) then + { + _group setGroupId [_string]; + } + else + { + _group setGroupId [_id]; + }; + + }; + + if (isNull _group) exitWith {}; + + sleep 1; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_Macros.hpp b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_Macros.hpp new file mode 100644 index 0000000..37d1f24 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_EH_F/TCL_Macros.hpp @@ -0,0 +1,9 @@ +/* //////////////////////////////////////////////////////////////////////////////// +\ \ Tactical Combat Link + \ \------------------------------------------------------------------------------ + \ \ Macros + \ \---------------------------------------------------------------------------- + / / By =\SNKMAN/= + / /----------------------------------------------------------------------------- +*/ /////////////////////////////////////////////////////////////////////////////// +#define TCL_DeleteAT(_array, _index, _object); (_array select _index) deleteAt ( (_array select _index) find _object); \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_EH_Fired.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_EH_Fired.sqf new file mode 100644 index 0000000..84d8e4d --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_EH_Fired.sqf @@ -0,0 +1,31 @@ +// //////////////////////////////////////////////////////////////////////////// +// Event Handler Fired ExecVM +// //////////////////////////////////////////////////////////////////////////// +// By =\SNKMAN/= +// //////////////////////////////////////////////////////////////////////////// +private ["_units","_count","_unit"]; + +while { (True) } do +{ + _units = allUnits; + + _units = _units - (TCL_EH_Fired select 0); + + if (_units isEqualTo [] ) then + { + sleep 5; + } + else + { + (TCL_EH_Fired select 0) append _units; + + _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + _unit addEventHandler ["FiredMan", {_this call (TCL_EH_Fired_F select 0) } ]; + }; + }; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_KnowsAbout.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_KnowsAbout.sqf new file mode 100644 index 0000000..b2d55b7 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_KnowsAbout.sqf @@ -0,0 +1,76 @@ +#include "TCL_Macros.hpp" + +/* //////////////////////////////////////////////////////////////////////////////// +\ \ KnowsAbout ExecVM + \ \------------------------------------------------------------------------------ + \ \ By =\SNKMAN/= + / /----------------------------------------------------------------------------- +*/ /////////////////////////////////////////////////////////////////////////////// +private ["_groups","_count","_group","_units","_time","_random","_array"]; + +// "AwareFormationSoft" enableAIFeature False; + +// "CombatFormationSoft" enableAIFeature True; + +// player sideChat format ["TCL_KnowsAbout.sqf > Feature > %1 > %2", (checkAIFeature "AwareFormationSoft"), (checkAIFeature "CombatFormationSoft") ]; + +while { (True) } do +{ + _groups = (TCL_Groups select 0); + + _groups = _groups - (TCL_Idle select 0); + + _groups = _groups - (TCL_Artillery select 0); + + _groups = _groups - (TCL_Reinforcement select 0); + + _count = 0; + + for "_count" from _count to (count _groups - 1) do + { + _group = (_groups select _count); + + _units = (units _group); + + if (_units findIf { (alive _x) } > -1) then + { + [_group] call (TCL_KnowsAbout_F select 0); + + if (TCL_Feature select 0) then + { + if (floor (random 100) < (TCL_Feature select 1) ) then + { + _time = (_group getVariable "TCL_Watch"); + + if (time > _time) then + { + [_group] spawn (TCL_Watch_F select 0); + }; + + _random = (random 15); + + _group setVariable ["TCL_Watch", (time + _random) ]; + }; + }; + } + else + { + TCL_DeleteAT(TCL_Groups,0,_group); + + if (_group in (TCL_Location select 0) ) then + { + _array = (_group getVariable "TCL_Location"); + + TCL_DeleteAT(TCL_Location,0,_group); + + _array deleteAt (_array find _group); + + // player sideChat format ["TCL_KnowsAbout > Location > %1 > %2", _group, _groups]; + + {_delete = (_x getVariable "TCL_Location"); _delete deleteAt (_delete find _group) } forEach _array; + }; + }; + }; + + sleep 1; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Macros.hpp b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Macros.hpp new file mode 100644 index 0000000..37d1f24 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Macros.hpp @@ -0,0 +1,9 @@ +/* //////////////////////////////////////////////////////////////////////////////// +\ \ Tactical Combat Link + \ \------------------------------------------------------------------------------ + \ \ Macros + \ \---------------------------------------------------------------------------- + / / By =\SNKMAN/= + / /----------------------------------------------------------------------------- +*/ /////////////////////////////////////////////////////////////////////////////// +#define TCL_DeleteAT(_array, _index, _object); (_array select _index) deleteAt ( (_array select _index) find _object); \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Monitor.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Monitor.sqf new file mode 100644 index 0000000..a039430 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Monitor.sqf @@ -0,0 +1,84 @@ +#include "TCL_Macros.hpp" + +/* //////////////////////////////////////////////////////////////////////////////// +\ \ Monitor ExecVM + \ \------------------------------------------------------------------------------ + \ \ By =\SNKMAN/= + / /----------------------------------------------------------------------------- +*/ /////////////////////////////////////////////////////////////////////////////// +private ["_array","_vehicle"]; + +_temp = []; + +while { (True) } do +{ + if (True) then + { + _array = (TCL_Heal select 0); + + if (_array isEqualTo [] ) exitWith {}; + + _array = (TCL_Heal select 0); + + _array = (TCL_Heal select 0) select { (alive _x) }; + + TCL_Heal set [0, _array]; + + _array = (TCL_Heal select 1); + + _array = (TCL_Heal select 1) select { (alive _x) }; + + TCL_Heal set [1, _array]; + }; + + if (True) then + { + _array = (TCL_Rearm select 0); + + if (_array isEqualTo [] ) exitWith {}; + + _array = (TCL_Rearm select 0); + + _array = (TCL_Rearm select 0) select { (alive _x) }; + + TCL_Rearm set [0, _array]; + + _array = (TCL_Rearm select 1); + + _array = (TCL_Rearm select 1) select { (alive _x) }; + + TCL_Rearm set [1, _array]; + }; + + if (True) then + { + _array = (TCL_Flanking select 0); + + if (_array isEqualTo [] ) exitWith {}; + + _array = (TCL_Flanking select 1); + + _array = (TCL_Flanking select 1) select { (alive _x) }; + + TCL_Flanking set [1, _array]; + + _array = (TCL_Flanking select 2); + + _array = (TCL_Flanking select 2) select { (alive _x) }; + + TCL_Flanking set [2, _array]; + }; + + if (True) then + { + _array = (TCL_Artillery select 0); + + if (_array isEqualTo [] ) exitWith {}; + + _array = _array select {_vehicle = (vehicle leader _x); (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") }; + + TCL_Artillery set [0, _array]; + }; + + sleep 30; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Spawn.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Spawn.sqf new file mode 100644 index 0000000..7392065 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Spawn.sqf @@ -0,0 +1,103 @@ +#include "TCL_Macros.hpp" + +/* //////////////////////////////////////////////////////////////////////////////// +\ \ Spawn ExecVM + \ \------------------------------------------------------------------------------ + \ \ By =\SNKMAN/= + / /----------------------------------------------------------------------------- +*/ /////////////////////////////////////////////////////////////////////////////// +private ["_temp","_players","_groups","_array","_count","_group","_vehicles","_vehicle"]; + +_temp = []; + +while { (True) } do +{ + _players = (playableUnits + switchableUnits); + + if (True) then + { + _players = _players - (TCL_Players select 0); + + _array = (TCL_Players select 0) select { (alive _x) }; + + TCL_Players set [0, _array]; + + _array = (TCL_Players select 1) select { (alive _x) }; + + TCL_Players set [1, _array]; + + if (_players isEqualTo [] ) exitWith {}; + + [_players] call (TCL_Players_F select 0); + + // player sideChat format ["TCL_Spawn > Players > %1", _players]; + }; + + _groups = allGroups; + + if (True) then + { + _groups = _groups - (TCL_Groups select 0); + + _array = ( (TCL_Disabled select 0) + (TCL_Players select 2) ); + + _groups = _groups - _array; + + _groups = _groups select { ( (side _x in (TCL_System select 2) ) && { (units _x findIf { (alive _x) } > -1) } ) }; + + _temp = _temp - [grpNull]; + + _groups = _groups - _temp; + + if (_groups isEqualTo [] ) exitWith {}; + + _temp = _temp - (TCL_Groups select 0); + + _temp append _groups; + + _count = 0; + + for "_count" from _count to (count _groups - 1) do + { + _group = (_groups select _count); + + [_group] spawn TCL_Spawn_F; + }; + + // player sideChat format ["TCL_Spawn > Groups > %1 > %2", _groups, _temp]; + }; + + _vehicles = vehicles; + + if (True) then + { + _array = ( (TCL_Vehicles select 0) + (TCL_Vehicles select 1) ); + + _vehicles = _vehicles - _array; + + _array = _vehicles select { ( (_x isKindOf "WeaponHolderSimulated") || (typeOf _x == "Steerable_Parachute_F") ) }; + + _vehicles = _vehicles - _array; + + (TCL_Vehicles select 1) append _array; + + if (_vehicles isEqualTo [] ) exitWith {}; + + [_vehicles] call (TCL_Vehicles_F select 0); + + // player sideChat format ["TCL_Spawn > Vehicles > %1", _vehicles]; + }; + + if (True) then + { + _array = (TCL_Artillery select 0); + + if (_array isEqualTo [] ) exitWith {}; + + _array = _array select {_vehicle = (vehicle leader _x); (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") }; + + TCL_Artillery set [0, _array]; + }; + + sleep 5; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Zeus.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Zeus.sqf new file mode 100644 index 0000000..f213c41 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_ExecVM/TCL_Zeus.sqf @@ -0,0 +1,55 @@ +/* //////////////////////////////////////////////////////////////////////////////// +\ \ Zeus ExecVM + \ \------------------------------------------------------------------------------ + \ \ By =\SNKMAN/= + / /----------------------------------------------------------------------------- +*/ /////////////////////////////////////////////////////////////////////////////// +params ["_curators"]; + +waitUntil { ( (alive player) && (time > 0) ) }; + +private _bool = True; + +private _curator = objNull; + +private ["_count","_curator","_unit","_array"]; + +while { (_bool) } do +{ + _count = 0; + + for "_count" from _count to (count _curators - 1) do + { + _curator = (_curators select _count); + + _unit = (getAssignedCuratorUnit _curator); + + if (_unit == player) exitWith + { + _bool = False; + + (TCL_Curator select 0) pushBack _curator; + + publicVariable "TCL_Curator"; + + // player sideChat format ["TCL_Zeus.sqf > Curator > %1", _curator]; + }; + }; + + _array = (TCL_Curator select 0); + + if (_array isEqualTo _curators) exitWith {}; + + // player sideChat format ["TCL_Zeus.sqf > Curators > %1 > %2", time, _curators]; + + sleep 1; +}; + +if (alive _curator) then +{ + _curator addEventHandler ["CuratorObjectPlaced", {_this spawn (TCL_EH_Zeus_F select 0) } ]; + + _curator addEventHandler ["CuratorWaypointPlaced", {_this call (TCL_EH_Zeus_F select 1) } ]; + + _curator addEventHandler ["CuratorWaypointDeleted", {_this call (TCL_EH_Zeus_F select 2) } ]; +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Extension_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Extension_F.sqf new file mode 100644 index 0000000..572951b --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Extension_F.sqf @@ -0,0 +1,712 @@ +#include "TCL_Macros.hpp" + +TCL_Random_F = + + // //////////////////////////////////////////////////////////////////////////// + // Random Function + // //////////////////////////////////////////////////////////////////////////// + // By Andrew Barron + // Rewritten by Warka + // Optimized by Karel Moricky + // Optimised by Killzone_Kid + // //////////////////////////////////////////////////////////////////////////// + {private "_return"; + + _return = selectRandom _this; + + _return + + }; + +TCL_Dir_To_F = + + // //////////////////////////////////////////////////////////////////////////// + // Direction To Function + // //////////////////////////////////////////////////////////////////////////// + // By Andrew Barron + // Optimised by Killzone_Kid + // //////////////////////////////////////////////////////////////////////////// + {params ["_object","_position"]; + + private _direction = (_object getDir _position); + + _direction + + }; + +TCL_Rel_Dir_To_F = + + // //////////////////////////////////////////////////////////////////////////// + // Relative Direction To Function + // //////////////////////////////////////////////////////////////////////////// + // By Andrew Barron + // Optimised and Extended by =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_object","_position"]; + + private "_direction"; + + if (isNull objectParent _object) then + { + _direction = (_object getRelDir _position); + } + else + { + private _weaponPosition = []; + + if (assignedVehicleRole _object select 0 == "Cargo") then + { + _weaponPosition = (_object weaponDirection currentWeapon _object); + } + else + { + private _vehicle = (vehicle _object); + + if (_vehicle isKindOf "Tank") then + { + _weaponPosition = (_vehicle weaponDirection currentWeapon _vehicle); + }; + }; + + if (_weaponPosition isEqualTo [] ) exitWith + { + _direction = (_object getRelDir _position); + }; + + private _weaponDirection = (_weaponPosition select 0) atan2 (_weaponPosition select 1); + + _weaponDirection = _weaponDirection - (_object getDir _position); + + if (_weaponDirection < 0) then {_weaponDirection = _weaponDirection + 360}; + + if (_weaponDirection > 360) then {_weaponDirection = _weaponDirection - 360}; + + _direction = _weaponDirection; + }; + + _direction + + }; + +TCL_Real_Pos_F = + + // //////////////////////////////////////////////////////////////////////////// + // Relative Position Function + // //////////////////////////////////////////////////////////////////////////// + // By Andrew Barron + // Optimised by =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_position","_distance","_direction"]; + + if (_position isEqualType objNull) exitWith + { + private _return = (_position getPos [_distance, _direction] select [0, 2] ) + [getPos _position select 2]; + + _return + }; + + if (_position isEqualType [] ) exitWith + { + private _return = (_position getPos [_distance, _direction] select [0, 2] ) + ( [ [], [_position select 2] ] select (count _position > 2) ); + + _return + }; + + }; + +TCL_Velocity_F = + + // //////////////////////////////////////////////////////////////////////////// + // Velocity Function + // //////////////////////////////////////////////////////////////////////////// + // By Raedor + // //////////////////////////////////////////////////////////////////////////// + {params ["_object"]; + + private _return = (vectorMagnitude velocity _object) * 3.6; + + _return + + }; + + TCL_Shuffle_F = + + // //////////////////////////////////////////////////////////////////////////// + // Shuffle + // //////////////////////////////////////////////////////////////////////////// + // By Nelson Duarte + // Optimised by Killzone_Kid + // //////////////////////////////////////////////////////////////////////////// + { + + _this = + _this; + + private _count = (count _this); + + for "0" from 1 to _count do + { + _this pushBack (_this deleteAt floor random _count); + }; + + _this + + }; + +TCL_Building_Pos_F = + + // //////////////////////////////////////////////////////////////////////////// + // Building Position Function + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_building"]; + + private _index = 0; + + while { (True) } do + { + if (_building buildingPos _index isEqualTo [0,0,0] ) exitWith + { + _index = _index - 1; + }; + + _index = _index + 1; + }; + + _index + + }; + +TCL_Daytime_F = + + // //////////////////////////////////////////////////////////////////////////// + // Daytime Function + // //////////////////////////////////////////////////////////////////////////// + // By CarlGustaffa + // //////////////////////////////////////////////////////////////////////////// + {params ["_dayTime"]; + + private _return = False; + + private _latitude = -1 * getNumber (configFile >> "CfgWorlds" >> worldName >> "latitude"); + private _year = 360 * (dateToNumber date); + private _day = (_dayTime / 24) * 360; + + private _result = ( (12 * cos (_year) - 78) * cos (_latitude) * cos (_day) ) - (24 * sin (_latitude) * cos (_year) ); + + if (_result > 0) then + { + _return = True; + }; + + _return + + }; + +TCL_Text_F = + + // //////////////////////////////////////////////////////////////////////////// + // Text Function + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + [ {"" + _this + ""}, + {"" + _this + ""}, + {"" + _this + ""}, + "Warning!
", + "Instruction:
", + "Information:
" + ]; + +TCL_Create_Marker_F = + + // //////////////////////////////////////////////////////////////////////////// + // Create Marker Function + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_array","_position","_shape","_size","_type","_color"]; + + private _marker = _array joinString ""; + + if (getMarkerPos _marker isEqualTo [0,0,0] ) then + { + createMarker [_marker, _position]; + + _marker setMarkerShape _shape; + + _marker setMarkerSize _size; + + private _array = ["Horizontal","Border","FDiagonal"]; + + if (_type in _array) then + { + _marker setMarkerBrush _type; + } + else + { + _marker setMarkerType _type; + }; + + _marker setMarkerColor _color; + } + else + { + _marker = ""; + }; + + _marker + + }; + +TCL_Rank_F = + + // //////////////////////////////////////////////////////////////////////////// + // Rank Function + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit"]; + + private _return = 0; + + if (alive _unit) then + { + private _rank = (rank _unit); + + if (_rank isEqualTo "PRIVATE") exitWith + { + _return = 1; + }; + + if (_rank isEqualTo "CORPORAL") exitWith + { + _return = 2; + }; + + if (_rank isEqualTo "SERGEANT") exitWith + { + _return = 3; + }; + + if (_rank isEqualTo "LIEUTENANT") exitWith + { + _return = 4; + }; + + if (_rank isEqualTo "CAPTAIN") exitWith + { + _return = 5; + }; + + if (_rank isEqualTo "MAJOR") exitWith + { + _return = 6; + }; + + if (_rank isEqualTo "COLONEL") exitWith + { + _return = 7; + }; + }; + + _return + + }; + + TCL_Trigger_F = + + // //////////////////////////////////////////////////////////////////////////// + // Trigger Function + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_object"]; + + private _return = False; + + private _trigger = (_group getVariable "TCL_Trigger"); + + if (_object inArea _trigger) then + { + _return = True; + }; + + _return + + }; + + TCL_Visible_F = + + // //////////////////////////////////////////////////////////////////////////// + // Visible Function + // //////////////////////////////////////////////////////////////////////////// + // Visible + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_units","_group","_logic","_array"]; + + private _time = 0; + + private _value = 1; + + // private _array = []; + + private _bool = True; + + private _knowledge = 0; + + private _random = 5 + (random 10); + + private _leader = (leader _group); + + private _tweak = (TCL_IQ select 2); + + private _value = (_value + _tweak); + + _random = (_random * _value); + + _units = _units select { ( (alive _x) && { (_x knowsAbout vehicle _enemy > 0) } ) }; + + _units = _units - _array; + + private _index = (_units find _leader); + + if (_index > 0) then + { + private _unit = (_units select 0); + + _units set [0, _leader]; + + _units set [_index, _unit]; + }; + + private ["_unit","_knowledge","_time"]; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + _knowledge = (_unit targetKnowledge vehicle _enemy) select 2; + + if (_knowledge < 0) then + { + _knowledge = (_unit targetKnowledge vehicle _enemy) select 3; + }; + + if (_knowledge > 0) then + { + _time = (time - _knowledge); + + if (_time < _random) then + { + _bool = False; + + _array pushBack _unit; + + // player sideChat format ["TCL_Visible_F > Knowledge > %1 > %2 > %3", _unit, _time, _random]; + } + else + { + // _unit doFollow _unit; + + if (_unit in (TCL_Static_Weapon select 0) ) then + { + if (floor (random 100) < 50) then + { + private _vehicle = (vehicle _unit); + + [_unit, _group, _vehicle] call (TCL_Static_Weapon_F select 4); + }; + }; + }; + }; + + if (TCL_Debug select 6) then + { + [_unit, _enemy, _array] spawn (TCL_Debug_F select 3); + }; + + if (_leader in _array) exitWith + { + _array = _units; + }; + }; + + if (_bool) then + { + private _skill = [_group] call TCL_Accuracy_F; + + _random = 15 + (random 30); + + _random = (_random * _value); + + _random = (_random * _skill); + + if (_time > _random) then + { + _group forgetTarget _enemy; + }; + + // player sideChat format ["TCL_Visible_F > Forget > %1", _group]; + }; + + _array + + }; + + TCL_Knowledge_F = + + // //////////////////////////////////////////////////////////////////////////// + // Knowledge Function + // //////////////////////////////////////////////////////////////////////////// + // Knowledge + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_groups"]; + + private _return = False; + + private _units = (units _enemy); + + private ["_group","_knowsAbout"]; + + private _count = 0; + + for "_count" from _count to (count _groups - 1) do + { + _group = (_groups select _count); + + // player sideChat format ["TCL_Knowledge_F > Units > %1", (count _units) ]; + + _knowsAbout = (_units findIf { ( (alive _x) && { (_group knowsAbout vehicle _x > 0) } ) } ); + + if (_knowsAbout > -1) exitWith + { + _return = True; + }; + }; + + _return + + }; + + TCL_Spawn_F = + + // //////////////////////////////////////////////////////////////////////////// + // Spawn Function + // //////////////////////////////////////////////////////////////////////////// + // Spawn + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _count = 0; + + while { (_count < count units _group) } do + { + sleep 1; + + _count = _count + 1; + + // player sideChat format ["TCL_Spawn_F > Count > %1 > %2", _group, _count]; + }; + + if (TCL_Multiplayer) then + { + private _leader = (leader _group); + + if (local _leader) exitWith {}; + + sleep 1; + + private _driver = objNull; + + private _vehicle = objNull; + + if (isNull objectParent _leader) then + { + _driver = objNull; + + _vehicle = objNull; + } + else + { + _vehicle = (vehicle _leader); + + _driver = (driver _vehicle); + }; + + if (_group in (TCL_Zeus select 0) ) then + { + _group setGroupOwner 2; + + // player sideChat format ["TCL_Spawn_F > Zeus %1 > %2", _group, (TCL_Zeus select 0) ]; + }; + + if (alive _driver) then + { + if (local _driver) exitWith {}; + + while { (_driver in _vehicle) } do + { + sleep 1; + }; + + _driver moveInDriver _vehicle; + + // player sideChat format ["TCL_Spawn_F > Zeus > Local > %1 > %2", (local _driver), (local _vehicle) ]; + }; + }; + + private _value = (TCL_System select 8); + + sleep _value; + + private _units = (units _group); + + if (_units findIf { (alive _x) } > -1) then + { + _group = [_group]; + + [_group] call (TCL_Groups_F select 0); + }; + + }; + + TCL_Cover_F = + + // //////////////////////////////////////////////////////////////////////////// + // Cover Function + // //////////////////////////////////////////////////////////////////////////// + // Cover + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_array","_distance"]; + + private _position = (_array select 1); + + _objects = (_array select 2); + + if ( (_unit distance _position > _distance) || (_objects isEqualTo [] ) ) then + { + _objects = nearestTerrainObjects [_position, ["HIDE","ROCK","ROCKS","BUSH"], _distance]; + + _array set [2, _objects]; + + _array set [1, (getPos _unit) ]; + + // player sideChat format ["TCL_Take_Cover_F > Far > %1 > %2", _unit, (count _objects) ]; + } + else + { + // player sideChat format ["TCL_Take_Cover_F > Close > %1 > %2", _unit, (count _objects) ]; + }; + + _objects + + }; + + TCL_Exist_F = + + // //////////////////////////////////////////////////////////////////////////// + // Exist Function + // //////////////////////////////////////////////////////////////////////////// + // Exist + // By Killzone_Kid + // //////////////////////////////////////////////////////////////////////////// + {params ["_file"]; + + private _return = False; + + disableSerialization; + + private _ctrl = findDisplay 0 ctrlCreate ["RscHTML", -1]; + + _ctrl htmlLoad _file; + + private _bool = ctrlHTMLLoaded _ctrl; + + if (_bool) then + { + _return = True; + }; + + _return + + }; + + TCL_Accuracy_F = + + // //////////////////////////////////////////////////////////////////////////// + // Accuracy Function + // //////////////////////////////////////////////////////////////////////////// + // Accuracy + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _skill = 1; + + private _leader = (leader _group); + + if (alive _leader) then + { + _skill = _skill + (_leader skill "general"); + + _skill = _skill + (_leader skill "commanding"); + + _skill = _skill - (_leader skill "courage"); + + if (_skill < 1) then + { + _skill = 1; + }; + + // player sideChat format ["TCL_Accuracy_F > Skill > %1 > %2", _leader, _skill]; + }; + + _skill + + }; + + TCL_Flanking_F = + + // //////////////////////////////////////////////////////////////////////////// + // Flanking Function + // //////////////////////////////////////////////////////////////////////////// + // Flanking + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _return = []; + + private _units = (units _group); + + private _leader = (leader _group); + + _units deleteAt (_units find _leader); + + private _random = 3 - (random 1); + + _value = (count _units / _random); + + private "_unit"; + + private _count = 0; + + while { (_count < _value) } do + { + _unit = (_units select _count); + + _return pushBack _unit; + + _count = _count + 1; + }; + + _return + + }; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Advancing_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Advancing_F.sqf new file mode 100644 index 0000000..e5d693c --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Advancing_F.sqf @@ -0,0 +1,276 @@ +#include "TCL_Macros.hpp" + +TCL_Advancing_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Advancing Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Advancing + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_object","_weapon","_muzzle"]; + + private _return = 0; + + private _array = ["Throw","Put"]; + + if (_weapon in _array) exitWith {_return}; + + private _type = {_weapon isKindOf [_this, configFile >> "CfgWeapons"] }; + + if ( ("Pistol" call _type) || ("Rifle" call _type) ) then + { + private _muzzle = (currentMuzzle _object); + + if (_weapon isEqualTo _muzzle) then + { + private _accessories = (_object weaponAccessories _muzzle); + + private _suppressor = (_accessories select 0); + + _return = (TCL_Feature select 24); + + if (_suppressor isEqualTo "") then + { + _return = (TCL_Feature select 26); + }; + } + else + { + _return = (TCL_Feature select 24); + }; + } + else + { + if ("Launcher" call _type) then + { + _return = (TCL_Feature select 25); + } + else + { + _return = (TCL_Feature select 26); + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Advancing Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Advancing + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_object","_group","_value"]; + + private _leader = (leader _group); + + private _distance = (_object distance _leader); + + if (_distance < _value) then + { + [_object, _group, _distance] spawn (TCL_Advancing_F select 2); + + // player sideChat format ["TCL_Advancing_F > Group > %1", _group]; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Advancing Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Advancing + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_object","_group","_distance"]; + + private _units = (units _group); + + private _array = ( (TCL_Hold select 0) + (TCL_Defend select 0) + (TCL_Freeze select 0) + (TCL_Default select 0) + (TCL_Garrison select 0) ); + + if (_group in (TCL_Garrison select 0) ) then + { + _units = _units select { ( (isNull objectParent _x) && { (currentCommand _x isEqualTo "") } ) }; + + if (_units isEqualTo [] ) exitWith {}; + + _array deleteAt (_array find _group); + + // player sideChat format ["TCL_Advancing_F > Garrison > %1", _units]; + }; + + if (_group in _array) then + { + [_object, _group, _distance] spawn (TCL_Advancing_F select 3); + } + else + { + if ( (floor (random 100) < 35) && { (_distance > 100) } && { (_group knowsAbout vehicle _object == 0) } ) then + { + private _leader = (leader _group); + + private _behaviour = (behaviour _leader); + private _speedMode = (speedMode _leader); + + _units select { ( (_x == _leader) || (floor (random 100) < 50) ) } apply {_x doWatch (getPos _object) }; + + if (_distance > 300) then + { + if (_leader hasWeapon "Binocular") then {_leader selectWeapon "Binocular"}; + }; + + sleep 5 + (random 10); + + if (currentWeapon _leader isEqualTo "Binocular") then + { + _leader selectWeapon (primaryWeapon _leader); + }; + + if (_group knowsAbout vehicle _object == 0) then + { + _group setBehaviour "AWARE"; + _group setSpeedMode "NORMAL"; + + if (floor (random 100) < 50) then + { + _group setSpeedMode "FULL"; + }; + + (TCL_Advancing select 0) pushBack _group; + + _group lockWp True; + + private _value = 50; + + if (alive _object) then + { + _value = 30; + }; + + private _position = [ (getPos _object select 0) + (random _value - random _value), (getPos _object select 1) + (random _value - random _value), 0]; + + if (_group in (TCL_Garrison select 0) ) then + { + _units doMove _position; + } + else + { + _group move _position; + + _units doFollow _leader; + }; + + private _bool = True; + + private _count = (random 50); + + while { (_count > 0) } do + { + if ( (_group in (TCL_Reinforcement select 0) ) || ( (alive _object) && { (_group knowsAbout vehicle _object > 0) } ) ) exitWith + { + _bool = False; + }; + + _count = _count - 1; + + sleep 1; + }; + + TCL_DeleteAT(TCL_Advancing,0,_group); + + if (_group in (TCL_Garrison select 0) ) then + { + {_x doMove (getPos _x) } count _units; + + sleep 10 + (random 30); + }; + + _group move (getPos _leader); + }; + + sleep 10 + (random 30); + + if (_group in (TCL_Reinforcement select 0) ) then + { + _bool = False; + } + else + { + _group lockWp False; + + _group setBehaviour _behaviour; + _group setSpeedMode _speedMode; + + if (count waypoints _group == 1) then + { + private _position = (_group getVariable "TCL_Position"); + + private _value = 50; + + if ( (alive _object) && { (_group knowsAbout vehicle _object > 0) } && { (side _group getFriend side _object > 0.6) } )then + { + private _random = (random 50); + + _value = (_value + _random); + }; + + if (floor (random 100) < _value) then + { + _group move _position; + }; + }; + }; + } + else + { + [_object, _group, _distance] spawn (TCL_Advancing_F select 3); + }; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Advancing Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Advancing + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_object","_group","_distance"]; + + sleep (random 1); + + private _array = []; + + private _units = (units _group); + + private _leader = (leader _group); + + {if ( (floor (random 100) < 5) && { (alive _object) } ) then {_x setUnitPos "DOWN"} else {if (floor (random 100) < 35) then {_x setUnitPos "MIDDLE"} } } count _units; + + _units select { ( (_x == _leader) || (floor (random 100) < 50) ) } apply {_x doWatch (getPos _object); _array pushBack _x}; + + // {if ( (floor (random 100) < 50) || (_x == _leader) ) then {_x doWatch (getPos _object); _array pushBack _x} } forEach _units; + + (TCL_Watch select 0) append _array; + + if (_distance > 300) then + { + if (_leader hasWeapon "Binocular") then {_leader selectWeapon "Binocular"}; + }; + + sleep (random 30); + + if (currentWeapon _leader isEqualTo "Binocular") then + { + _leader selectWeapon (primaryWeapon _leader); + }; + + TCL_Watch set [0, (TCL_Watch select 0) - _array]; + + if (_group in (TCL_Suppressed select 0) ) then {_group = _group} else { {_x setUnitPos "AUTO"} count _units}; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Artillery_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Artillery_F.sqf new file mode 100644 index 0000000..1912721 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Artillery_F.sqf @@ -0,0 +1,236 @@ +#include "TCL_Macros.hpp" + +TCL_Artillery_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + if (TCL_Feature select 9) then + { + if (floor (random 100) < (TCL_Feature select 10) ) then + { + private _condition = (_logic getVariable "TCL_Artillery"); + + if (_condition select 0) then + { + private _leader = (leader _group); + + private _position = (getPos _logic); + + private _groups = (TCL_Artillery select 0); + + _groups = _groups select { ( (side _x getFriend side _group > 0.6) && { (_x getVariable "TCL_Artillery") } ) }; + + if (_groups isEqualTo [] ) exitWith {}; + + private ["_vehicle","_distance","_bool"]; + + {_vehicle = (vehicle leader _x); + + _distance = [_x, _group] call (TCL_Radio_F select 0); + + _bool = [_vehicle, _position] call (TCL_Artillery_F select 2); + + if ( (_bool) && { (_distance) } ) exitWith + { + _condition set [0, False]; + + _x setVariable ["TCL_Artillery", False]; + + [_enemy, _x, _logic, _vehicle] spawn (TCL_Artillery_F select 1); + }; + + } count _groups; + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic","_vehicle"]; + + private _value = [_enemy, _group, _logic] call (TCL_KnowsAbout_F select 3); + + sleep _value; + + sleep 10 + (random 30); + + if (alive _logic) then + { + private _condition = (_logic getVariable "TCL_Artillery"); + + _condition set [1, True]; + + private _units = (units _group); + + _units = _units select { ( (canFire vehicle _x) && { (_x == gunner vehicle _x) } ) }; + + if (_units isEqualTo [] ) exitWith + { + _condition set [1, False]; + + sleep 30 + (random 50); + + _condition set [0, True]; + }; + + private _time = 0; + + private _value = (count _units); + + private _rounds = 7 + (random 10); + + _rounds = (_rounds / _value); + + private ["_unit","_vehicle","_position","_bool","_magazine"]; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + _vehicle = (vehicle _unit); + + _position = [ (getPos _logic select 0) + (random 70 - random 70), (getPos _logic select 1) + (random 70 - random 70), 0]; + + // _position = [ (getPos _logic select 0) + (random 100 - random 100), (getPos _logic select 1) + (random 100 - random 100), 0]; + + _bool = [_vehicle, _position] call (TCL_Artillery_F select 2); + + if (_bool) then + { + _magazine = (getArtilleryAmmo [_vehicle] select 0); + + _time = _vehicle getArtilleryETA [_position, _magazine]; + + _vehicle doArtilleryFire [_position, _magazine, _rounds]; + + sleep (random 3); + }; + }; + + if (_time > 0) then + { + while { (currentcommand _vehicle isEqualTo "FIRE AT POSITION") } do + { + sleep 5; + }; + + sleep _time; + + if (alive _logic) then + { + _condition set [1, False]; + + sleep 170 + (random 150); + }; + } + else + { + _condition set [1, False]; + + sleep 70 + (random 50); + }; + + if (alive _logic) then + { + _condition set [0, True]; + }; + + _group setVariable ["TCL_Artillery", True]; + + // player sideChat format ["TCL_Artillery_F > Artillery > %1", (_logic getVariable "TCL_Artillery") ]; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle","_position"]; + + private _return = False; + + private _gunner = (gunner _vehicle); + + if ( (canFire _vehicle) && { (alive _gunner) } ) then + { + if (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") then + { + private _magazine = (getArtilleryAmmo [_vehicle] select 0); + + private _range = _position inRangeOfArtillery [crew _vehicle, _magazine]; + + if (_range) then + { + _return = [_vehicle, _position] call (TCL_Artillery_F select 3); + }; + }; + }; + + // player sideChat format ["TCL_Artillery_F > Artillery > %1 > %2", _vehicle, _return]; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle","_position"]; + + private _return = True; + + private _distance = 100; + + if (_vehicle isKindOf "Tank") then + { + private _random = (random 100); + + _distance = (_distance + _random); + }; + + private _objects = _position nearEntities [ ["CAManBase","Car","Tank","Helicopter"], _distance]; + + if (_objects isEqualTo [] ) exitWith {_return}; + + private "_object"; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _object = (_objects select _count); + + if ( (alive _object) && { (side _object getFriend side _vehicle > 0.6) } ) exitWith + { + _return = False; + + // player sideChat format ["TCL_Artillery_F > Artillery > %1 > %2", _object, _vehicle]; + }; + }; + + _return + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Feature_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Feature_F.sqf new file mode 100644 index 0000000..73947c0 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Feature_F.sqf @@ -0,0 +1,138 @@ +TCL_Feature_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Feature Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Feature + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_units"]; + + _units = _units - ( (TCL_Heal select 1) + (TCL_Rearm select 1) ); + + private "_unit"; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + if (TCL_Feature select 30) then + { + if (floor (random 100) < (TCL_Feature select 31) ) then + { + [_unit, _group] call (TCL_Heal_F select 0); + }; + }; + + if (TCL_Feature select 32) then + { + if (floor (random 100) < (TCL_Feature select 33) ) then + { + if (_unit in (TCL_Heal select 0) ) exitWith {}; + + [_unit, _group] call (TCL_Rearm_F select 0); + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Feature Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Feature + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic","_array","_knowsAbout"]; + + if (_knowsAbout > 0) then + { + private _units = (units _group); + + // if (_array isEqualTo _units) exitWith {}; + + _array = [_enemy, _units, _group, _logic, _array] call TCL_Visible_F; + + // player sideChat format ["TCL_Feature_F > Visible > %1", _array]; + }; + + if (_array isEqualTo [] ) then + { + if (TCL_Feature select 11) then + { + if (floor (random 100) < (TCL_Feature select 12) ) then + { + private _leader = (leader _group); + + if (_leader distance _logic < 100) then + { + [_enemy, _group, _logic] call (TCL_House_Search_F select 0); + + // player sideChat format ["TCL_Feature_F > House Search > %1", _group]; + }; + }; + }; + } + else + { + if (_knowsAbout > 0) then + { + if (TCL_Feature select 13) then + { + if (floor (random 100) < (TCL_Feature select 14) ) then + { + [_enemy, _group, _logic] call (TCL_Static_Weapon_F select 0); + + // player sideChat format ["TCL_Feture_F > Static Weapon > %1 > %2", _group]; + }; + }; + + if (TCL_Feature select 15) then + { + [_enemy, _group, _array] call (TCL_Take_Cover_F select 0); + + // player sideChat format ["TCL_Feture_F > Take Cover > %1 > %2", _group, (count _array) ]; + }; + }; + }; + + _array + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Feature Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Feature + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_object","_array","_distance"]; + + private _groups = (TCL_Groups select 0); + + _groups = _groups - _array; + + private ["_group","_leader"]; + + private _count = 0; + + for "_count" from _count to (count _groups - 1) do + { + _group = (_groups select _count); + + _leader = (leader _group); + + if (isNull objectParent _leader) then + { + [_object, _group, _distance] call (TCL_Advancing_F select 1); + }; + }; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Flanking_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Flanking_F.sqf new file mode 100644 index 0000000..8bd4b1f --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Flanking_F.sqf @@ -0,0 +1,171 @@ +#include "TCL_Macros.hpp" + +TCL_Flanking_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Flanking Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Flanking + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _units = (units _group); + + if ( { (alive _x) } count _units > 3) then + { + private _array = []; + + private _random = 3 - (random 1); + + private _value = (count _units / 2); + + // _value = (count _units / _random); + + if (floor (random 100) < (TCL_Feature select 20) ) then + { + (TCL_Flanking select 0) pushBack _group; + + // player sideChat format ["TCL_System > Flanking In > %1", _group]; + }; + + private "_unit"; + + private _count = (count _units - 1); + + while { (_count > _value) } do + { + _unit = (_units select _count); + + _array pushBack _unit; + + _count = _count - 1; + }; + + (TCL_Flanking select 1) append _array; + + if (floor (random 100) < (TCL_Feature select 21) ) then + { + // player sideChat format ["TCL_Flanking_F > Flanking #1 > %1 > %2", _group, _array]; + } + else + { + _units = _units - _array; + + private _leader = (leader _group); + + _units deleteAt (_units find _leader); + + private _unit = (_units select 0); + + _units deleteAt (_units find _unit); + + (TCL_Flanking select 2) append _units; + + // player sideChat format ["TCL_Flanking_F > Flanking #3 > %1 > %2 > %3", _group, _units, _array]; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Flanking Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Flanking + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_enemy","_position","_distance"]; + + private _value = 30; + + private _bool = True; + + private _random = (random 50); + + _value = (_value + _random); + + private _direction = (_unit getDir _enemy); + + if (_unit in (TCL_Flanking select 1) ) then + { + if (_group in (TCL_Flanking select 3) ) exitWith + { + _direction = (_direction + _value); + }; + + _direction = (_direction - _value); + } + else + { + if (_unit in (TCL_Flanking select 2) ) exitWith + { + if (_group in (TCL_Flanking select 3) ) exitWith + { + _direction = (_direction - _value); + }; + + _direction = (_direction + _value); + }; + + _bool = False; + }; + + if (_bool) then + { + _position = [_unit, _distance, _direction] call TCL_Real_Pos_F; + + if (TCL_Debug select 6) then + { + [_position] spawn (TCL_Flanking_F select 2); + }; + + // player sideChat format ["TCL_Take_Cover_F > Direction > %1 > %2", _unit, _direction]; + }; + + _position + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Flanking Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Flanking + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_position"]; + + private _spot = createVehicle ["Sign_Arrow_Large_Yellow_F", _position, [], 0, "CAN_COLLIDE"]; + + sleep 5; + + deleteVehicle _spot; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Flanking Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Flanking + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + if (_group in (TCL_Flanking select 0) ) then + { + TCL_DeleteAT(TCL_Flanking,0,_group); + + // player sideChat format ["TCL_System > Flanking Out > %1", _group]; + } + else + { + (TCL_Flanking select 0) pushBack _group; + + // player sideChat format ["TCL_System > Flanking In > %1", _group]; + }; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Flare_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Flare_F.sqf new file mode 100644 index 0000000..b96d06b --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Flare_F.sqf @@ -0,0 +1,106 @@ +#include "TCL_Macros.hpp" + +TCL_Flare_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Flare Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Flare + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + if (TCL_Feature select 7) then + { + private _units = (units _group); + + if (_group in (TCL_Flare select 0) ) exitWith {}; + + if ( (floor (random 100) < (TCL_Feature select 8) ) || ( { (_units findIf { ( (alive _x) && (hmd _x isEqualTo "") ) } > -1) } ) ) then + { + private ["_unit","_muzzles"]; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + _muzzles = getArray (configFile >> "CfgWeapons" >> (primaryWeapon _unit) >> "muzzles"); + + if ( (alive _unit) && (count _muzzles == 2) ) exitWith + { + (TCL_Flare select 0) pushBack _group; + + private _magazines = []; + + private _magazine = (magazines _unit select 0); + + _magazines pushBack _magazine; + + _unit removeMagazine _magazine; + + private _array = ["1Rnd_HE_Grenade_shell","3Rnd_HE_Grenade_shell"]; + + {if ( (_x in _array) || (currentMagazine _unit in _array) ) then {_magazines pushBack _x; _unit removeMagazine _x} } forEach magazines _unit; + + private _muzzle = (_muzzles select 1); + + private _flare = "UGL_FlareWhite_F"; + + sleep 5 + (random 15); + + private ["_direction","_random","_range","_distance"]; + + private _count = 3 + (random 5); + + while { ( (alive _unit) && { (alive _logic) } && { (_count > 0) } ) } do + { + if (_unit distance _logic < 300) then + { + if (floor (random 100) < (TCL_Feature select 8) ) then + { + _direction = (_unit getDir _enemy); + + _random = 30 - (random 50); + + _range = (_direction + _random); + + _distance = 130 + (random 50); + + if (_unit distance _logic < _distance) then + { + _distance = (_unit distance _logic); + + _distance = (_distance + _random); + }; + + _flare = "F_40mm_White" createVehicle [ (getPos _unit select 0) + (_distance * sin _range), (getPos _unit select 1) + (_distance * cos _range), 70 + (random 70) ]; + + _flare setVelocity [0,0,-0.3]; + + _count = _count - 1; + }; + + sleep 30 + (random 50); + } + else + { + sleep 10; + }; + }; + + if (alive _unit) then { {_unit addMagazine _x} forEach _magazines}; + + private _value = 70 + (random 50); + + sleep _value; + + TCL_DeleteAT(TCL_Flare,0,_group); + }; + }; + }; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Follow_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Follow_F.sqf new file mode 100644 index 0000000..2918b4e --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Follow_F.sqf @@ -0,0 +1,22 @@ +TCL_Follow_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Follow Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Follow + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group"]; + + private _leader = (leader _group); + + private _array = ( (TCL_Heal select 0) + (TCL_Rearm select 0) + (TCL_Take_Cover select 0) + (TCL_House_Search select 0) ); + + if (_unit in _array) exitWith {True}; + + // _unit doFollow _leader; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Garrison_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Garrison_F.sqf new file mode 100644 index 0000000..afeb295 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Garrison_F.sqf @@ -0,0 +1,238 @@ +#include "TCL_Macros.hpp" + +TCL_Garrison_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Garrison Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Garrison + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _time = 5 - (random 3); + + if (_group in (TCL_Garrison select 0) ) then + { + _time = 0; + }; + + sleep _time; + + private _units = (units _group); + + if (_group in (TCL_Freeze select 0) ) exitWith {}; + + if (_units findIf { (alive _x) } > -1) then + { + + if (TCL_Feature select 2) then + { + private _leader = (leader _group); + + if (isNull objectParent _leader) then + { + if (count (waypoints _group) == 1) then + { + if (_group in (TCL_Reinforcement select 0) ) exitWith {}; + + private _array = [_group] call (TCL_Garrison_F select 1); + + if (_array isEqualTo [] ) exitWith {}; + + private _building = (_array select 0); + + private _bool = True; + + if (_group in (TCL_Hold select 0) ) then + { + _bool = [_group, _building] call TCL_Trigger_F; + }; + + if ( (_bool) && { (damage _building < 1) } ) then + { + _array deleteAt (_array find _building); + + if (_group in (TCL_Garrison select 0) ) then + { + private _buildings = (_group getVariable "TCL_Garrison"); + + _buildings pushBack _building; + } + else + { + (TCL_Garrison select 0) pushBack _group; + + (TCL_Garrison select 2) pushBack _group; + + _group setVariable ["TCL_Garrison", [_building] ]; + }; + + (TCL_Garrison select 1) pushBack _building; + + // player sideChat format ["TCL_Garrison_F > Group > %1", _group]; + + [_group, _array] call (TCL_Garrison_F select 2); + + // player sideChat format ["TCL_Garrison_F > Building > %1 > %2", _building, (count _array) ]; + }; + }; + }; + }; + + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Garrison Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Garrison + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _return = []; + + private _distance = 100; + + if (_group in (TCL_Garrison select 0) ) then + { + // _distance = 50; + }; + + private _leader = (leader _group); + + private _objects = nearestObjects [_leader, ["House"], _distance]; + + _objects = _objects - (TCL_Garrison select 1); + + if (_objects isEqualTo [] ) exitWith {_return}; + + private ["_building","_index","_position"]; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _building = (_objects select _count); + + _index = [_building] call TCL_Building_Pos_F; + + if ( (_index == 2) && { ( [0,1,2] findIf { (_building buildingPos _x select 2 > 5) } > -1) } ) exitWith + { + _return = [_building]; + + _position = (_building buildingPos _index); + + _return pushBack _position; + + [_group] spawn (TCL_Garrison_F select 0); + }; + + if (_index > 3) exitWith + { + _return = [_building]; + + while { (_index > 0) } do + { + _position = (_building buildingPos _index); + + if (_return findIf { (_position distance _x > 5) } > -1) then + { + _return pushBack _position; + }; + + _index = _index - 1; + }; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Garrison Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Garrison + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_array"]; + + private _units = (units _group); + + _array = _array call TCL_Shuffle_F; + + _units = _units - (TCL_Garrison select 3); + + _units = _units select { ( (alive _x) && { (isNull objectParent _x) } ) }; + + if (count _units > count _array) then + { + [_group] spawn (TCL_Garrison_F select 0); + }; + + private ["_unit","_position"]; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + if (_array isEqualTo [] ) exitWith {}; + + (TCL_Garrison select 3) pushBack _unit; + + _position = (_array select 0); + + _unit doMove _position; + + [_unit, _group, _position] spawn (TCL_Garrison_F select 3); + + _array deleteAt (_array find _position); + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Garrison Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Garrison + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_position"]; + + private _time = (time + 30); + + private _distance = (_unit distance _position); + + _time = (_time + _distance); + + while { ( (alive _unit) && { (time < _time) } ) } do + { + if ( (unitReady _unit) || (count (waypoints _group) > 1) ) exitWith + { + if (_group in (TCL_Reinforcement select 0) ) then + { + _time = time; + }; + }; + + sleep 5; + }; + + if ( (alive _unit) && { (time < _time) } ) then + { + if ( (_unit distance _position > 3) || (count (waypoints _group) > 1) ) exitWith {}; + + doStop _unit; + }; + + TCL_DeleteAT(TCL_Garrison,3,_unit); + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Heal_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Heal_F.sqf new file mode 100644 index 0000000..15e68e9 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Heal_F.sqf @@ -0,0 +1,256 @@ +#include "TCL_Macros.hpp" + +TCL_Heal_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Heal Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Heal + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group"]; + + private _damage = (_unit getHitPointDamage "hitlegs"); + + if ( (_damage > 0.5) || (damage _unit > 0.5) ) then + { + private _items = (items _unit); + + if ("FirstAidKit" in _items) then + { + (TCL_Heal select 1) pushBack _unit; + + _unit action ["HealSoldierSelf", _unit]; + + [_unit, _group] spawn (TCL_Heal_F select 2); + + // player sideChat format ["TCL_Heal_F > Heal > %1 > %2", _unit, (damage _unit) ]; + } + else + { + private _units = (units _group); + + _units = _units - (TCL_Heal select 1); + + _units = _units select {_items = (items _x); ( (alive _x) && { (isNull objectParent _x) } && { ("Medikit" in _items) } ) }; + + if (_units isEqualTo [] ) exitWith + { + [_unit, _group] call (TCL_Heal_F select 1); + }; + + private _object = (_units select 0); + + private _array = [_unit, _object]; + + (TCL_Heal select 0) append _array; + + (TCL_Heal select 1) append _array; + + [_unit, _group, _object] spawn (TCL_Heal_F select 2); + + // player sideChat format ["TCL_Heal_F > Medic > %1 > %2", _unit, _object]; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Heal Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Heal + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group"]; + + if (alive _unit) then + { + private _objects = nearestObjects [_unit, ["CAManBase"], 100]; + + _objects = _objects - (TCL_Heal select 2); + + private _array = _objects select { (alive _x) }; + + _objects = _objects - _array; + + if (_objects isEqualTo [] ) exitWith {}; + + private _object = (_objects select 0); + + (TCL_Heal select 2) pushBack _object; + + private _items = (items _object); + + _items = _items select { ( (_x isEqualTo "Medikit") || (_x isEqualTo "FirstAidKit") ) }; + + if (_items isEqualTo [] ) exitWith {}; + + (TCL_Heal select 0) pushBack _unit; + + (TCL_Heal select 1) pushBack _unit; + + private _item = (_items select 0); + + [_unit, _group, _object, _item] spawn (TCL_Heal_F select 2); + + // player sideChat format ["TCL_Heal_F > Medikit > %1 > %2", _unit, _object]; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Heal Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Heal + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group"]; + + if (alive _unit) then + { + if (count _this == 2) then + { + sleep 30 + (random 50); + + TCL_DeleteAT(TCL_Heal,1,_unit); + } + else + { + private _object = (_this select 2); + + if (count _this == 3) then + { + if (_unit distance _object < 100) then + { + [_unit, _group, _object] spawn (TCL_Heal_F select 3); + } + else + { + TCL_DeleteAT(TCL_Heal,0,_unit); + + TCL_DeleteAT(TCL_Heal,0,_object); + + sleep 10 + (random 30); + + TCL_DeleteAT(TCL_Heal,1,_unit); + + TCL_DeleteAT(TCL_Heal,1,_object); + }; + } + else + { + private _item = (_this select 3); + + _unit forceSpeed -1; + + private _bool = True; + + private _time = (time + 10); + + _unit doMove (getPos _object); + + private _distance = (_unit distance _object); + + _time = (_time + _distance); + + while { ( (alive _unit) && { (time < _time) } ) } do + { + if (_unit distance _object < 1) exitWith + { + _bool = False; + + _unit addItem _item; + + _object removeItem _item; + + _unit action ["HealSoldierSelf", _unit]; + + TCL_DeleteAT(TCL_Heal,2,_object); + }; + + sleep 1; + }; + + if (_bool) then + { + TCL_DeleteAT(TCL_Heal,2,_object); + }; + + TCL_DeleteAT(TCL_Heal,0,_unit); + + sleep 30 + (random 50); + + TCL_DeleteAT(TCL_Heal,1,_unit); + }; + }; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Heal Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Heal + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_object"]; + + if (alive _unit) then + { + _unit setUnitPos "MIDDLE"; + + _unit forceSpeed 0; + + _object forceSpeed -1; + + _object doMove (getPos _unit); + + private _time = (time + 10); + + private _distance = (_unit distance _object); + + _time = (_time + _distance); + + while { ( (alive _unit) && { (alive _object) } && { (time < _time) } ) } do + { + if (_object distance _unit < 3) exitWith + { + _unit doWatch _object; + + _object doWatch _unit; + + _object action ["HealSoldier", _unit]; + + sleep 5; + + _unit doWatch objNull; + + _object doWatch objNull; + }; + + sleep 1; + }; + + _unit forceSpeed -1; + + _unit setUnitPos "AUTO"; + }; + + TCL_DeleteAT(TCL_Heal,0,_unit); + + TCL_DeleteAT(TCL_Heal,0,_object); + + [_object, _group] call (TCL_Follow_F select 0); + + sleep 30 + (random 50); + + TCL_DeleteAT(TCL_Heal,1,_unit); + + TCL_DeleteAT(TCL_Heal,1,_object); + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_House_Search_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_House_Search_F.sqf new file mode 100644 index 0000000..f587f4d --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_House_Search_F.sqf @@ -0,0 +1,202 @@ +#include "TCL_Macros.hpp" + +TCL_House_Search_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // House Search Function #0 + // //////////////////////////////////////////////////////////////////////////// + // House Search + // Script by =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + private _units = (units _group); + + private _array = ( (TCL_House_Search select 0) + (TCL_Static_Weapon select 0) ); + + _units = _units - _array; + + private _leader = (leader _group); + + _units deleteAt (_units find _leader); + + _units = _units select { ( (alive _x) && { (isNull objectParent _x) } ) }; + + if (count _units > 1) then + { + private _unit = _units select (count _units - 1); + + private _objects = nearestObjects [_logic, ["House"], 100]; + + _objects = _objects - (TCL_House_Search select 1); + + if (_objects isEqualTo [] ) exitWith {}; + + private _object = (_objects select 0); + + if (_unit distance _object < 100) then + { + [_unit, _group, _logic, _objects] call (TCL_House_Search_F select 1); + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // House Search Function #1 + // //////////////////////////////////////////////////////////////////////////// + // House Search + // Script by =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_logic","_objects"]; + + private ["_building","_positions"]; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _building = (_objects select _count); + + _positions = [_building] call TCL_Building_Pos_F; + + // player sideChat format ["TCL_House_Search_F > Positions > %1", _positions]; + + if (_positions > 1) exitWith + { + [_unit, _group, _logic, _building, _positions] spawn (TCL_House_Search_F select 2); + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // House Search Function #2 + // //////////////////////////////////////////////////////////////////////////// + // House Search + // Script by =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_logic","_building","_positions"]; + + (TCL_House_Search select 0) pushBack _unit; + + (TCL_House_Search select 1) pushBack _building; + + if (alive _unit) then + { + private ["_position","_distance","_time"]; + + while { ( (alive _unit) && { (alive _logic) } && { (_positions > 0) } && { (_unit distance _building < 100) } ) } do + { + // player sideChat format ["TCL_House_Search_F > Positions > %1", _positions]; + + _position = (_building buildingPos _positions); + + _distance = (_unit distance _position); + + if (_distance > 3) then + { + _unit doMove _position; + + _time = (time + 10); + + _time = (_time + _distance); + + while { ( (alive _unit) && { (alive _logic) } && { (time < _time) } && { (_unit distance _building < 100) } ) } do + { + if (unitReady _unit) exitWith + { + // doStop _unit; + + sleep (random 5); + + // player sideChat format ["TCL_House_Search_F > Unit > %1", _unit]; + }; + + if (_unit distance _logic > 100) exitWith + { + _positions = 0; + + // player sideChat format ["TCL_House_Search_F > Distance > %1", _unit]; + }; + + sleep 5; + }; + }; + + _positions = _positions - 1; + }; + + // private _leader = (leader _group); + + // _unit doMove (getPos _leader); + + // _unit doFollow _leader; + }; + + TCL_DeleteAT(TCL_House_Search,0,_unit); + + [_unit, _group] call (TCL_Follow_F select 0); + + if (False) then + { + [_unit, _group, _logic, _building] spawn (TCL_House_Search_F select 3); + }; + + sleep 30 + (random 50); + + if (alive _unit) then + { + TCL_DeleteAT(TCL_House_Search,1,_building); + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // House Search Function #3 + // //////////////////////////////////////////////////////////////////////////// + // House Search + // Script by =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_logic","_building"]; + + private _bool = True; + + private _time = (time + 30); + + private _position = (getPos _unit); + + private _boundingBox = (boundingBox _building); + + private _value = (_boundingBox select 1 select 0); + + if (_value < (_boundingBox select 1 select 1) ) then + { + _value = (_boundingBox select 1 select 1); + }; + + _value = (_value / 2); + + while { ( (alive _unit) && { (_bool) } ) } do + { + if (time > _time) then + { + if (_unit distance _building > _value) then + { + _bool = False; + } + else + { + _unit setDamage 1; + }; + }; + + sleep 5; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Macros.hpp b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Macros.hpp new file mode 100644 index 0000000..1c6db5e --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Macros.hpp @@ -0,0 +1,10 @@ +/* //////////////////////////////////////////////////////////////////////////////// +\ \ Tactical Combat Link + \ \------------------------------------------------------------------------------ + \ \ Macros + \ \---------------------------------------------------------------------------- + / / By =\SNKMAN/= + / /----------------------------------------------------------------------------- +*/ /////////////////////////////////////////////////////////////////////////////// +#define TCL_ObjectParent(_unit); isNull objectParent _unit; +#define TCL_DeleteAT(_array, _index, _object); (_array select _index) deleteAt ( (_array select _index) find _object); \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Mortar_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Mortar_F.sqf new file mode 100644 index 0000000..deae47a --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Mortar_F.sqf @@ -0,0 +1,63 @@ +#include "TCL_Macros.hpp" + +TCL_Mortar_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Mortar Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Mortar + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_vehicle"]; + + if (_group in (TCL_Reinforcement select 0) ) then + { + private _enemy = (_group getVariable "TCL_Enemy"); + + if ( (alive _enemy) && { (_group knowsAbout vehicle _enemy > 0) } ) then + { + sleep 5 + (random 10); + + private _leader = (leader _group); + + (TCL_Static_Weapon select 2) pushBack _vehicle; + + private _logic = (_group getVariable "TCL_Logic"); + + private _position = [ (getPos _logic select 0) + (random 50 - random 50), (getPos _logic select 1) + (random 50 - random 50), 0]; + + private _bool = [_vehicle, _position] call (TCL_Artillery_F select 2); + + if (_bool) then + { + private _condition = (_logic getVariable "TCL_Artillery"); + + _condition set [1, True]; + + private _rounds = 1 + (random 3); + + private _magazine = (getArtilleryAmmo [_vehicle] select 0); + + _time = _vehicle getArtilleryETA [_position, _magazine]; + + _vehicle doArtilleryFire [_position, _magazine, _rounds]; + + sleep _time; + + _condition set [1, False]; + + sleep (_time * _rounds); + } + else + { + [_unit, _group, _vehicle] call (TCL_Static_Weapon_F select 4); + + sleep 30 + (random 50); + }; + + TCL_DeleteAT(TCL_Static_Weapon,2,_vehicle); + }; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Rearm_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Rearm_F.sqf new file mode 100644 index 0000000..a7703f8 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Rearm_F.sqf @@ -0,0 +1,437 @@ +#include "TCL_Macros.hpp" + +TCL_Rearm_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group"]; + + private ["_ammo","_count","_magazine","_magazines","_array"]; + + private _weapon = (primaryWeapon _unit); + + if (_weapon isEqualTo "") then + { + _ammo = 0; + + _count = 0; + + _magazine = ""; + + _magazines = []; + } + else + { + _magazines = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines"); + + _magazine = (_magazines select 0); + + _array = []; + + _array = (magazines _unit) select { (_x in _magazines) }; + + _count = (count _array); + + _ammo = (_unit ammo _weapon); + }; + + if ( (_count < 3) && { (_ammo < 50) } ) then + { + [_unit, _group, _magazine, _magazines] call (TCL_Rearm_F select 1); + + // player sideChat format ["TCL_Rearm_F > Magazine > %1 > %2 > %3 > %4", _unit, _ammo, _count, _magazine]; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_magazine","_magazines"]; + + if (alive _unit) then + { + private _objects = nearestObjects [_unit, ["CAManBase"], 100]; + + _objects = _objects - (TCL_Rearm select 2); + + private _array = []; + + _array = _objects select { ( (alive _x) || (_unit knowsAbout _x == 0) ) }; + + _objects = _objects - _array; + + if (_objects isEqualTo [] ) exitWith + { + _objects = nearestObjects [_unit, ["LandVehicle"], 100]; + + _objects = _objects - (TCL_Rearm select 2); + + _objects = _objects select { ( (alive _x) && { (crew _x isEqualTo [] ) } ) }; + + if (_objects isEqualTo [] ) exitWith {}; + + private _object = (_objects select 0); + + _array = (magazineCargo _object); + + if (_array isEqualTo [] ) exitWith {}; + + if (_magazine in _array) then + { + (TCL_Rearm select 0) pushBack _unit; + + // (TCL_Rearm select 1) pushBack _unit; + + (TCL_Rearm select 2) pushBack _object; + + _array = _array select { (_x in _magazines) }; + + [_unit, _group, _object, _array] spawn (TCL_Rearm_F select 3); + + // player sideChat format ["TCL_Rearm_F > Vehicle > %1 > %2", _unit, _object]; + }; + }; + + private _object = (_objects select 0); + + private _bool = [_unit, _group, _objects, _magazine, _magazines] call (TCL_Rearm_F select 2); + + if (_bool) then + { + _objects = nearestObjects [_object, ["WeaponHolderSimulated"], 5]; + + _objects = _objects - (TCL_Rearm select 2); + + if (_objects isEqualTo [] ) exitWith {}; + + private _dummy = (_objects select 0); + + private _weapons = (weaponCargo _dummy); + + private _weapon = (_weapons select 0); + + (TCL_Rearm select 0) pushBack _unit; + + // (TCL_Rearm select 1) pushBack _unit; + + (TCL_Rearm select 2) pushBack _object; + + // _array = [_object, _dummy]; + + // (TCL_Rearm select 2) append _array; + + [_unit, _group, _object, _dummy, _weapon] spawn (TCL_Rearm_F select 3); + + // player sideChat format ["TCL_Rearm_F > Weapon > %1 > %2", _unit, _object]; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_objects","_magazine","_magazines"]; + + private _return = True; + + if (_magazine isEqualTo "") exitWith {_return}; + + private ["_object","_array"]; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _object = (_objects select _count); + + _array = (magazines _object); + + if (_magazine in _array) exitWith + { + _return = False; + + (TCL_Rearm select 0) pushBack _unit; + + // (TCL_Rearm select 1) pushBack _unit; + + (TCL_Rearm select 2) pushBack _object; + + _array = _array select { (_x in _magazines) }; + + [_unit, _group, _object, _array] spawn (TCL_Rearm_F select 3); + + // player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _object]; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_object"]; + + private _bool = True; + + private _time = (time + 10); + + private _position = (getPos _object); + + private _boundingBox = (boundingBox _object select 1 select 1); + + _boundingBox = (_boundingBox - 1); + + if (_boundingBox < 1) then + { + _boundingBox = (_boundingBox + 1); + }; + + _position set [1, (_position select 1) - _boundingBox]; + + _unit forceSpeed -1; + + _unit doMove _position; + + // (TCL_Rearm select 0) pushBack _unit; + + (TCL_Rearm select 1) pushBack _unit; + + // (TCL_Rearm select 2) pushBack _object; + + private _distance = (_unit distance _object); + + // player sideChat format ["TCL_Rearm_F > BoundingBox > %1 > %2 > %3", _unit, _object, _boundingBox]; + + _time = (_time + _distance); + + while { ( (alive _unit) && { (time < _time) } ) } do + { + if (_unit distance _position < _boundingBox) exitWith + { + _bool = False; + + _unit forceSpeed 0; + + _unit doWatch _object; + + _unit setUnitPos "MIDDLE"; + + sleep 1; + + if (count _this == 4) then + { + private _magazines = (_this select 3); + + [_unit, _group, _object, _magazines] spawn (TCL_Rearm_F select 4); + } + else + { + private _dummy = (_this select 3); + + private _weapon = (_this select 4); + + [_unit, _group, _object, _dummy, _weapon] spawn (TCL_Rearm_F select 5); + }; + }; + + sleep 1; + }; + + if (_bool) then + { + [_unit, _group, _object, _bool] spawn (TCL_Rearm_F select 6); + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #4 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_object","_magazines"]; + + if (alive _unit) then + { + private _bool = False; + + private _magazine = (_magazines select 0); + + _unit action ["TakeMagazine", _object, _magazine]; + + _magazines deleteAt (_magazines find _magazine); + + private _count = (count magazines _unit); + + private _array = []; + + private _index = 0; + + {_unit addMagazine _x; + + if (count magazines _unit isEqualTo _count) exitWith + { + _bool = True; + }; + + _count = (count magazines _unit); + + _index = _index + 1; + + _array = _array + [_x]; + + _object removeMagazine _x; + + } count _magazines; + + if (alive _object) then + { + _magazines = (magazineCargo _object); + + clearMagazineCargo _object; + + _count = 0; + + for "_count" from _count to (count _magazines - 1) do + { + _magazine = (_magazines select _count); + + if (_magazine in _array) then + { + _array deleteAt (_array find _magazine); + + // player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _array]; + } + else + { + _object addMagazineCargo [_magazine, 1]; + }; + }; + }; + + if (count _magazines > _index) then + { + _bool = True; + }; + + // player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _bool]; + + sleep 3; + + _unit selectWeapon (primaryWeapon _unit); + + [_unit, _group, _object, _bool] spawn (TCL_Rearm_F select 6); + + // player sideChat format ["TCL_Rearm_F > Magazines > %1", _unit]; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #5 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_object","_dummy","_weapon"]; + + if (alive _unit) then + { + private _bool = True; + + private _magazines = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines"); + + private _array = []; + + _array = (magazines _object) select { (_x in _magazines) }; + + if (_array isEqualTo [] ) then + { + _bool = False; + + (TCL_Rearm select 2) pushBack _dummy; + } + else + { + if (primaryWeapon _unit isEqualTo "") then + { + + } + else + { + _unit action ["DropWeapon", _dummy, (primaryWeapon _unit) ]; + + sleep 3; + }; + + _unit action ["TakeWeapon", _dummy, _weapon]; + + sleep 3; + + _unit action ["REARM", _object]; + + _unit selectWeapon (primaryWeapon _unit); + + // player sideChat format ["TCL_Rearm_F > Weapon > %1", _unit]; + }; + + [_unit, _group, _dummy, _bool] spawn (TCL_Rearm_F select 6); + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #6 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_object","_bool"]; + + _unit forceSpeed -1; + + _unit doWatch objNull; + + _unit setUnitPos "AUTO"; + + TCL_DeleteAT(TCL_Rearm,0,_unit); + + [_unit, _group] call (TCL_Follow_F select 0); + + if (_bool) then + { + sleep 10 + (random 30); + + TCL_DeleteAT(TCL_Rearm,2,_object); + } + else + { + sleep 30 + (random 50); + }; + + TCL_DeleteAT(TCL_Rearm,1,_unit); + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Regroup_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Regroup_F.sqf new file mode 100644 index 0000000..ad6a76a --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Regroup_F.sqf @@ -0,0 +1,92 @@ +TCL_Regroup_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Regroup Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Regroup + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_logic","_count"]; + + private _ai = (_group getVariable "TCL_AI" select 9); + + if (_ai) then + { + private _array = ( (TCL_Hold select 0) + (TCL_Defend select 0) + (TCL_Location select 0) ); + + if (_group in _array) exitWith {}; + + if (_count < 3) then + { + if (True) then + { + if (floor (random 100) < 15) exitWith + { + // [_group] spawn (TCL_Surrender_F select 0); + }; + }; + + private _groups = (_logic getVariable "TCL_Reinforcement"); + + _groups = _groups - [_group]; + + _groups = _groups select { (side _group isEqualTo side _x) }; + + if (_groups isEqualTo [] ) exitWith {}; + + [_group, _logic, _count, _groups] call (TCL_Regroup_F select 1); + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Regroup Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Regroup + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_logic","_count","_groups"]; + + private _leader = (leader _group); + + if (isNull objectParent _leader) then + { + private "_units"; + + private _rank = [_leader] call TCL_Rank_F; + + private _condition = {_this select { ( (alive _x) && { (isNull objectParent _x) } && { (_x distance _leader < 100) } ) }; count _this}; + + {_units = (units _x); + + if ( (_count <= _units call _condition) && { (_rank <= [leader _x] call TCL_Rank_F) } && { ( [_group, _x] call (TCL_KnowsAbout_F select 4) ) } ) exitWith + { + _units = (units _group); + + ["TCL_Position", _group] call (TCL_Marker_F select 0); + + // player sideChat format ["TCL_Regroup_F > Group > %1", _group]; + + _groups = (_logic getVariable "TCL_Reinforcement"); + + _groups deleteAt (_groups find _group); + + _units join _x; + + (TCL_Regroup select 0) append _units; + + _units select { (count assignedVehicleRole _x > 0) } apply { [_x] orderGetIn False; [_x] allowGetIn False}; + + _units select { ( (fleeing _x) || (captive _x) ) } apply {if (fleeing _x) then {_x allowFleeing 0} else {_x setCaptive False} }; + }; + + } count _groups; + }; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Simulate_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Simulate_F.sqf new file mode 100644 index 0000000..879e898 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Simulate_F.sqf @@ -0,0 +1,118 @@ +#include "TCL_Resource.hpp" + +TCL_Simulate_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Simulate Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Simulate + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {private ["_unit","_object","_array","_animation"]; + + _unit = _this select 0; + _object = _this select 1; + + if ( { (isPlayer _x) } count (units _unit) > 0) exitWith {}; + + if ( (alive _unit) && (_unit countEnemy [_object] > 0) && ( [_unit] _call(TCL_Simulate_F,1) ) ) then + { + _array = ["AdthPercMstpSlowWrflDnon_1","AdthPercMstpSlowWrflDnon_2","AdthPercMstpSlowWrflDnon_8","AdthPercMstpSlowWrflDnon_16","AdthPercMstpSlowWrflDnon_32","AdthPercMstpSrasWrflDnon_1","AdthPercMstpSrasWrflDnon_2","AdthPercMstpSrasWrflDnon_8","AdthPercMstpSrasWrflDnon_16","AdthPercMstpSrasWrflDnon_32"]; + + if ( { (animationState _unit == _x) } count _array > 0) then + { + _unit switchMove "AinjPpneMstpSnonWnonDnon_kneel"; + } + else + { + _animation = _array call TCL_Random_F; + + _unit playMove _animation; + + sleep 30 + (random 50); + + if (alive _unit ) then + { + if (isMultiplayer) then + { + if _getRandom(50) then + { + // _unit setVehicleInit "this switchMove ""AinjPpneMstpSnonWnonDnon_rolltofront""; "; + + // processInitCommands; + + _unit playMove "AmovPpneMstpSrasWrflDnon_AmovPercMstpSrasWrflDnon"; + } + else + { + // _unit setVehicleInit "this switchMove ""AinjPpneMstpSnonWnonDnon_kneel""; "; + + // processInitCommands; + }; + + // clearVehicleInit _unit; + } + else + { + if _getRandom(50) then + { + _unit switchMove "AinjPpneMstpSnonWnonDnon_rolltofront"; + + _unit playMove "AmovPpneMstpSrasWrflDnon_AmovPercMstpSrasWrflDnon"; + } + else + { + _unit switchMove "AinjPpneMstpSnonWnonDnon_kneel"; + }; + }; + }; + }; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Simulate Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Simulate + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {private ["_unit","_return","_objects","_array","_count","_object"]; + + _unit = _this select 0; + + _return = True; + + if (alive _unit) then + { + _objects = _unit nearEntities [ ["Man","Car","Tank","Air"], 100]; + + _objects = _objects - [_unit]; + + if (count _objects > 0) then + { + _array = []; + + _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _object = (_objects select _count); + + if ( ( [_object] call TCL_Armed_F) && (_unit countFriendly [_object] > 0) && (side _object != CIVILIAN) && (_unit _getKnows(_object) > 0) ) then + { + _setIn(_array,-1,_object); + }; + + if (count _array > _getGlobal(42) ) exitWith + { + _return = False; + }; + }; + }; + }; + + _return + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Smoke_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Smoke_F.sqf new file mode 100644 index 0000000..78045bf --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Smoke_F.sqf @@ -0,0 +1,130 @@ +TCL_Smoke_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Smoke Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Smoke + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group"]; + + if (TCL_Feature select 3) then + { + if (floor (random 100) < (TCL_Feature select 4) ) then + { + private _units = (units _group); + + if (_units findIf { (alive _x) } > -1) then + { + private _muzzle = []; + + private _magazine = "SmokeShell"; + + if (count _this == 3) then + { + _magazine = "SmokeShellRed"; + }; + + private ["_unit","_magazines"]; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + _magazines = (magazines _unit); + + if ( (alive _unit) && { (_magazine in _magazines) } ) exitWith + { + if (_magazine isEqualTo "SmokeShell") then + { + _muzzle = ["SmokeShellMuzzle","SmokeShellMuzzle"]; + } + else + { + _muzzle = ["SmokeShellRedMuzzle","SmokeShellRedMuzzle"]; + }; + }; + }; + + if (_muzzle isEqualTo [] ) exitWith {}; + + _unit doWatch (getPos _enemy); + + sleep 1 + (random 3); + + _unit forceWeaponFire _muzzle; + }; + }; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Smoke Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Smoke + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_vehicle"]; + + if (TCL_Feature select 5) then + { + if (floor (random 100) < (TCL_Feature select 6) ) then + { + private _units = (units _group); + + // player sideChat format ["TCL_Smoke_F > Vehicle > %1", _group]; + + _units = _units select { ( (_x in assignedVehicle _x) && { (assignedVehicleRole _x select 0 == "Cargo") } && { ("SmokeShell" in magazines _x) } ) }; + + if (_units isEqualTo [] ) exitWith {}; + + private _velocity = [_vehicle] call TCL_Velocity_F; + + if (_velocity > 10) then + { + sleep 1 + (random 3); + }; + + private _direction = [_enemy, _vehicle] call TCL_Dir_To_F; + + private ["_unit","_position","_smoke","_speed","_value","_angle"]; + + private _random = 1 + (random 3); + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + if (_random == 0) exitWith {}; + + if ( (alive _unit) && { (_random > 0) } && { (floor (random 100) < 50) } ) then + { + _unit removeMagazines "SmokeShell"; + + sleep (random 3); + + _position = [ (getPos _unit select 0), (getPos _unit select 1), (getPos _unit select 2) + 2]; + + _smoke = createVehicle ["SmokeShell", _position, [], 0, "NONE"]; + + _random = _random - 1; + + _speed = 7 + (random 3); + + _value = 150 + (random 60); + + _angle = (_direction - _value); + + _smoke setVelocity [ (sin _angle) * _speed, (cos _angle) * _speed, _speed]; + }; + }; + }; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Static_Weapon_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Static_Weapon_F.sqf new file mode 100644 index 0000000..94bf5f2 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Static_Weapon_F.sqf @@ -0,0 +1,266 @@ +#include "TCL_Macros.hpp" + +TCL_Static_Weapon_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + private _units = (units _group); + + private _array = ( (TCL_Static_Weapon select 0) + (TCL_House_Search select 0) ); + + _units = _units - _array; + + private _leader = (leader _group); + + _units deleteAt (_units find _leader); + + _units = _units select { ( (alive _x) && { (isNull objectParent _x) } ) }; + + if (count _units > 1) then + { + private _unit = _units select (count _units - 1); + + private _vehicle = [_unit, _group, _logic] call (TCL_Static_Weapon_F select 1); + + if (alive _vehicle) then + { + private _bool = True; + + if (_group in (TCL_Hold select 0) ) then + { + _bool = [_group, _vehicle] call TCL_Trigger_F; + }; + + if (_bool) then + { + [_unit, _group, _logic, _vehicle] spawn (TCL_Static_Weapon_F select 2); + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_logic"]; + + private _return = objNull; + + private _leader = (leader _group); + + private _objects = _unit nearEntities ["StaticWeapon", 100]; + + if (_objects isEqualTo [] ) exitWith {_return}; + + private _array = ( (TCL_Static_Weapon select 1) + (TCL_Static_Weapon select 2) ); + + _objects = _objects - _array; + + _objects = _objects select { ( (alive _x) && { (someAmmo _x) } && { (_unit knowsAbout _x > 0) } && { (_x distance _leader < 100) } ) }; + + private ["_vehicle","_side","_crew"]; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _vehicle = (_objects select _count); + + _side = False; + + if (getNumber (configFile >> "CfgVehicles" >> (typeOf _unit) >> "side") isEqualTo getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "side") ) then + { + _side = True; + }; + + _crew = (crew _vehicle); + + if ( (_side) && { (_crew isEqualTo [] ) } ) exitWith + { + _return = _vehicle; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_logic","_vehicle"]; + + _unit assignAsGunner _vehicle; + + _unit doMove (getPos _vehicle); + + (TCL_Static_Weapon select 0) pushBack _unit; + + (TCL_Static_Weapon select 1) pushBack _vehicle; + + [_unit] orderGetIn True; [_unit] allowGetIn True; + + // player sideChat format ["TCL_Static_Weapon_F > Vehicle > %1", _vehicle]; + + private _time = (time + 30); + + private _distance = (_unit distance _vehicle); + + _time = (_time + _distance); + + while { ( (alive _unit) && { (time < _time) } && { (isNull objectParent _unit) } ) } do + { + sleep 5; + }; + + if ( (alive _unit) && { (time < _time) } && { (_unit == gunner _vehicle) } ) then + { + [_unit, _group, _vehicle] spawn (TCL_Static_Weapon_F select 3); + } + else + { + TCL_DeleteAT(TCL_Static_Weapon,0,_unit); + + TCL_DeleteAT(TCL_Static_Weapon,1,_vehicle); + + _unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_vehicle"]; + + private _bool = True; + + private _missile = False; + + private _units = (units _group); + + private ["_leader","_weapon","_enemy"]; + + if (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") isEqualTo [] ) then + { + _bool = False; + + private _weapons = (weapons _vehicle); + + private _magazines = getArray (configfile >> "CfgWeapons" >> (_weapons select 0) >> "magazines"); + + private _magazine = (_magazines select 0); + + private _ammo = getText (configfile >> "CfgMagazines" >> _magazine >> "ammo"); + + if (_ammo isKindOf "MissileBase") then + { + _missile = True; + }; + }; + + while { ( (alive _unit) && { (_unit == gunner _vehicle) } ) } do + { + _leader = (leader _group); + + if ( (canFire _vehicle) && { (someAmmo _vehicle) } ) then + { + if (_bool) then + { + if (_vehicle in (TCL_Static_Weapon select 2) ) exitWith {}; + + [_unit, _group, _vehicle] spawn (TCL_Mortar_F select 0); + } + else + { + if (_missile) then + { + // _weapon = (weapons _vehicle select 0); + + // _enemy = (_group getVariable "TCL_Enemy"); + + // _vehicle fireAtTarget [_enemy, _weapon]; + + // player sideChat format ["TCL_Static_Weapon_F > Missile > %1 > %2", _unit, _weapon]; + }; + }; + } + else + { + _unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False; + }; + + _enemy = (_group getVariable "TCL_Enemy"); + + if (_unit distance _enemy < 10) then + { + [_unit, _group, _vehicle] call (TCL_Static_Weapon_F select 4); + }; + + if (_group in (TCL_Reinforcement select 2) ) then + { + [_unit, _group, _vehicle] call (TCL_Static_Weapon_F select 4); + }; + + _group = (group _unit); + + _waypoint = (_group getVariable "TCL_Waypoint"); + + if (_unit distance _waypoint > 500) then + { + if (behaviour _leader isEqualTo "COMBAT") then + { + [_unit, _group, _vehicle] call (TCL_Static_Weapon_F select 4); + }; + }; + + sleep 5; + }; + + if (_unit == gunner _vehicle) then + { + _unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False; + }; + + TCL_DeleteAT(TCL_Static_Weapon,0,_unit); + + sleep 10 + (random 30); + + TCL_DeleteAT(TCL_Static_Weapon,1,_vehicle); + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon Function #4 + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_vehicle"]; + + if (_group in (TCL_Artillery select 0) ) exitWith {}; + + _unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Suppressed_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Suppressed_F.sqf new file mode 100644 index 0000000..7412e6c --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Suppressed_F.sqf @@ -0,0 +1,69 @@ +#include "TCL_Macros.hpp" + +TCL_Suppressed_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Suppressed Fire Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Suppressed Fire + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group"]; + + private _distance = 300; + + private _leader = (leader _group); + + if ( (_group knowsAbout vehicle _unit > 0) && (_leader distance _unit < _distance) ) then + { + private _direction = [_unit, _leader] call TCL_Rel_Dir_To_F; + + // player sideChat format ["TCL_Suppressed_F > Direction > %1 > %2", _group, _direction]; + + if ( (_direction > 340) || (_direction < 20) ) then + { + (TCL_Suppressed select 0) pushBack _group; + + [_unit, _group] spawn (TCL_Suppressed_F select 1); + + // player sideChat format ["TCL_Suppressed_F > Group > %1", _group]; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Suppressed Fire Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Suppressed Fire + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group"]; + + private _units = (units _group); + + private _leader = (leader _group); + + private _behaviour = (behaviour _leader); + + _group setBehaviour "STEALTH"; + + {_x setUnitPos "DOWN"} count _units; + + sleep 10 + (random 30); + + if (_units findIf { (alive _x) } > -1) then + { + _group setBehaviour _behaviour; + + {_x setUnitPos "AUTO"} count _units; + + sleep 10 + (random 30); + }; + + TCL_DeleteAT(TCL_Suppressed,0,_group); + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Surrender_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Surrender_F.sqf new file mode 100644 index 0000000..4b238f5 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Surrender_F.sqf @@ -0,0 +1,141 @@ +#include "TCL_Macros.hpp" + +TCL_Surrender_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Surrender Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Surrender + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _units = (units _group); + + private _unit = _units select random (count _units - 1); + + if ( (isPlayer _unit) || (captive _unit) || (fleeing _unit) || (_unit in (TCL_Surrender select 0) ) ) exitWith {}; + + if (alive _unit) then + { + _unit setCaptive True; + + (TCL_Surrender select 0) pushBack _unit; + + private _bool = True; + + private _weapon = (primaryWeapon _unit); + + if (_weapon isEqualTo "") then + { + _bool = False; + }; + + private _dummy = createVehicle ["GroundWeaponHolder_Scripted", (getPos _unit), [], 0, "CAN_COLLIDE"]; + + if (_bool) then + { + _unit forceSpeed 0; + + _unit action ["DropWeapon", _dummy, _weapon]; + + waitUntil { (primaryWeapon _unit isEqualTo "") }; + + _unit forceSpeed -1; + }; + + private _weapons = (weapons _unit); + + _weapons apply {_dummy addWeapon _x; _unit removeWeapon _x}; + + private _magazines = (magazines _unit); + + _weapons apply {_dummy addMagazine _x; _unit removeMagazine _x}; + + // _unit action ["Surrender", _unit]; + + _unit playMove "AmovPercMstpSsurWnonDnon"; + + // _units deleteAt (_units find _unit); + + [_unit, _dummy, _weapon] spawn (TCL_Surrender_F select 1); + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Surrender Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Surrender + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_dummy","_weapon"]; + + // private _value = 1; + + private _courage = (_unit skill "courage"); + + _courage = (_courage / 3); + + // _value = (_value - _courage); + + // player sideChat format ["TCL_Surrender_F > Courage > %1 > %2", _unit, _courage]; + + private ["_random","_fleeing"]; + + _fleeing = 0; + + while { ( (alive _unit) && { (captive _unit) } ) } do + { + _random = (random _courage); + + _fleeing = (_fleeing + _random); + + _unit allowFleeing _fleeing; + + sleep 10 + (random 30); + + if (fleeing _unit) exitWith + { + // _unit move [ (getPos _unit select 0) + (random 100) - (random 100), (getPos _unit select 1) + (random 100) - (random 100), 0]; + + _unit switchMove ""; + + // player sideChat format ["TCL_Surrender_F > Fleeing > %1 > %2", _unit, _fleeing]; + + if (floor (random 100) < 50) then + { + if (True) exitWith + { + [_unit, _dummy, _dummy, _weapon] spawn (TCL_Rearm_F select 3); + }; + + _unit forceSpeed 0; + + _unit doWatch _dummy; + + _unit setUnitPos "MIDDLE"; + + _unit action ["TakeWeapon", _dummy, _weapon]; + + sleep 3; + + _unit action ["REARM", _dummy]; + + _unit forceSpeed -1; + + _unit doWatch objNull; + + _unit setUnitPos "AUTO"; + }; + + sleep 10 + (random 30); + + _unit setCaptive False; + }; + }; + + TCL_DeleteAT(TCL_Surrender,0,_unit); + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Take_Cover_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Take_Cover_F.sqf new file mode 100644 index 0000000..e4df0e5 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Take_Cover_F.sqf @@ -0,0 +1,475 @@ +#include "TCL_Macros.hpp" + +TCL_Take_Cover_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Take Cover Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Take Cover + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_units"]; + + private _array = ( (TCL_Sneaking select 0) + (TCL_Garrison select 0) ); + + if (_group in _array) exitWith {}; + + private _bool = False; + + _array = (TCL_Hold select 0); + + if (_group in _array) then + { + _bool = True; + }; + + _array = ( (TCL_Heal select 0) + (TCL_Rearm select 0) + (TCL_Take_Cover select 0) + (TCL_House_Search select 0) + (TCL_Static_Weapon select 0) ); + + _units = _units - _array; + + private ["_unit","_enemy"]; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + if (floor (random 100) < (TCL_Feature select 16) ) then + { + if ( (alive _unit) && { (isNull objectParent _unit) } ) then + { + [_unit, _enemy, _group, _bool] call (TCL_Take_Cover_F select 1); + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Take Cover Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Take Cover + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_enemy","_group","_bool"]; + + if (alive _enemy) then + { + private _array = (_unit getVariable "TCL_Take_Cover"); + + if (isNil "_array") then + { + _unit setVariable ["TCL_Take_Cover", [time, [], (getPos _unit) ] ]; + + _array = (_unit getVariable "TCL_Take_Cover"); + + private _text = format ["TCL_Take_Cover_F > Error > %1 > %2 > %3 > %4", _unit, (side _unit), _group, (typeOf _unit) ]; + + diag_log ("////////////////////////////////// TCL error dump //////////////////////////////////" + endl + _text + endl + "///////////////////////////////////////////////////////////////////////////"); + + player sideChat _text; + + _string = format ["%1Ups...!
Something went wrong %2...
Don't worry the problem will be solved as soon as this message appears.
Please help me fix this issue by reporting the line stored in your .rpt file!
", (TCL_Text_F select 5), name player]; + + hint parseText _string; + }; + + if (time > (_array select 0) ) then + { + private _time = (time + 15); + + if (_unit knowsAbout vehicle _enemy > 0) then + { + // _time = _time + (random 15); + + _time = _time + (random 30); + + private _object = [_unit, _enemy, _group, _bool, _array] call (TCL_Take_Cover_F select 2); + + if (alive _object) then + { + (TCL_Take_Cover select 0) pushBack _unit; + + (TCL_Take_Cover select 1) pushBack _object; + + [_unit, _enemy, _group, _object, _bool] spawn (TCL_Take_Cover_F select 3); + + // player sideChat format ["TCL_Take_Cover_F > %1 > %2", _unit, (typeOf _object) ]; + }; + }; + + _array set [0, _time]; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Take Cover Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Take Cover + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_enemy","_group","_bool","_array"]; + + private _return = objNull; + + if (alive _unit) then + { + private _position = _unit; + + private _distance = (TCL_Feature select 17); + + private _waypoint = (_group getVariable "TCL_Waypoint"); + + if (_unit distance _waypoint < _distance) then + { + _position = _waypoint; + }; + + if (_group in (TCL_Flanking select 0) ) then + { + _position = [_unit, _group, _enemy, _position, _distance] call (TCL_Flanking_F select 1); + }; + + // private _objects = []; + + // private _objects = [_unit, _array, _distance] call TCL_Cover_F; + + private _objects = (_array select 1); + + if ( (_objects isEqualTo [] ) || (_unit distance (_array select 2) > _distance) ) then + { + // _objects = nearestTerrainObjects [_position, ["TREE","WALL","HOUSE"], _distance]; + + // _objects = nearestTerrainObjects [_position, ["HIDE","ROCK","ROCKS","BUSH"], _distance]; + + // _objects = nearestTerrainObjects [_position, ["TREE","WALL","HOUSE","FENCE"], _distance]; + + // _objects = nearestTerrainObjects [_position, ["HIDE","BUSH","TREE","WALL","HOUSE","FENCE"], _distance]; + + // _objects = nearestTerrainObjects [_position, ["ROCK","ROCKS","HIDE","BUSH","TREE","HOUSE"], _distance]; + + _objects = nearestTerrainObjects [_position, ["ROCK","ROCKS","HIDE","BUSH","TREE","WALL","HOUSE","FENCE"], _distance]; + + _array set [1, _objects]; + + _array set [2, (getPos _unit) ]; + + // player sideChat format ["TCL_Take_Cover_F > Objects > %1 > %2", _unit, (count _objects) ]; + }; + + _objects = _objects - (TCL_Take_Cover select 1); + + if (_objects isEqualTo [] ) exitWith {}; + + private "_object"; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _object = (_objects select _count); + + if ( (_bool) || (_unit distance _waypoint < _distance) || ( (_unit distance _enemy) > (_enemy distance _object) ) ) then + { + // if ( ( (_unit distance _object) < (_enemy distance _object) ) && { (_enemy distance _object > 5) } ) then + + // if ( ( (_unit distance _object) < (_enemy distance _object) ) || (_unit distance _object > 5) || (_enemy distance _object > 5) ) then + + if ( ( (_unit distance _object) < (_enemy distance _object) ) && { (_enemy distance _object > _distance) } ) then + { + // player sideChat format ["TCL_Take_Cover_F > Object > %1", _object]; + + // if ( (boundingBox _object select 1) findIf { ( (_x < 0.7) || (_x > 7) ) } > -1) exitWith + + if ( (boundingBox _object select 1) findIf { (_x > 15) } > -1) exitWith + { + // player sideChat format ["TCL_Take_Cover_F > BoundingBox > %1", _object]; + }; + + if ( (TCL_Take_Cover select 1) findIf { (_object distance _x < 3) } > -1) exitWith + { + // player sideChat format ["TCL_Take_Cover_F > Distance > %1", _object]; + }; + + if (_bool) exitWith + { + if ( [_group, _object] call TCL_Trigger_F) then + { + _return = _object; + }; + }; + + _return = _object; + }; + }; + + if (alive _return) exitWith + { + // player sideChat format ["TCL_Take_Cover_F > Exit > %1 > %2 > %3", _unit, _count, (count _objects) ]; + }; + }; + + if (alive _return) then + { + _return; + } + else + { + // _return = (_objects select 0); + + // player sideChat format ["TCL_Take_Cover_F > Behind > %1 > %2", _unit, _object]; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Take Cover Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Take Cover + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_enemy","_group","_object","_bool"]; + + // player sideChat format ["TCL_Take_Cover_F > %1 > %2 > %3 > %4", _object, (typeOf _object), (sizeOf typeOf _object), (boundingBox _object select 1) ]; + + private _random = 50; + + if (_unit distance _object > 10) then + { + _random = 75; + }; + + if (floor (random 100) < _random) then + { + _unit setUnitPos "UP"; + } + else + { + _unit setUnitPos "MIDDLE"; + }; + + private ["_marker","_text"]; + + if (TCL_Debug select 3) then + { + _marker = [ [_unit, time], (getPos _object), "Icon", [1,1], "mil_triangle", "colorWhite"] call TCL_Create_Marker_F; + + _text = {private _string = "Take Cover"; if (_unit in (TCL_Flanking select 1) ) then {_string = "Flanking"} else {if (_unit in (TCL_Flanking select 2) ) then {_string = "Flanking"} }; format ["%1 ( %2 ) %3 %4", _unit, _string, (_unit distance _object), _object] }; + + _marker setMarkerText call _text; + }; + + private _direction = (_object getDir _enemy); + + private _boundingBox = (boundingBox _object select 1 select 0); + + // player sideChat format ["TCL_Take_Cover_F > BoundingBox > %1 > %2 > %3", _unit, _object, (boundingBox _object select 1) ]; + + if (_boundingBox > 3) then + { + _boundingBox = 3; + } + else + { + if (_boundingBox < 1) then + { + _boundingBox = _boundingBox + 1; + }; + }; + + private _cover = [_object, - _boundingBox, _direction] call TCL_Real_Pos_F; + + _unit doMove _cover; + + private _spot = objNull; + + if (TCL_Debug select 6) then + { + _spot = createVehicle ["Sign_Arrow_Large_Blue_F", _cover, [], 0, "CAN_COLLIDE"]; + }; + + private _time = (time + 10); + + _time = _time + (_unit distance _cover); + + while { ( (alive _unit) && { (time < _time) } ) } do + { + // if (_unit distance _cover < 5) then {_unit setUnitPos "MIDDLE"}; + + // if ( (unitReady _unit) || (_unit distance _cover < 1) ) exitWith + + // if (_unit distance _cover < _boundingBox) exitWith + + // if (_unit distance2D _cover < 1) exitWith + + // if ( (unitReady _unit) && { (_unit distance _cover < _boundingBox) } ) exitWith + + // player sideChat format ["TCL_Take_Cover_F > %1 > %2 > %3", _unit, (unitReady _unit), (_unit distance _cover) ]; + + if (_unit distance2D _cover < _boundingBox) exitWith + { + // player sideChat format ["TCL_Take_Cover_F > %1 > %2 > %3", _unit, (_unit distance _cover), (boundingBox _object select 1 select 2) ]; + + // player sideChat format ["TCL_Take_Cover_F > BoundingBox > %1 > %2 > %3 > %4", _unit, _cover, _object, (boundingBox _object select 1) ]; + }; + + if (TCL_Debug select 3) then + { + _marker setMarkerText call _text; + }; + + sleep 1; + }; + + if (TCL_Debug select 3) then + { + deleteMarker _marker; + }; + + if (alive _spot) then + { + deleteVehicle _spot; + }; + + if (alive _unit) then + { + private _flanking = True; + + if (time < _time) then + { + if (TCL_Debug select 6) then + { + _spot = createVehicle ["Sign_Arrow_Large_Green_F", _cover, [], 0, "CAN_COLLIDE"]; + }; + + _unit setUnitPos "AUTO"; + + // _unit doWatch (getPos _enemy); + + if (_object isKindOf "House") exitWith + { + sleep 10 + (random 30); + + // player sideChat format ["TCL_Take_Cover_F > House > %1", _unit, _object]; + }; + + _unit forceSpeed 0; + + if ( (floor (random 100) < 50) && { (_unit distance _enemy < 300) } ) then + { + sleep 10 + (random 30); + + if (combatMode _group isEqualTo "YELLOW") then + { + // sleep 10 + (random 30); + }; + + if (alive _unit) then + { + if (_bool) then + { + // sleep 10 + (random 30); + }; + + _group = (group _unit); + + private _waypoint = (_group getVariable "TCL_Waypoint"); + + if (_unit distance _waypoint < 100) then + { + if (alive _spot) then + { + deleteVehicle _spot; + + _spot = createVehicle ["Sign_Arrow_Large_F", _cover, [], 0, "CAN_COLLIDE"]; + }; + + sleep 10 + (random 30); + }; + }; + } + else + { + sleep 10 + (random 30); + }; + + _random = (TCL_Feature select 18); + + if (_group in (TCL_Flanking select 0) ) then + { + _random = 100; + }; + + if (floor (random 100) < _random) then + { + _array = ( (TCL_Flanking select 1) + (TCL_Flanking select 2) ); + + // if (_unit in _array) then + // { + + _time = (time + 10); + + _random = (random 30); + + _time = (_time + _random); + + TCL_DeleteAT(TCL_Take_Cover,0,_unit); + + if (alive _spot) then + { + deleteVehicle _spot; + + _spot = createVehicle ["Sign_Arrow_Large_Yellow_F", _cover, [], 0, "CAN_COLLIDE"]; + }; + + while { (alive _unit) } do + { + if ( (time > _time) || (_unit in (TCL_Take_Cover select 0) ) ) exitWith + { + _flanking = False; + }; + + sleep 1; + }; + + // }; + }; + + _unit forceSpeed -1; + + if (alive _spot) then + { + deleteVehicle _spot; + }; + }; + + _unit setUnitPos "AUTO"; + + if (_flanking) then + { + TCL_DeleteAT(TCL_Take_Cover,0,_unit); + }; + + sleep 10 + (random 30); + + TCL_DeleteAT(TCL_Take_Cover,1,_object); + } + else + { + TCL_DeleteAT(TCL_Take_Cover,0,_unit); + + TCL_DeleteAT(TCL_Take_Cover,1,_object); + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Tank_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Tank_F.sqf new file mode 100644 index 0000000..3384489 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Tank_F.sqf @@ -0,0 +1,117 @@ +#include "TCL_Macros.hpp" + +TCL_Tank_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Tank Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Tank + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic","_units"]; + + private _vehicle = (vehicle _enemy); + + if ( (_vehicle isKindOf "Tank") && { (isEngineOn _vehicle) } ) then + { + private ["_unit","_weapon","_array"]; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + _weapon = (secondaryWeapon _unit); + + _array = []; + + if (_weapon isKindOf ["Launcher", configFile >> "CfgWeapons"] ) exitWith + { + _array = (magazines _unit) select { (getText (configfile >> "CfgMagazines" >> _x >> "displayNameShort") isEqualTo "AT") }; + + // player sideChat format ["TCL_Tank_F > Magazines > %1 > %2", _unit, _array]; + + if (_array isEqualTo [] ) exitWith + { + // [_enemy, _group, _logic] call (TCL_Static_Weapon_F select 0); + }; + + // _unit selectWeapon _weapon; + + [_unit, _enemy, _weapon] spawn (TCL_Tank_F select 1); + + // _muzzle = (weaponState _unit select 1); + + // _unit fireAtTarget [_enemy, _weapon]; + + // _unit fire _weapon; + + // _unit doTarget _enemy; + + // _unit doWatch _enemy; + + // _unit fire _weapon; + + // _unit action ["USEWEAPON", _weapon, _enemy, 1]; + + // _unit doFire _enemy; + }; + + if (False) then + { + // [_enemy, _group, _logic] call (TCL_Static_Weapon_F select 0); + }; + + // player sideChat format ["TCL_Tank_F > Magazines > %1 > %2", _unit, _array]; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Tank Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Tank + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_enemy","_weapon"]; + + private _vehicle = (vehicle _enemy); + + _unit forceSpeed 0; + + _unit doWatch _vehicle; + + // _unit disableAI "AUTOCOMBAT"; + + // _unit setBehaviour "CARELESS"; + + _unit doFire _vehicle; + + _unit doTarget _vehicle; + + _unit selectWeapon _weapon; + + // player sideChat format ["TCL_Tank_F > Unit > %1 > %2", _unit, _vehicle]; + + sleep 3; + + // _unit doFire _vehicle; + + // _unit commandTarget _vehicle; + + // _unit commandFire _vehicle; + + _unit fire _weapon; + + // _unit fireAtTarget [_vehicle, _weapon]; + + sleep 3; + + _unit forceSpeed -1; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Watch_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Watch_F.sqf new file mode 100644 index 0000000..a8d26be --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/TCL_Watch_F.sqf @@ -0,0 +1,82 @@ +#include "TCL_Macros.hpp" + +TCL_Watch_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Watch Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Watch + // Script by =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _units = (units _group); + + _units = _units - (TCL_Watch select 0); + + if (_units isEqualTo [] ) exitWith {}; + + private _unit = _units select random (count _units - 1); + + if (isNull objectParent _unit) then + { + private _velocity = [_unit] call TCL_Velocity_F; + + if (_velocity < 1) then + { + (TCL_Watch select 0) pushBack _unit; + + private _range = (random 180); + + private _direction = (getDir _unit - _range); + + if (_direction < 0) then + { + _direction = _direction + 360; + }; + + private _distance = 50; + + private _random = (random 70); + + _distance = (_distance + _random); + + private _position = [ (getPos _unit select 0) + sin (_direction * _distance), (getPos _unit select 1) + cos (_direction * _distance), 1 + (random 1) ]; + + // private _spot = "Land_HelipadCircle_F" createVehicleLocal _position; + + _unit doWatch _position; + + if (floor (random 100) < 50) then + { + if (_unit hasWeapon "Binocular") then {_unit selectWeapon "Binocular"}; + }; + + sleep 10 + (random 30); + + // _unit playMove "Acts_AidlPercMstpSlowWrflDnon_pissing"; + + if (_group in (TCL_Reinforcement select 0) ) then + { + _unit = _unit; + } + else + { + _unit doWatch objNull; + + // sleep 10 + (random 30); + }; + + if (currentWeapon _unit isEqualTo "Binocular") then + { + _unit selectWeapon (primaryWeapon _unit); + }; + + // deleteVehicle _spot; + + TCL_DeleteAT(TCL_Watch,0,_unit); + }; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Artillery_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Artillery_F.sqf new file mode 100644 index 0000000..2bf6239 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Artillery_F.sqf @@ -0,0 +1,328 @@ +#include "TCL_Macros.hpp" + +TCL_Artillery_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + if (TCL_Feature select 9) then + { + if (floor (random 100) < (TCL_Feature select 10) ) then + { + private _condition = (_logic getVariable "TCL_Artillery"); + + if (_condition select 0) then + { + private _objects = []; + + private _echo = _group; + + private _units = (units _echo); + + {_objects append (synchronizedObjects _x) } count _units; + + private _leader = (leader _echo); + + private _groups = (TCL_Artillery select 0); + + _groups = _groups select {_vehicle = (vehicle leader _x); ( (alive _vehicle) && { (alive gunner _vehicle) } && { (canFire _vehicle) } && { (someAmmo _vehicle) } && { (side _echo getFriend side _x > 0.6) } ) }; + + if (_groups isEqualTo [] ) exitWith {}; + + private _position = (getPos _logic); + + private _distance = [_echo] call (TCL_Radio_F select 0); + + private ["_kilo","_vehicle","_bool"]; + + private _count = 0; + + for "_count" from _count to (count _groups - 1) do + { + _kilo = (_groups select _count); + + _vehicle = (vehicle leader _kilo); + + _bool = [_vehicle, _position] call (TCL_Artillery_F select 3); + + if ( (_vehicle getVariable "TCL_Artillery") && { (_bool) } && { (_leader distance _vehicle < _distance) } ) exitWith + { + // if ( (floor (random 100) < 50) || (_vehicle in _objects) ) then + + _condition set [0, False]; + + _vehicle setVariable ["TCL_Artillery", False]; + + // player sideChat format ["TCL_Artillery_F > %1", _vehicle]; + + [_enemy, _kilo, _logic, _vehicle, _condition] spawn (TCL_Artillery_F select 1); + }; + }; + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic","_vehicle","_condition"]; + + private _value = [_enemy, _group, _logic] call (TCL_KnowsAbout_F select 3); + + sleep _value; + + private _time = 0; + + private _count = 5 - (random 3); + + sleep 10 + (random 30); + + _condition set [1, True]; + + private _position = [ (getPos _logic select 0) + (random 100 - random 100), (getPos _logic select 1) + (random 100 - random 100), 0]; + + private _bool = [_vehicle, _position] call (TCL_Artillery_F select 2); + + if (_bool) then + { + private _units = (units _group); + + _units = _units select { (typeOf _vehicle isEqualTo (typeOf vehicle _x) ) }; + + if (_units isEqualTo [] ) exitWith {}; + + [_units, _logic] spawn (TCL_Artillery_F select 4); + + // private _time = 0; + + private _rounds = 0; + + private _magazine = (getArtilleryAmmo [_vehicle] select 0); + + _time = _vehicle getArtilleryETA [_position, _magazine]; + + if (False) then + { + + { + _vehicle = (vehicle _x); + + private _gunner = (gunner _vehicle); + + private _muzzle = (currentMuzzle _gunner); + + _rounds = (_vehicle ammo _muzzle); + + _rounds = (_rounds / _count); + + private _magazine = (getArtilleryAmmo [_vehicle] select 0); + + _time = _vehicle getArtilleryETA [_position, _magazine]; + + _vehicle doArtilleryFire [_position, _magazine, _rounds]; + + sleep (random 5); + + } forEach _units; + + private _value = (_time * _rounds); + + _value = (_value / _count); + + // player sideChat format ["TCL_Artillery_F > Artillery > %1 > %2 > %3 > %4", _time, _value, _count, _rounds]; + + _time = (_time / _count); + + private _count = _rounds; + + while { (_count > 0) } do + { + sleep _time; + + _count = _count - 1; + }; + + // sleep _value; + + }; + }; + + // player sideChat format ["TCL_Artillery_F > Artillery > %1", _condition]; + + // _condition set [1, False]; + + sleep 30 + (random 50); + + _vehicle setVariable ["TCL_Artillery", True]; + + if (_time > 0) then + { + sleep 50 + (random 70); + } + else + { + sleep 30 + (random 50); + }; + + _condition set [0, True]; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle","_position"]; + + private _return = False; + + private _gunner = (gunner _vehicle); + + if ( (canFire _vehicle) && { (alive _gunner) } ) then + { + if (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") then + { + private _magazine = (getArtilleryAmmo [_vehicle] select 0); + + // _value = getNumber (configFile >> "CfgAmmo" >> _magazine >> "indirectHit"); + + // player sideChat str _magazine; + + // player sideChat str _value; + + private _range = _position inRangeOfArtillery [crew _vehicle, _magazine]; + + if (_range) then + { + _return = [_vehicle, _position] call (TCL_Artillery_F select 3); + }; + }; + }; + + // player sideChat format ["TCL_Artillery_F > Artillery > %1 > %2", _vehicle, _return]; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle","_position"]; + + private _return = True; + + // private _objects = _position nearEntities [ ["CAManBase","Car","Tank","Helicopter"], 100]; + + private _objects = _position nearEntities [ ["Man","Car","Tank","Helicopter"], 100]; + + if (_objects isEqualTo [] ) exitWith {_return}; + + _array = (allUnits + vehicles); + + _objects = allUnits; + + private "_object"; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _object = (_objects select _count); + + // if ( (alive _object) && { (side _object getFriend side _vehicle > 0.6) } && { (_object in _array) } ) exitWith + + if ( (alive _object) && { (side _object getFriend side _vehicle > 0.6) } && { (_object distance _position < 100) } ) exitWith + { + _return = False; + + // player sideChat format ["TCL_Artillery_F > Artillery > %1 > %2", _object, _vehicle]; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #4 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_units","_logic"]; + + private _time = 0; + + private _array = []; + + // private _rounds = 0; + + private _rounds = 3 + (random 5); + + private _position = [ (getPos _logic select 0) + (random 100 - random 100), (getPos _logic select 1) + (random 100 - random 100), 0]; + + private ["_unit","_vehicle"]; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + _array pushBack _unit; + + _vehicle = (vehicle _unit); + + private _gunner = (gunner _vehicle); + + private _muzzle = (currentMuzzle _gunner); + + // _rounds = (_vehicle ammo _muzzle); + + // _rounds = (_rounds / _random); + + private _magazine = (getArtilleryAmmo [_vehicle] select 0); + + _time = _vehicle getArtilleryETA [_position, _magazine]; + + _vehicle doArtilleryFire [_position, _magazine, _rounds]; + + sleep (random 5); + }; + + if (_array isEqualTo _units) then + { + while { (currentcommand _vehicle isEqualTo "FIRE AT POSITION") } do + { + sleep 5; + }; + + sleep _time; + + private _condition = (_logic getVariable "TCL_Artillery"); + + _condition set [1, False]; + + // player sideChat format ["TCL_Artillery_F > Artillery > %1", _condition]; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Flanking_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Flanking_F.sqf new file mode 100644 index 0000000..d2c42d3 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Flanking_F.sqf @@ -0,0 +1,139 @@ +#include "TCL_Macros.hpp" + +TCL_Flanking_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Flanking Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Flanking + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _array = []; + + private _units = (units _group); + + private _random = 3 - (random 1); + + private _leader = (leader _group); + + _value = (count _units / _random); + + (TCL_Flanking select 0) pushBack _group; + + private "_unit"; + + private _count = (count _units - 1); + + while { (_count > _value) } do + { + _unit = (_units select _count); + + _array pushBack _unit; + + _count = _count - 1; + }; + + if (floor (random 100) < (TCL_Feature select 19) ) exitWith + { + (TCL_Flanking select 1) append _array; + + // player sideChat format ["TCL_Flanking_F > Flanking #1 > %1 > %2", _group, _array]; + }; + + if (floor (random 100) < (TCL_Feature select 20) ) exitWith + { + _units = _units - _array; + + if (floor (random 100) < (TCL_Feature select 21) ) then + { + _units deleteAt (_units find _leader); + }; + + if (_leader in _units) then + { + _units = _units; + + // player sideChat format ["TCL_Flanking_F > Flanking #2 > %1 > %2", _group, _units]; + } + else + { + _units = _units select { (floor (random 100) < 50) }; + + _units pushBack _leader; + + // player sideChat format ["TCL_Flanking_F > Flanking #3 > %1 > %2", _group, _units]; + }; + + (TCL_Flanking select 2) append _units; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Flanking Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Flanking + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_enemy","_position","_distance"]; + + private _value = 30; + + private _bool = True; + + private _random = (random 50); + + _value = (_value + _random); + + private _direction = (_unit getDir _enemy); + + if (_unit in (TCL_Flanking select 1) ) then + { + _direction = (_direction + _value); + } + else + { + if (_unit in (TCL_Flanking select 2) ) exitWith + { + _direction = (_direction - _value); + }; + + _bool = False; + }; + + if (_bool) then + { + _position = [_unit, _distance, _direction] call TCL_Real_Pos_F; + + if (TCL_Debug select 6) then + { + [_position] spawn (TCL_Flanking_F select 2); + }; + + // player sideChat format ["TCL_Take_Cover_F > Direction > %1 > %2", _unit, _direction]; + }; + + _position + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Flanking Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Flanking + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_position"]; + + private _spot = createVehicle ["Sign_Arrow_Large_Yellow_F", _position, [], 0, "CAN_COLLIDE"]; + + sleep 5; + + deleteVehicle _spot; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Mortar_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Mortar_F.sqf new file mode 100644 index 0000000..be29f22 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Mortar_F.sqf @@ -0,0 +1,80 @@ +#include "TCL_Macros.hpp" + +TCL_Mortar_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Mortar Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Mortar + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_vehicle"]; + + if (_group in (TCL_Reinforcement select 0) ) then + { + private _enemy = (_group getVariable "TCL_Enemy"); + + if ( (alive _enemy) && { (_group knowsAbout vehicle _enemy > 0) } ) then + { + private _leader = (leader _group); + + (TCL_Static_Weapon select 2) pushBack _vehicle; + + private _logic = (_group getVariable "TCL_Logic"); + + private _magazine = (getArtilleryAmmo [_vehicle] select 0); + + private _position = [ (getPos _logic select 0) + (random 50 - random 50), (getPos _logic select 1) + (random 50 - random 50), 0]; + + private _bool = [_vehicle, _position] call (TCL_Artillery_F select 2); + + private _range = (getPos _logic) inRangeOfArtillery [crew _vehicle, _magazine]; + + if ( (_bool) && { (_range) } ) then + { + private _condition = (_logic getVariable "TCL_Artillery"); + + _condition set [1, True]; + + sleep 5 + (random 10); + + // private _count = 1 + (random 3); + + if (canFire _vehicle) then + { + private _rounds = (_unit ammo currentMuzzle gunner _vehicle); + + _rounds = (_rounds / 3); + + // private _count = (random _rounds); + + _time = _vehicle getArtilleryETA [_position, _magazine]; + + _vehicle doArtilleryFire [_position, _magazine, _rounds]; + + sleep _time; + + // sleep (10 * _count); + }; + + _condition set [1, False]; + + TCL_DeleteAT(TCL_Static_Weapon,2,_vehicle); + } + else + { + if (_leader in (TCL_Static_Weapon select 0) ) exitWith {}; + + // player sideChat format ["TCL_Mortar_F > Vehicle > %1", _vehicle]; + + _unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False; + + sleep 30 + (random 50); + + TCL_DeleteAT(TCL_Static_Weapon,2,_vehicle); + }; + }; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Rearm_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Rearm_F.sqf new file mode 100644 index 0000000..086bd41 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Rearm_F.sqf @@ -0,0 +1,523 @@ +#include "TCL_Macros.hpp" + +TCL_Rearm_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group"]; + + private ["_magazine","_count","_magazines","_array","_ammo","_value"]; + + private _weapon = (primaryWeapon _unit); + + if (_weapon isEqualTo "") then + { + _ammo = 0; + + _count = 0; + + _magazine = ""; + } + else + { + _magazines = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines"); + + _magazine = (_magazines select 0); + + _array = []; + + _array = (magazines _unit) select { (_x in _magazines) }; + + // _array = (magazines _unit) select { (_x isEqualTo _magazine) }; + + // _ammo = getNumber (configfile >> "CfgMagazines" >> _magazine >> "count"); + + _count = (count _array); + + _ammo = (_unit ammo _weapon); + + // _value = (_ammo * _magazines); + }; + + if ( (_count < 3) && { (_ammo < 50) } ) then + { + [_unit, _group, _magazine, _magazines] call (TCL_Rearm_F select 1); + + // player sideChat format ["TCL_Rearm_F > Magazine > %1 > %2 > %3 > %4 > %5", _unit, _ammo, _value, _magazine, _magazines]; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_magazine","_magazines"]; + + if (True) then + { + private _objects = nearestObjects [_unit, ["CAManBase"], 100]; + + _objects = _objects - (TCL_Rearm select 2); + + private _array = []; + + _array = _objects select { ( (alive _x) || (_unit knowsAbout _x == 0) ) }; + + _objects = _objects - _array; + + if (_objects isEqualTo [] ) exitWith + { + _objects = nearestObjects [_unit, ["LandVehicle"], 100]; + + _objects = _objects - (TCL_Rearm select 2); + + _objects = _objects select { ( (alive _x) && { (crew _x isEqualTo [] ) } ) }; + + if (_objects isEqualTo [] ) exitWith {}; + + private _object = (_objects select 0); + + // player sideChat format ["TCL_Rearm_F > Vehicle > %1 > %2", _unit, _object]; + + _array = (magazineCargo _object); + + if (_array isEqualTo [] ) exitWith {}; + + if (_magazine in _array) then + { + (TCL_Rearm select 0) pushBack _unit; + + // (TCL_Rearm select 1) pushBack _unit; + + (TCL_Rearm select 2) pushBack _object; + + _array = _array select { (_x in _magazines) }; + + // player sideChat format ["TCL_Rearm_F > Cargo > %1 > %2", _unit, _index]; + + [_unit, _group, _object, _array] spawn (TCL_Rearm_F select 3); + + // player sideChat format ["TCL_Rearm_F > Vehicle > %1 > %2", _unit, _object]; + }; + }; + + private _object = (_objects select 0); + + private _bool = [_unit, _group, _magazine, _objects] call (TCL_Rearm_F select 2); + + if (_bool) then + { + _objects = nearestObjects [_object, ["WeaponHolderSimulated"], 5]; + + _objects = _objects - (TCL_Rearm select 2); + + if (_objects isEqualTo [] ) exitWith {}; + + private _dummy = (_objects select 0); + + private _weapons = (weaponCargo _dummy); + + private _weapon = (_weapons select 0); + + (TCL_Rearm select 0) pushBack _unit; + + // (TCL_Rearm select 1) pushBack _unit; + + (TCL_Rearm select 2) pushBack _object; + + // _array = [_object, _dummy]; + + // (TCL_Rearm select 2) append _array; + + [_unit, _group, _object, _dummy, _weapon] spawn (TCL_Rearm_F select 3); + + // player sideChat format ["TCL_Rearm_F > Weapon > %1 > %2", _unit, _object]; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_magazine","_objects"]; + + private _return = True; + + if (_magazine isEqualTo "") exitWith {_return}; + + private ["_object","_magazines","_array"]; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _object = (_objects select _count); + + _magazines = (magazines _object); + + if (_magazine in _magazines) exitWith + { + _return = False; + + (TCL_Rearm select 0) pushBack _unit; + + // (TCL_Rearm select 1) pushBack _unit; + + (TCL_Rearm select 2) pushBack _object; + + _array = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines"); + + _magazines = _magazines select { (_x in _array) }; + + [_unit, _group, _object, _magazines] spawn (TCL_Rearm_F select 3); + + // player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _object]; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_object"]; + + private _bool = True; + + private _time = (time + 10); + + private _position = (getPos _object); + + private _boundingBox = (boundingBox _object select 1 select 1); + + _position set [1, (_position select 1) - _boundingBox]; + + _unit doMove _position; + + // (TCL_Rearm select 0) pushBack _unit; + + (TCL_Rearm select 1) pushBack _unit; + + // (TCL_Rearm select 2) pushBack _object; + + private _distance = (_unit distance _object); + + // player sideChat format ["TCL_Rearm_F > Unit > %1 > %2", _unit, _object]; + + _time = (_time + _distance); + + while { ( (alive _unit) && { (time < _time) } ) } do + { + if (_unit distance _position < _boundingBox) exitWith + { + _bool = False; + + _unit forceSpeed 0; + + _unit doWatch _object; + + _unit setUnitPos "MIDDLE"; + + sleep 1; + + // _unit playMove "Acts_AidlPercMstpSlowWrflDnon_pissing"; + + if (count _this == 4) then + { + private _magazines = (_this select 3); + + [_unit, _group, _object, _magazines] spawn (TCL_Rearm_F select 4); + } + else + { + private _dummy = (_this select 3); + + private _weapon = (_this select 4); + + [_unit, _group, _object, _dummy, _weapon] spawn (TCL_Rearm_F select 5); + }; + }; + + sleep 1; + }; + + if (_bool) then + { + [_unit, _group, _object, _bool] spawn (TCL_Rearm_F select 6); + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #4 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_object","_magazines"]; + + if (alive _unit) then + { + private _bool = False; + + private _magazine = (_magazines select 0); + + _unit action ["TakeMagazine", _object, _magazine]; + + // {_object removeMagazine _x} count _magazines; + + _magazines deleteAt (_magazines find _magazine); + + if (False) then + { + // [_unit, _group, _object, _magazines] call (TCL_Rearm_F select 7); + + if (False) then + { + + _cargo = (magazineCargo _object); + + _index = (_cargo find _magazine); + + if (_index != -1) then + { + private _count = 0; + + clearMagazineCargo _object; + + // {if (_index != _count) then + { + // _object addMagazineCargo [_x, 1]; + }; + + _count = _count + 1; + + // } forEach _cargo; + }; + + }; + } + else + { + private _count = (count magazines _unit); + + // _count = (magazineCargo _object); + + // {_unit addMagazine _x; if (count magazines _unit > _count) then {_count = (count magazines _unit); _object removeMagazine _x} else {_bool = True} } count _magazines; + + private _array = []; + + private _index = 0; + + {_unit addMagazine _x; + + if (count magazines _unit isEqualTo _count) exitWith + { + _bool = True; + }; + + _count = (count magazines _unit); + + _index = _index + 1; + + _array = _array + [_x]; + + _object removeMagazine _x; + + } count _magazines; + + if (alive _object) then + { + _cargo = (magazineCargo _object); + + clearMagazineCargo _object; + + _count = 0; + + for "_count" from _count to (count _cargo - 1) do + { + _magazine = (_cargo select _count); + + if (_magazine in _array) then + { + _array deleteAt (_array find _magazine); + + // player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _array]; + + sleep 1; + + // _object addMagazineCargo [_magazine, 1]; + } + else + { + _object addMagazineCargo [_magazine, 1]; + }; + }; + + // player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, (count _cargo), count (magazineCargo _object) ]; + }; + + if (count _magazines > _index) then + { + _bool = True; + }; + }; + + // player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _bool]; + + // _unit addMagazines [_magazine, (count _magazines) ]; + + sleep 3; + + _unit selectWeapon (primaryWeapon _unit); + + [_unit, _group, _object, _bool] spawn (TCL_Rearm_F select 6); + + // player sideChat format ["TCL_Rearm_F > Magazines > %1", _unit]; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #5 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_object","_dummy","_weapon"]; + + if (alive _unit) then + { + private _bool = False; + + // private _array = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines"); + + // private _magazines = (magazines _object) select { (_x in _array) }; + + if (primaryWeapon _unit isEqualTo "") then + { + + } + else + { + _unit action ["DropWeapon", _dummy, (primaryWeapon _unit) ]; + + sleep 3; + }; + + _unit action ["TakeWeapon", _dummy, _weapon]; + + sleep 3; + + // {_unit addMagazine _x} count _magazines; + + _unit action ["REARM", _object]; + + _unit selectWeapon (primaryWeapon _unit); + + [_unit, _group, _dummy, _bool] spawn (TCL_Rearm_F select 6); + + // player sideChat format ["TCL_Rearm_F > Weapon > %1", _unit]; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #6 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_object","_bool"]; + + _unit forceSpeed -1; + + _unit doWatch objNull; + + _unit setUnitPos "AUTO"; + + TCL_DeleteAT(TCL_Rearm,0,_unit); + + [_unit, _group] call (TCL_Follow_F select 0); + + if (_bool) then + { + sleep 10 + (random 30); + + TCL_DeleteAT(TCL_Rearm,2,_object); + } + else + { + sleep 30 + (random 50); + }; + + TCL_DeleteAT(TCL_Rearm,1,_unit); + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #7 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_object","_magazines"]; + + private _count = (count magazines _unit); + + private _cargo = (magazineCargo _object); + + private _index = 0; + + private _array = []; + + private "_magazine"; + + {_unit addMagazine _x; + + if (count magazines _unit isEqualTo _count) exitWith + { + _bool = True; + }; + + _count = (count magazines _unit); + + _index = _index + 1; + + _magazine = (_cargo find _x); + + _array pushBack _magazine; + + } forEach _magazines; + + if (count _magazines > _index) then + { + _bool = True; + }; + + // player sideChat format ["TCL_Rearm_F > Cargo > %1 > %2 > %3", _unit, _array, _cargo]; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Static_Weapon_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Static_Weapon_F.sqf new file mode 100644 index 0000000..9358196 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Static_Weapon_F.sqf @@ -0,0 +1,210 @@ +#include "TCL_Macros.hpp" + +TCL_Static_Weapon_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + private _units = (units _group); + + private _array = ( (TCL_Static_Weapon select 0) + (TCL_House_Search select 0) ); + + _units = _units - _array; + + private _leader = (leader _group); + + _units deleteAt (_units find _leader); + + _units = _units select { ( (alive _x) && { (isNull objectParent _x) } ) }; + + if (count _units > 1) then + { + private _unit = _units select (count _units - 1); + + private _vehicle = [_unit, _group, _logic] call (TCL_Static_Weapon_F select 1); + + if (alive _vehicle) then + { + private _bool = True; + + if (_group in (TCL_Hold select 0) ) then + { + _bool = [_group, _vehicle] call TCL_Trigger_F; + }; + + if (_bool) then + { + [_unit, _group, _logic, _vehicle] spawn (TCL_Static_Weapon_F select 2); + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_logic"]; + + private _return = objNull; + + private _leader = (leader _group); + + private _objects = _unit nearEntities ["StaticWeapon", 100]; + + if (_objects isEqualTo [] ) exitWith {_return}; + + _objects = _objects - ( (TCL_Static_Weapon select 1) + (TCL_Static_Weapon select 2) ); + + _objects = _objects select { ( (alive _x) && { (someAmmo _x) } && { (_unit knowsAbout _x > 0) } && { (_x distance _leader < 100) } ) }; + + private ["_vehicle","_side","_crew"]; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _vehicle = (_objects select _count); + + _side = False; + + if (getNumber (configFile >> "CfgVehicles" >> (typeOf _unit) >> "side") isEqualTo getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "side") ) then + { + _side = True; + }; + + _crew = (crew _vehicle); + + if ( (_side) && { (_crew isEqualTo [] ) } ) exitWith + { + _return = _vehicle; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_logic","_vehicle"]; + + _unit disableAI "AUTOTARGET"; + + _unit assignAsGunner _vehicle; + + _unit doMove (getPos _vehicle); + + (TCL_Static_Weapon select 0) pushBack _unit; + + (TCL_Static_Weapon select 1) pushBack _vehicle; + + [_unit] orderGetIn True; [_unit] allowGetIn True; + + // player sideChat format ["TCL_Static_Weapon_F > Vehicle > %1", _vehicle]; + + private _time = (time + 30); + + private _distance = (_unit distance _vehicle); + + _time = (_time + _distance); + + while { ( (alive _unit) && { (time < _time) } && { (isNull objectParent _unit) } ) } do + { + sleep 5; + }; + + if ( (alive _unit) && { (time < _time) } && { (_unit == gunner _vehicle) } ) then + { + _unit enableAI "AUTOTARGET"; + + [_unit, _group, _logic, _vehicle] spawn (TCL_Static_Weapon_F select 3); + } + else + { + TCL_DeleteAT(TCL_Static_Weapon,0,_unit); + + TCL_DeleteAT(TCL_Static_Weapon,1,_vehicle); + + _unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_logic","_vehicle"]; + + private _units = (units _group); + + private ["_leader","_waypoint"]; + + while { ( (alive _unit) && { (_unit == gunner _vehicle) } ) } do + { + _leader = (leader _group); + + if ( (canFire _vehicle) && { (someAmmo _vehicle) } ) then + { + if (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") then + { + if (_vehicle in (TCL_Static_Weapon select 2) ) exitWith {}; + + [_unit, _group, _vehicle] spawn (TCL_Mortar_F select 0); + }; + } + else + { + _unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False; + }; + + if (_group in (TCL_Reinforcement select 2) ) then + { + if (_leader in (TCL_Static_Weapon select 0) ) exitWith {}; + + _unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False; + }; + + if (_unit distance _logic > 500) then + { + if (behaviour _leader isEqualTo "COMBAT") then + { + if (_leader in (TCL_Static_Weapon select 0) ) exitWith {}; + + _unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False; + }; + }; + + sleep 5; + }; + + if (_unit == gunner _vehicle) then + { + _unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False; + }; + + TCL_DeleteAT(TCL_Static_Weapon,0,_unit); + + sleep 10 + (random 30); + + TCL_DeleteAT(TCL_Static_Weapon,1,_vehicle); + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Take_Cover_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Take_Cover_F.sqf new file mode 100644 index 0000000..0bfa0e8 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/TCL_Take_Cover_F.sqf @@ -0,0 +1,521 @@ +#include "TCL_Macros.hpp" + +TCL_Take_Cover_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Take Cover Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Take Cover + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_units"]; + + private _array = ( (TCL_Sneaking select 0) + (TCL_Garrison select 0) ); + + if (_group in _array) exitWith {}; + + _array = ( (TCL_Hold select 0) + (TCL_Waiting select 0) ); + + private _bool = False; + + if (_group in _array) then + { + _bool = True; + }; + + _array = ( (TCL_Heal select 0) + (TCL_Rearm select 0) + (TCL_Take_Cover select 0) + (TCL_House_Search select 0) + (TCL_Static_Weapon select 0) ); + + _units = _units - _array; + + private ["_unit","_enemy"]; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + if (floor (random 100) < (TCL_Feature select 16) ) then + { + if ( (alive _unit) && { (isNull objectParent _unit) } ) then + { + [_unit, _enemy, _group, _bool] call (TCL_Take_Cover_F select 1); + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Take Cover Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Take Cover + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_enemy","_group","_bool"]; + + if (alive _enemy) then + { + private _array = (_unit getVariable "TCL_Take_Cover"); + + if (isNil "_array") then + { + _unit setVariable ["TCL_Take_Cover", [time, [], (getPos _unit) ] ]; + + _array = (_unit getVariable "TCL_Take_Cover"); + + private _text = format ["TCL_Take_Cover_F > Error > %1 > %2 > %3 > %4", _unit, (side _unit), _group, (typeOf _unit) ]; + + diag_log ("////////////////////////////////// TCL error dump //////////////////////////////////" + endl + _text + endl + "///////////////////////////////////////////////////////////////////////////"); + + player sideChat _text; + + _string = format ["%1Ups...!
Something went wrong %2...
Don't worry the problem will be solved as soon as this message appears.
Please help me fix this issue by reporting the line stored in your .rpt file!
", (TCL_Text_F select 5), name player]; + + hint parseText _string; + }; + + if (time > (_array select 0) ) then + { + // private _time = (time + 5); + + private _time = (time + 15); + + if (_unit knowsAbout vehicle _enemy > 0) then + { + _time = _time + (random 15); + + // _time = _time + (random 30); + + private _object = [_unit, _enemy, _group, _bool, _array] call (TCL_Take_Cover_F select 2); + + if (alive _object) then + { + (TCL_Take_Cover select 0) pushBack _unit; + + (TCL_Take_Cover select 1) pushBack _object; + + [_unit, _enemy, _group, _object, _bool] spawn (TCL_Take_Cover_F select 3); + + // player sideChat format ["TCL_Take_Cover_F > %1 > %2", _unit, (typeOf _object) ]; + }; + }; + + _array set [0, _time]; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Take Cover Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Take Cover + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_enemy","_group","_bool","_array"]; + + private _distance = (TCL_Feature select 17); + + private _return = objNull; + + if (alive _unit) then + { + private _waypoint = (_group getVariable "TCL_Waypoint"); + + private _position = _unit; + + if (_unit distance _waypoint < _distance) then + { + _position = _waypoint; + }; + + if (_group in (TCL_Flanking select 0) ) then + { + private _direction = 50; + + if (_unit in (TCL_Flanking select 1) ) then + { + _direction = - 50; + }; + + _position = [_unit, _distance, _direction] call TCL_Real_Pos_F; + }; + + // private _objects = []; + + // private _objects = [_unit, _array, _distance] call TCL_Cover_F; + + private _objects = (_array select 1); + + if ( (_objects isEqualTo [] ) || (_unit distance (_array select 2) > _distance) ) then + { + // _objects = nearestTerrainObjects [_position, ["HIDE","ROCK","ROCKS","BUSH"], _distance]; + + _objects = nearestTerrainObjects [_position, ["HIDE","ROCK","ROCKS","BUSH","TREE","WALL","HOUSE","FENCE"], _distance]; + + // _objects = nearestTerrainObjects [_position, ["TREE","WALL","HOUSE","FENCE"], _distance]; + + // _objects = nearestTerrainObjects [_position, ["TREE","WALL","HOUSE","FENCE"], _distance]; + + _array set [1, _objects]; + + _array set [2, (getPos _unit) ]; + + // player sideChat format ["TCL_Take_Cover_F > Objects > %1 > %2", _unit, (count _objects) ]; + }; + + _objects = _objects - (TCL_Take_Cover select 1); + + if (_objects isEqualTo [] ) exitWith {}; + + if (False) exitWith + { + _return = (_objects select 0); + }; + + private "_object"; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _object = (_objects select _count); + + if ( (_unit distance _waypoint < _distance) || ( (_unit distance _enemy) > (_enemy distance _object) ) ) then + + // if ( (_bool) || (_unit distance _waypoint < _distance) || ( (_unit distance _enemy) > (_enemy distance _object) ) ) then + { + if (True) then + + // if ( ( (_unit distance _object) < (_enemy distance _object) ) || (_unit distance _object > 5) || (_enemy distance _object > 5) ) then + { + // player sideChat format ["TCL_Take_Cover_F > Object > %1", _object]; + + if (False) exitWith + + // if ( (boundingBox _object select 1) findIf { ( (_x < 0.7) || (_x > 7) ) } > -1) exitWith + { + // player sideChat format ["TCL_Take_Cover_F > BoundingBox > %1", _object]; + }; + + if (False) exitWith + + // if ( (TCL_Take_Cover select 1) findIf { (_object distance _x < 5) } > -1) exitWith + { + // player sideChat format ["TCL_Take_Cover_F > Distance > %1", _object]; + }; + + _return = _object; + }; + }; + + if (alive _return) exitWith + { + // player sideChat format ["TCL_Take_Cover_F > Exit > %1 > %2 > %3", _unit, _count, (count _objects) ]; + }; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Take Cover Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Take Cover + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_enemy","_group","_object","_bool"]; + + // player sideChat format ["TCL_Take_Cover_F > %1 > %2 > %3 > %4", _object, (typeOf _object), (sizeOf typeOf _object), (boundingBox _object select 1) ]; + + private _random = 50; + + if (_unit distance _object > 10) then + { + _random = 75; + }; + + if (floor (random 100) < _random) then + { + _unit setUnitPos "UP"; + } + else + { + _unit setUnitPos "MIDDLE"; + }; + + private ["_marker","_text"]; + + if (TCL_Debug select 3) then + { + _marker = [ [_unit, time], (getPos _object), "Icon", [1,1], "mil_triangle", "colorWhite"] call TCL_Create_Marker_F; + + _text = {format ["%1 ( Take Cover ) %2 %3 ", _unit, (_unit distance _object), _object] }; + + _marker setMarkerText call _text; + }; + + private _direction = (_object getDir _enemy); + + private _boundingBox = (boundingBox _object select 1 select 0); + + // _boundingBox = _boundingBox + 1; + + // player sideChat format ["TCL_Take_Cover_F > BoundingBox > %1 > %2 > %3", _unit, _object, (boundingBox _object select 1) ]; + + if (_boundingBox > 3) then + { + _boundingBox = 3; + } + else + { + if (_boundingBox < 1) then + { + _boundingBox = _boundingBox + 1; + }; + }; + + // _boundingBox = 1; + + _cover = [_object, - _boundingBox, _direction] call TCL_Real_Pos_F; + + _unit doMove _cover; + + private _spot = objNull; + + if (TCL_Debug select 6) then + { + _spot = createVehicle ["Sign_Arrow_Large_Blue_F", _cover, [], 0, "CAN_COLLIDE"]; + }; + + // _unit disableAI "AUTOTARGET"; + + // _unit doWatch _cover; + + // _unit doWatch objNull; + + // _unit commandWatch objNull; + + private _time = (time + 10); + + _time = _time + (_unit distance _cover); + + while { ( (alive _unit) && { (time < _time) } ) } do + { + // if (_unit distance _cover < 5) then {_unit setUnitPos "MIDDLE"}; + + // if ( (unitReady _unit) || (_unit distance _cover < 1) ) exitWith + + // if (_unit distance _cover < _boundingBox) exitWith + + // if (_unit distance2D _cover < 1) exitWith + + // if ( (unitReady _unit) && { (_unit distance _cover < _boundingBox) } ) exitWith + + if (_unit distance2D _cover < _boundingBox) exitWith + { + // player sideChat format ["TCL_Take_Cover_F > BoundingBox > %1 > %2 > %3", _unit, _object, (boundingBox _object select 1) ]; + + // player sideChat format ["TCL_Take_Cover_F > %1 > %2 > %3", _unit, (_unit distance _cover), (boundingBox _object select 1 select 2) ]; + }; + + if (TCL_Debug select 3) then + { + _marker setMarkerText call _text; + }; + + sleep 1; + }; + + if (TCL_Debug select 3) then + { + deleteMarker _marker; + }; + + if (alive _spot) then + { + deleteVehicle _spot; + }; + + if (alive _unit) then + + // if ( (alive _unit) && { (_unit distance _cover < 3) } ) then + { + if (time < _time) then + { + if (TCL_Debug select 6) then + { + _spot = createVehicle ["Sign_Arrow_Large_Green_F", _cover, [], 0, "CAN_COLLIDE"]; + }; + + // sleep 1; + + // if ( (unitReady _unit) || (floor (random 100) < 50) || (_unit in (TCL_Flanking select 1) ) ) then + + // if (_unit distance _cover < 1) then + + // if ( (unitReady _unit) || (_unit in (TCL_Flanking select 1) ) ) then + + if (True) then + { + _unit forceSpeed 0; + + player sideChat format ["TCL_Take_Cover_F > Ready > %1", _unit]; + }; + + _unit doWatch (getPos _enemy); + + // _unit enableAI "AUTOTARGET"; + + _boundingBox = (boundingBox _object select 1 select 2); + + if (_boundingBox > 1.4) then + { + _unit setUnitPos "UP"; + } + else + { + if (_boundingBox > 1.0) then + { + if (floor (random 100) < 15) then + { + _unit setUnitPos "UP"; + } + else + { + _unit setUnitPos "MIDDLE"; + }; + } + else + { + _unit setUnitPos "DOWN"; + }; + }; + + // _unit setUnitPos "AUTO"; + + if ( (floor (random 100) < 50) && { (_unit distance _enemy < 500) } ) then + { + sleep 10 + (random 30); + + if (combatMode _group isEqualTo "YELLOW") then + { + sleep 10 + (random 30); + }; + + if (alive _unit) then + { + if (_bool) then + { + sleep 10 + (random 30); + }; + + _group = (group _unit); + + private _waypoint = (_group getVariable "TCL_Waypoint"); + + if (_unit distance _waypoint < 100) then + { + if (alive _spot) then + { + deleteVehicle _spot; + + _spot = createVehicle ["Sign_Arrow_Large_F", _cover, [], 0, "CAN_COLLIDE"]; + }; + + sleep 10 + (random 30); + }; + }; + } + else + { + sleep 10 + (random 30); + }; + + // sleep 10 + (random 30); + + _random = 35; + + if (_unit in (TCL_Flanking select 1) ) then + { + private _value = (TCL_Feature select 19); + + _random = (_random + _value); + + _random = 100; + }; + + if (floor (random 100) < _random) then + { + _time = (time + 10); + + _random = (random 30); + + _time = (_time + _random); + + TCL_DeleteAT(TCL_Take_Cover,0,_unit); + + if (alive _spot) then + { + deleteVehicle _spot; + + _spot = createVehicle ["Sign_Arrow_Large_Yellow_F", _cover, [], 0, "CAN_COLLIDE"]; + }; + + while { (alive _unit) } do + { + if ( (time > _time) || (_unit in (TCL_Take_Cover select 0) ) ) exitWith + { + _unit forceSpeed -1; + + // player sideChat format ["TCL_Take_Cover_F > %1", _unit]; + }; + + sleep 1; + }; + } + else + { + _unit forceSpeed -1; + }; + + if (alive _spot) then + { + deleteVehicle _spot; + }; + }; + + _unit setUnitPos "AUTO"; + + // private _leader = (leader _group); + + // _unit doFollow _leader; + + TCL_DeleteAT(TCL_Take_Cover,0,_unit); + + // [_unit, _group] call (TCL_Follow_F select 0); + + sleep 10 + (random 30); + + TCL_DeleteAT(TCL_Take_Cover,1,_object); + } + else + { + TCL_DeleteAT(TCL_Take_Cover,0,_unit); + + TCL_DeleteAT(TCL_Take_Cover,1,_object); + }; + + // private _leader = (leader _group); + + // _unit doFollow (leader _unit); + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Artillery_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Artillery_F.sqf new file mode 100644 index 0000000..606cd57 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Artillery_F.sqf @@ -0,0 +1,227 @@ +TCL_Artillery_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + if (TCL_Feature select 9) then + { + if (floor (random 100) < (TCL_Feature select 10) ) then + { + private _condition = (_logic getVariable "TCL_Artillery"); + + if (_condition select 0) then + { + private _alpha = _group; + + private _leader = (leader _alpha); + + private _groups = (TCL_Artillery select 0); + + _groups = _groups select {_vehicle = (vehicle leader _x); ( (alive _vehicle) && { (canFire _vehicle) } && { (someAmmo _vehicle) } && { (side _alpha getFriend side _x > 0.6) } ) }; + + if (_groups isEqualTo [] ) exitWith {}; + + private _distance = (_alpha getVariable "TCL_AI" select 3); + + private _position = (getPos _logic); + + private ["_bravo","_vehicle","_magazine","_range"]; + + private _count = 0; + + for "_count" from _count to (count _groups - 1) do + { + _bravo = (_groups select _count); + + _vehicle = (vehicle leader _bravo); + + _magazine = (getArtilleryAmmo [_vehicle] select 0); + + _range = _position inRangeOfArtillery [crew _vehicle, _magazine]; + + player sideChat format ["TCL_Artillery_F > Range > %1", _range]; + + if ( (_vehicle getVariable "TCL_Artillery") && { (_range) } && { (_leader distance _vehicle < _distance) } ) then + { + _condition set [0, False]; + + // _logic setVariable ["TCL_Artillery", False]; + + _vehicle setVariable ["TCL_Artillery", False]; + + [_enemy, _logic, _vehicle, _condition] spawn (TCL_Artillery_F select 1); + }; + }; + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_logic","_vehicle","_condition"]; + + private _time = 10 + (random 30); + + // _time = _time + (random 50); + + player sideChat format ["TCL_Artillery_F > Artillery > %1", _vehicle]; + + sleep _time; + + if ( [_logic, _vehicle] call (TCL_Artillery_F select 2) ) then + { + private _bool = False; + + if (TCL_Sound) then + { + _bool = True; + }; + + _condition set [1, True]; + + _vehicle doWatch (getPos _logic); + + sleep 5 + (random 10); + + private _magazine = (getArtilleryAmmo [_vehicle] select 0); + + private _ammo = getText (configfile >> "CfgMagazines" >> _magazine >> "ammo"); + + private _count = 3 + (random 5); + + _vehicle doArtilleryFire [ (getPos _logic), _magazine, _count]; + + if (True) exitWith {}; + + while { (_count > 0) } do + { + _vehicle doArtilleryFire [ (getPos _logic), _magazine, _count]; + + _count = _count - 1; + + sleep 3 + (random 5); + }; + + if (True) exitWith {}; + + if ( (_vehicle isKindOf "Tank") && { (isNull objectParent _enemy) } ) then + { + // _ammo = "Sh_82mm_AMOS"; + }; + + // _ammo = "Sh_155mm_AMOS"; + + // _ammo = "Cluster_155mm_AMOS"; + + private _range = 30; + + private _random = (random 50); + + private _distance = (_range + _random); + + private _position = (getPos _logic); + + private ["_random","_distance","_shell"]; + + private _count = 7 + (random 10); + + while { (_count > 0) } do + { + private _random = (random 30); + + private _distance = (_range + _random); + + _shell = _ammo createVehicle [ (_position select 0) + (random _distance - random _distance), (_position select 1) + (random _distance - random _distance), 100]; + + if (_bool) then + { + if (floor (random 100) < (TCL_FX select 3) ) then + { + if (TCL_Multiplayer) then + { + TCL_Public = [_shell]; + + publicVariable "TCL_Public"; + + if (TCL_Dedicated) exitWith {}; + + [_shell] spawn (TCL_Whiz_FX_F select 2); + } + else + { + [_shell] spawn (TCL_Whiz_FX_F select 2); + }; + }; + }; + + _shell setVelocity [0,0,-100]; + + sleep 3 + (random 5); + + _count = _count - 1; + }; + + _condition set [1, False]; + + sleep 5 + (random 10); + + _vehicle doWatch objNull; + + sleep 150 + (random 170); + } + else + { + sleep 30 + (random 50); + }; + + _condition set [0, True]; + + _vehicle setVariable ["TCL_Artillery", True]; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_logic","_vehicle"]; + + private _return = True; + + private _objects = _logic nearEntities [ ["CAManBase","Car","Tank","Helicopter"], 100]; + + if (_objects isEqualTo [] ) exitWith {_return}; + + private "_object"; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _object = (_objects select _count); + + if ( (alive _object) && { (side _object getFriend side _vehicle > 0.6) } ) exitWith + { + _return = False; + }; + }; + + _return + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Flanking_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Flanking_F.sqf new file mode 100644 index 0000000..4b7a853 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Flanking_F.sqf @@ -0,0 +1,180 @@ +#include "TCL_Macros.hpp" + +TCL_Flanking_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Flanking Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Flanking + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _array = []; + + private _units = (units _group); + + if (count _units > 1) then + { + + private _random = 3 - (random 1); + + _value = (count _units / _random); + + (TCL_Flanking select 0) pushBack _group; + + private "_unit"; + + private _count = (count _units - 1); + + while { (_count > _value) } do + { + _unit = (_units select _count); + + _array pushBack _unit; + + _count = _count - 1; + }; + + if (floor (random 100) < (TCL_Feature select 20) ) then + { + (TCL_Flanking select 1) append _array; + + player sideChat format ["TCL_Flanking_F > Flanking #1 > %1 > %2", _group, _array]; + } + else + { + _units = _units - _array; + + if (floor (random 100) < (TCL_Feature select 21) ) then + { + (TCL_Flanking select 1) append _array; + + (TCL_Flanking select 2) append _units; + + player sideChat format ["TCL_Flanking_F > Flanking #2 > %1 > %2", _group, _units]; + } + else + { + if (floor (random 100) < (TCL_Feature select 22) ) then + { + _units = _units select { (floor (random 100) < 75) }; + + // _units = (_units / _random); + + (TCL_Flanking select 1) append _array; + + (TCL_Flanking select 2) append _units; + + player sideChat format ["TCL_Flanking_F > Flanking #3 > %1 > %2", _group, _units]; + }; + }; + }; + + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Flanking Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Flanking + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_enemy","_position","_distance"]; + + private _value = 30; + + private _bool = True; + + private _random = (random 50); + + _value = (_value + _random); + + private _direction = (_unit getDir _enemy); + + if (_unit in (TCL_Flanking select 1) ) then + { + _direction = (_direction + _value); + } + else + { + if (_unit in (TCL_Flanking select 2) ) exitWith + { + _direction = (_direction - _value); + }; + + _bool = False; + }; + + if (_bool) then + { + _position = [_unit, _distance, _direction] call TCL_Real_Pos_F; + + if (TCL_Debug select 6) then + { + [_position] spawn (TCL_Flanking_F select 2); + }; + + // player sideChat format ["TCL_Take_Cover_F > Direction > %1 > %2", _unit, _direction]; + }; + + _position + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Flanking Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Flanking + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_position"]; + + private _spot = createVehicle ["Sign_Arrow_Large_Yellow_F", _position, [], 0, "CAN_COLLIDE"]; + + sleep 5; + + deleteVehicle _spot; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Flanking Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Flanking + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_flanking"]; + + if (_group in (TCL_Flanking select 0) ) then + { + player sideChat format ["TCL_System > Flanking Out > %1", _group]; + + if (_flanking) then + { + (TCL_Flanking select 0) deleteAt ( (TCL_Flanking select 0) find _group); + + TCL_Flanking set [1, (TCL_Flanking select 1) - units _group]; + + TCL_Flanking set [2, (TCL_Flanking select 2) - units _group]; + }; + } + else + { + _flanking = True; + + [_group] call (TCL_Flanking_F select 0); + + if (_flanking) then + { + // (TCL_Flanking select 0) pushBack _group; + + player sideChat format ["TCL_System > Flanking In > %1", _group]; + }; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Rearm_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Rearm_F.sqf new file mode 100644 index 0000000..e5bd962 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Rearm_F.sqf @@ -0,0 +1,521 @@ +#include "TCL_Macros.hpp" + +TCL_Rearm_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group"]; + + private ["_magazine","_count","_magazines","_array","_ammo","_value"]; + + private _weapon = (primaryWeapon _unit); + + if (_weapon isEqualTo "") then + { + _ammo = 0; + + _count = 0; + + _magazine = ""; + } + else + { + _magazines = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines"); + + _magazine = (_magazines select 0); + + _array = []; + + _array = (magazines _unit) select { (_x in _magazines) }; + + // _array = (magazines _unit) select { (_x isEqualTo _magazine) }; + + // _ammo = getNumber (configfile >> "CfgMagazines" >> _magazine >> "count"); + + _count = (count _array); + + _ammo = (_unit ammo _weapon); + + // _value = (_ammo * _magazines); + }; + + if ( (_count < 3) && { (_ammo < 50) } ) then + { + [_unit, _group, _magazine] call (TCL_Rearm_F select 1); + + // player sideChat format ["TCL_Rearm_F > Magazine > %1 > %2 > %3 > %4 > %5", _unit, _ammo, _value, _magazine, _magazines]; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_magazine"]; + + if (True) then + { + private _objects = nearestObjects [_unit, ["CAManBase"], 100]; + + _objects = _objects - (TCL_Rearm select 2); + + private _array = []; + + _array = _objects select { ( (alive _x) || (_unit knowsAbout _x == 0) ) }; + + _objects = _objects - _array; + + if (_objects isEqualTo [] ) exitWith + { + _objects = nearestObjects [_unit, ["LandVehicle"], 100]; + + _objects = _objects - (TCL_Rearm select 2); + + _objects = _objects select { ( (alive _x) && { (crew _x isEqualTo [] ) } ) }; + + if (_objects isEqualTo [] ) exitWith {}; + + private _object = (_objects select 0); + + // player sideChat format ["TCL_Rearm_F > Vehicle > %1 > %2", _unit, _object]; + + _magazines = (magazineCargo _object); + + if (_magazines isEqualTo [] ) exitWith {}; + + if (_magazine in _magazines) then + { + (TCL_Rearm select 0) pushBack _unit; + + // (TCL_Rearm select 1) pushBack _unit; + + (TCL_Rearm select 2) pushBack _object; + + _array = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines"); + + _index = []; + + _magazines = _magazines select { (_x in _array) } apply {_index pushBack (_magazines find _x) }; + + // player sideChat format ["TCL_Rearm_F > Cargo > %1 > %2", _unit, _index]; + + [_unit, _group, _object, _magazines] spawn (TCL_Rearm_F select 3); + + player sideChat format ["TCL_Rearm_F > Vehicle > %1 > %2", _unit, _object]; + }; + }; + + private _object = (_objects select 0); + + private _bool = [_unit, _group, _magazine, _objects] call (TCL_Rearm_F select 2); + + if (_bool) then + { + _objects = nearestObjects [_object, ["WeaponHolderSimulated"], 5]; + + _objects = _objects - (TCL_Rearm select 2); + + if (_objects isEqualTo [] ) exitWith {}; + + private _dummy = (_objects select 0); + + private _weapons = (weaponCargo _dummy); + + private _weapon = (_weapons select 0); + + (TCL_Rearm select 0) pushBack _unit; + + // (TCL_Rearm select 1) pushBack _unit; + + // (TCL_Rearm select 2) pushBack _object; + + (TCL_Rearm select 2) pushBack _dummy; + + [_unit, _group, _object, _dummy, _weapon] spawn (TCL_Rearm_F select 3); + + player sideChat format ["TCL_Rearm_F > Weapon > %1 > %2", _unit, _object]; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_magazine","_objects"]; + + private _return = True; + + if (_magazine isEqualTo "") exitWith {_return}; + + private ["_object","_magazines","_array"]; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _object = (_objects select _count); + + _magazines = (magazines _object); + + if (_magazine in _magazines) exitWith + { + _return = False; + + (TCL_Rearm select 0) pushBack _unit; + + // (TCL_Rearm select 1) pushBack _unit; + + (TCL_Rearm select 2) pushBack _object; + + _array = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines"); + + _magazines = _magazines select { (_x in _array) }; + + [_unit, _group, _object, _magazines] spawn (TCL_Rearm_F select 3); + + player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _object]; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_object"]; + + private _bool = True; + + private _time = (time + 10); + + private _position = (getPos _object); + + private _boundingBox = (boundingBox _object select 1 select 1); + + _position set [1, (_position select 1) - _boundingBox]; + + _unit doMove _position; + + // (TCL_Rearm select 0) pushBack _unit; + + (TCL_Rearm select 1) pushBack _unit; + + // (TCL_Rearm select 2) pushBack _object; + + private _distance = (_unit distance _object); + + // player sideChat format ["TCL_Rearm_F > Unit > %1 > %2", _unit, _object]; + + _time = (_time + _distance); + + while { ( (alive _unit) && { (time < _time) } ) } do + { + if (_unit distance _position < _boundingBox) exitWith + { + _bool = False; + + _unit forceSpeed 0; + + _unit doWatch _object; + + _unit setUnitPos "MIDDLE"; + + sleep 1; + + // _unit playMove "Acts_AidlPercMstpSlowWrflDnon_pissing"; + + if (count _this == 4) then + { + private _magazines = (_this select 3); + + [_unit, _group, _object, _magazines] spawn (TCL_Rearm_F select 4); + } + else + { + private _dummy = (_this select 3); + + private _weapon = (_this select 4); + + [_unit, _group, _object, _dummy, _weapon] spawn (TCL_Rearm_F select 5); + }; + }; + + sleep 1; + }; + + if (_bool) then + { + [_unit, _group, _object, _bool] spawn (TCL_Rearm_F select 6); + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #4 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_object","_magazines"]; + + if (alive _unit) then + { + private _bool = False; + + private _magazine = (_magazines select 0); + + _unit action ["TakeMagazine", _object, _magazine]; + + // {_object removeMagazine _x} count _magazines; + + _magazines deleteAt (_magazines find _magazine); + + if (False) then + { + // [_unit, _group, _object, _magazines] call (TCL_Rearm_F select 7); + + if (False) then + { + + _cargo = (magazineCargo _object); + + _index = (_cargo find _magazine); + + if (_index != -1) then + { + private _count = 0; + + clearMagazineCargo _object; + + // {if (_index != _count) then + { + // _object addMagazineCargo [_x, 1]; + }; + + _count = _count + 1; + + // } forEach _cargo; + }; + + }; + } + else + { + private _count = (count magazines _unit); + + // _count = (magazineCargo _object); + + // {_unit addMagazine _x; if (count magazines _unit > _count) then {_count = (count magazines _unit); _object removeMagazine _x} else {_bool = True} } count _magazines; + + _array = []; + + private _index = 0; + + {_unit addMagazine _x; + + if (count magazines _unit isEqualTo _count) exitWith + { + _bool = True; + }; + + _count = (count magazines _unit); + + _index = _index + 1; + + _array = _array + [_x]; + + _object removeMagazine _x; + + } count _magazines; + + if (alive _object) then + { + _cargo = (magazineCargo _object); + + clearMagazineCargo _object; + + _count = 0; + + for "_count" from _count to (count _cargo - 1) do + { + _magazine = (_cargo select _count); + + if (_magazine in _array) then + { + _array deleteAt (_array find _magazine); + + // _object addMagazineCargo [_magazine, 1]; + } + else + { + // _object addMagazineCargo [_magazine, 1]; + }; + }; + + player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, (count _cargo), count (magazineCargo _object) ]; + }; + + if (count _magazines > _index) then + { + _bool = True; + }; + }; + + player sideChat format ["TCL_Rearm_F > Magazines > %1 > %2", _unit, _bool]; + + // _unit addMagazines [_magazine, (count _magazines) ]; + + sleep 3; + + _unit selectWeapon (primaryWeapon _unit); + + [_unit, _group, _object, _bool] spawn (TCL_Rearm_F select 6); + + // player sideChat format ["TCL_Rearm_F > Magazines > %1", _unit]; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #5 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_object","_dummy","_weapon"]; + + if (alive _unit) then + { + private _bool = False; + + // private _array = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines"); + + // private _magazines = (magazines _object) select { (_x in _array) }; + + if (primaryWeapon _unit isEqualTo "") then + { + + } + else + { + _unit action ["DropWeapon", _dummy, (primaryWeapon _unit) ]; + + sleep 3; + }; + + _unit action ["TakeWeapon", _dummy, _weapon]; + + sleep 3; + + // {_unit addMagazine _x} count _magazines; + + _unit action ["REARM", _object]; + + _unit selectWeapon (primaryWeapon _unit); + + [_unit, _group, _dummy, _bool] spawn (TCL_Rearm_F select 6); + + // player sideChat format ["TCL_Rearm_F > Weapon > %1", _unit]; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #6 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_object","_bool"]; + + _unit forceSpeed -1; + + _unit doWatch objNull; + + _unit setUnitPos "AUTO"; + + TCL_DeleteAT(TCL_Rearm,0,_unit); + + [_unit, _group] call (TCL_Follow_F select 0); + + if (_bool) then + { + sleep 10 + (random 30); + + TCL_DeleteAT(TCL_Rearm,2,_object); + } + else + { + sleep 30 + (random 50); + }; + + TCL_DeleteAT(TCL_Rearm,1,_unit); + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rearm Function #7 + // //////////////////////////////////////////////////////////////////////////// + // Rearm + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_object","_magazines"]; + + private _count = (count magazines _unit); + + private _cargo = (magazineCargo _object); + + private _index = 0; + + private _array = []; + + private "_magazine"; + + {_unit addMagazine _x; + + if (count magazines _unit isEqualTo _count) exitWith + { + _bool = True; + }; + + _count = (count magazines _unit); + + _index = _index + 1; + + _magazine = (_cargo find _x); + + _array pushBack _magazine; + + } forEach _magazines; + + if (count _magazines > _index) then + { + _bool = True; + }; + + player sideChat format ["TCL_Rearm_F > Cargo > %1 > %2 > %3", _unit, _array, _cargo]; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Regroup_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Regroup_F.sqf new file mode 100644 index 0000000..592de40 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Regroup_F.sqf @@ -0,0 +1,82 @@ +TCL_Regroup_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Regroup Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Regroup by =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_logic"]; + + private _condition = (_group getVariable "TCL_AI" select 8); + + if (_condition) then + { + private _array = ( (TCL_Hold select 0) + (TCL_Defend select 0) + (TCL_Location select 0) ); + + if (_group in _array) exitWith {}; + + if ( { ( (alive _x) && (isNull objectParent _x) ) } count (units _group) < 3) then + { + private _groups = (_logic getVariable "TCL_Reinforcement"); + + _groups = _groups - [_group]; + + if (count _groups > 0) then + { + [_group, _logic, _groups] call (TCL_Regroup_F select 1); + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Regroup Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Regroup by =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_logic","_groups"]; + + private _alpha = _group; + + private _leader = (leader _alpha); + + if (_leader == vehicle _leader) then + { + private _rank = [_leader] call TCL_Rank_F; + + private "_bravo"; + + private _count = 0; + + for "_count" from _count to (count _groups - 1) do + { + _bravo = (_groups select _count); + + if ( { ( (alive _x) && (_x == vehicle _x) && (_x distance _leader < 100) ) } count (units _bravo) >= { ( (alive _x) && (_x == vehicle _x) && (_x distance _leader < 100) ) } count (units _alpha) ) then + { + if ( [_alpha, _bravo] call (TCL_KnowsAbout_F select 3) ) then + { + if (_rank <= [leader _bravo] call TCL_Rank_F) then + { + ["TCL_Position", _alpha] call (TCL_Marker_F select 0); + + // player sideChat format ["TCL_Join_F > Group > %1", _alpha]; + + private _units = (units _alpha); + + _units join _bravo; + + {if (count assignedVehicleRole _x > 0) then { [_x] orderGetIn False; [_x] allowGetIn False} } forEach _units; + }; + }; + }; + }; + }; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Static_Weapon_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Static_Weapon_F.sqf new file mode 100644 index 0000000..076d9ce --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v1/TCL_Static_Weapon_F.sqf @@ -0,0 +1,262 @@ +#include "TCL_Macros.hpp" + +TCL_Static_Weapon_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group"]; + + private _units = (units _group); + + private _array = ( (TCL_Static_Weapon select 0) + (TCL_House_Search select 0) ); + + _units = _units - _array; + + private _leader = (leader _group); + + _units deleteAt (_units find _leader); + + _units = _units select { ( (alive _x) && { (isNull objectParent _x) } ) }; + + if (count _units > 1) then + { + private _unit = _units select (count _units - 1); + + private _vehicle = [_unit, _group] call (TCL_Static_Weapon_F select 1); + + if (alive _vehicle) then + { + private _bool = True; + + if (_group in (TCL_Hold select 0) ) then + { + _bool = [_group, _vehicle] call TCL_Trigger_F; + }; + + if (_bool) then + { + [_unit, _group, _vehicle] spawn (TCL_Static_Weapon_F select 2); + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group"]; + + private _return = objNull; + + private _leader = (leader _group); + + private _objects = _unit nearEntities ["StaticWeapon", 100]; + + if (_objects isEqualTo [] ) exitWith {_return}; + + _objects = _objects - (TCL_Static_Weapon select 1); + + _objects = _objects select { ( (alive _x) && { (someAmmo _x) } && { (_unit knowsAbout _x > 0) } && { (_x distance _leader < 100) } ) }; + + private ["_vehicle","_side","_crew"]; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _vehicle = (_objects select _count); + + _side = False; + + if (getNumber (configFile >> "CfgVehicles" >> (typeOf _unit) >> "side") isEqualTo getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "side") ) then + { + _side = True; + }; + + _crew = (crew _vehicle); + + if ( (_side) && { (_crew isEqualTo [] ) } ) exitWith + { + _return = _vehicle; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_vehicle"]; + + _unit disableAI "AUTOTARGET"; + + _unit assignAsGunner _vehicle; + + _unit doMove (getPos _vehicle); + + (TCL_Static_Weapon select 0) pushBack _unit; + + (TCL_Static_Weapon select 1) pushBack _vehicle; + + [_unit] orderGetIn True; [_unit] allowGetIn True; + + private _time = (time + 30); + + private _distance = (_unit distance _vehicle); + + _time = (_time + _distance); + + while { ( (alive _unit) && { (time < _time) } && { (isNull objectParent _unit) } ) } do + { + sleep 5; + }; + + if ( (alive _unit) && { (time < _time) } && { (_unit == gunner _vehicle) } ) then + { + _unit enableAI "AUTOTARGET"; + + [_unit, _group, _vehicle] spawn (TCL_Static_Weapon_F select 3); + } + else + { + TCL_DeleteAT(TCL_Static_Weapon,0,_unit); + + TCL_DeleteAT(TCL_Static_Weapon,1,_vehicle); + + _unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Static Weapon + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_group","_vehicle"]; + + private _units = (units _group); + + private _behaviour = (behaviour _unit); + + if (_behaviour isEqualTo "COMBAT") then + { + {_x disableAI "AUTOCOMBAT"} count _units; + + _group setBehaviour "AWARE"; + }; + + // (TCL_Static_Weapon select 0) pushBack _unit; + + // (TCL_Static_Weapon select 1) pushBack _vehicle; + + private ["_leader","_time","_random","_waypoint"]; + + while { ( (alive _unit) && { (_unit == gunner _vehicle) } ) } do + { + _leader = (leader _group); + + if ( (canFire _vehicle) && { (someAmmo _vehicle) } ) then + { + _enemy = (_group getVariable "TCL_Enemy"); + + if ( (alive _enemy) && { (_unit knowsAbout vehicle _enemy > 0) } ) then + { + _time = (time + 10); + + _random = (random 30); + + if (True) exitWith + { + _magazine = (getArtilleryAmmo [_vehicle] select 0); + + _range = (getPos _enemy) inRangeOfArtillery [crew _vehicle, _magazine]; + + if (_range) then + { + private _count = (random 3); + + while { (_count > 0) } do + { + _vehicle doArtilleryFire [ (getPos _enemy), _magazine, 1]; + + sleep 3 + (random 5); + + _count = _count - 1; + }; + }; + + player sideChat format ["TCL_Static_Weapon_F > Vehicle > %1 > %2 > %3 > %4", _range, _enemy, _vehicle, _magazine]; + + sleep 10 + (random 30); + }; + + _vehicle doTarget _enemy; + + _time = (_time + _random); + + while { (time < _time) } do + { + if (_vehicle aimedAtTarget [_enemy] > 0) exitWith + { + _vehicle fireAtTarget [_enemy]; + + // player sideChat format ["TCL_Static_Weapon_F > Vehicle > %1", _vehicle]; + + sleep 10 + (random 30); + }; + + sleep 1; + }; + }; + } + else + { + _unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False; + }; + + _group = (group _unit); + + _waypoint = (_group getVariable "TCL_Waypoint"); + + // player sideChat format ["TCL_Static_Weapon_F > %1", _unit]; + + if ( (_unit distance _leader > 100) || (_unit distance _waypoint > 500) ) exitWith + { + _unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False; + }; + + sleep 5; + }; + + if (_unit == gunner _vehicle) then + { + _unit leaveVehicle _vehicle; [_unit] orderGetIn False; [_unit] allowGetIn False; + }; + + _group setBehaviour _behaviour; + + TCL_DeleteAT(TCL_Static_Weapon,0,_unit); + + sleep 10 + (random 30); + + TCL_DeleteAT(TCL_Static_Weapon,1,_vehicle); + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v2/TCL_Artillery_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v2/TCL_Artillery_F.sqf new file mode 100644 index 0000000..2459c67 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Feature_F/Temp/v2/TCL_Artillery_F.sqf @@ -0,0 +1,231 @@ +#include "TCL_Macros.hpp" + +TCL_Artillery_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + if (TCL_Feature select 9) then + { + if (floor (random 100) < (TCL_Feature select 10) ) then + { + private _condition = (_logic getVariable "TCL_Artillery"); + + if (_condition select 0) then + { + private _echo = _group; + + private _leader = (leader _echo); + + private _groups = (TCL_Artillery select 0); + + _groups = _groups select {_vehicle = (vehicle leader _x); ( (alive _vehicle) && { (alive gunner _vehicle) } && { (canFire _vehicle) } && { (someAmmo _vehicle) } && { (side _echo getFriend side _x > 0.6) } ) }; + + if (_groups isEqualTo [] ) exitWith {}; + + private _position = (getPos _logic); + + private _distance = [_echo] call (TCL_Radio_F select 0); + + private ["_kilo","_vehicle","_string","_magazine","_range"]; + + private _count = 0; + + for "_count" from _count to (count _groups - 1) do + { + _kilo = (_groups select _count); + + _vehicle = (vehicle leader _kilo); + + // _string = getText ( (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0); + + // if (_string isEqualTo "Artillery") then + + if (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") then + { + _magazine = (getArtilleryAmmo [_vehicle] select 0); + + _range = _position inRangeOfArtillery [crew _vehicle, _magazine]; + + // player sideChat format ["TCL_Artillery_F > Range > %1 > %2", _range, _vehicle]; + + if ( (_vehicle getVariable "TCL_Artillery") && { (_range) } && { (_leader distance _vehicle < _distance) } ) then + { + _condition set [0, False]; + + _vehicle setVariable ["TCL_Artillery", False]; + + [_enemy, _kilo, _logic, _vehicle, _condition] spawn (TCL_Artillery_F select 1); + + // player sideChat format ["TCL_Artillery_F > Range > %1 > %2", _range, _vehicle]; + }; + }; + }; + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic","_vehicle","_condition"]; + + private _sleep = [_enemy, _group, _logic] call (TCL_KnowsAbout_F select 3); + + sleep _sleep; + + // private _bool = [_logic, _vehicle] call (TCL_Artillery_F select 2); + + if (True) then + { + private _count = 3; + + sleep 5 + (random 10); + + private _gunner = (gunner _vehicle); + + if ( (alive _vehicle) && { (alive _gunner) } ) then + { + private _time = 0; + + private _count = 3; + + _condition set [1, True]; + + private _skill = [_group] call TCL_Accuracy_F; + + private _magazine = (getArtilleryAmmo [_vehicle] select 0); + + private _rounds = (_vehicle ammo currentMuzzle _gunner); + + _rounds = (_rounds / _count); + + private ["_position","_bool"]; + + while { ( (alive _vehicle) && { (alive _gunner) } && { (_count > 0) } ) } do + { + _position = [ (getPos _logic select 0) + (random 100 - random 100), (getPos _logic select 1) + (random 100 - random 100), 0]; + + _bool = [_vehicle, _position] call (TCL_Artillery_F select 2); + + if (_bool) then + { + _time = _vehicle getArtilleryETA [_position, _magazine]; + + _vehicle doArtilleryFire [_position, _magazine, _rounds]; + + // player sideChat format ["TCL_Artillery_F > Artillery > %1 > %2 > %3", _vehicle, _time, _rounds]; + + sleep (_time / _skill); + }; + + _count = _count - 1; + }; + + sleep _time; + + _condition set [1, False]; + + sleep 30 + (random 50); + + _vehicle setVariable ["TCL_Artillery", True]; + + sleep 50 + (random 70); + }; + } + else + { + sleep 30 + (random 50); + + _vehicle setVariable ["TCL_Artillery", True]; + }; + + _condition set [0, True]; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle","_position"]; + + private _return = True; + + // private _objects = _position nearEntities [ ["CAManBase","Car","Tank","Helicopter"], 100]; + + private _objects = _position nearEntities [ ["Man","Car","Tank","Helicopter"], 100]; + + if (_objects isEqualTo [] ) exitWith {_return}; + + _array = (allUnits + vehicles); + + _objects = allUnits; + + private "_object"; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _object = (_objects select _count); + + // if ( (alive _object) && { (side _object getFriend side _vehicle > 0.6) } && { (_object in _array) } ) exitWith + + if ( (alive _object) && { (side _object getFriend side _vehicle > 0.6) } && { (_object distance _position < 100) } ) exitWith + { + _return = False; + + player sideChat format ["TCL_Artillery_F > Artillery > %1 > %2", _object, _vehicle]; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Artillery Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Artillery + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle"]; + + private _magazine = ""; + + if (canFire _vehicle) then + { + if (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") then + { + _magazine = (getArtilleryAmmo [_vehicle] select 0); + + _range = _position inRangeOfArtillery [crew _vehicle, _magazine]; + + if (_range) exitWith + { + _magazine; + }; + + _magazine = ""; + }; + }; + + _magazine + + }; +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Groups_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Groups_F.sqf new file mode 100644 index 0000000..b3ac19c --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Groups_F.sqf @@ -0,0 +1,435 @@ +#include "TCL_Macros.hpp" + +TCL_Groups_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Groups Function #0 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_groups"]; + + private _array = []; + + _array append _groups; + + private ["_group","_units","_objects"]; + + private _count = 0; + + for "_count" from _count to (count _groups - 1) do + { + _group = (_groups select _count); + + _units = (units _group); + + if (_units findIf { (alive _x) } > -1) then + { + _objects = []; + + {_objects append (synchronizedObjects _x) } count _units; + + { [_x, _group, _objects] call (TCL_Groups_F select 1) } count ["TCL_Idle","TCL_Hold","TCL_Defend","TCL_Custom","TCL_Freeze","TCL_Default","TCL_Disabled","TCL_Enhanced","TCL_Location"]; + }; + }; + + if (count (TCL_Custom select 0) > 0) then + { + _array = ( (TCL_Hold select 0) + (TCL_Defend select 0) + (TCL_Custom select 0) + (TCL_Location select 0) ); + + _array = (_array arrayIntersect _array); + + _groups = _groups - _array; + + (TCL_Disabled select 0) append _groups; + + private _sort = (TCL_Initialized select 0); + + _sort = _sort - _array; + + _sort = _sort - (TCL_Disabled select 0); + + (TCL_Disabled select 0) append _sort; + }; + + _array = _array - (TCL_Players select 2); + + _array = _array - (TCL_Disabled select 0); + + _array = _array - (TCL_Initialized select 0); + + _array = _array select { (side _x in (TCL_System select 2) ) }; + + { [_x] call (TCL_Get_In_F select 0); [_x] call (TCL_Groups_F select 7); [units _x] call (TCL_Units_F select 0); [_x] spawn (TCL_Garrison_F select 0) } forEach _array; + + (TCL_Groups select 0) append _array; + + (TCL_Initialized select 0) append _array; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Groups Function #1 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_type","_group","_objects"]; + + if (_type isEqualTo "TCL_Location") then + { + [_group, _objects] call (TCL_Groups_F select 2); + } + else + { + if (isNil {_group getVariable _type} ) then + { + private _bool = [_type, _group] call (TCL_Groups_F select 3); + + if (_bool) then + { + _bool = [_type, _group, _objects] call (TCL_Groups_F select 4); + + if (_bool) then + { + [_type, _group] call (TCL_Groups_F select 5); + }; + }; + } + else + { + if (_group getVariable _type) then + { + [_type, _group] call (TCL_Groups_F select 6); + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Groups Function #2 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_units"]; + + private _array = _units select { (side _x isEqualTo sideLogic) }; + + _units = _units - _array; + + if (_units isEqualTo [] ) exitWith {True}; + + _array = []; + + private "_unit"; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + if (units _unit findIf { (alive _x) } > -1) then + { + _array pushBackUnique (group _unit); + }; + }; + + if (_array isEqualTo [] ) exitWith {True}; + + _array pushBack _group; + + { (TCL_Location select 0) pushBackUnique _x} forEach _array; + + _group setVariable ["TCL_Location", _array]; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Groups Function #3 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_type","_group"]; + + private _return = True; + + private _units = (units _group); + + private "_unit"; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + if (isNil {_unit getVariable _type} ) then + { + _return = _return; + } + else + { + if (_unit getVariable _type) then + { + _return = False; + + _count = (count _units); + + [_type, _group] call (TCL_Groups_F select 6); + }; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Groups Function #4 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_type","_group","_objects"]; + + private _return = True; + + if (_objects isEqualTo [] ) exitWith {_return}; + + _objects = _objects select { (triggerText _x == _type) }; + + private "_object"; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _object = (_objects select _count); + + if (_object isKindOf "EmptyDetector") exitWith + { + _return = False; + + [_type, _group] call (TCL_Groups_F select 6); + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Groups Function #5 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_type","_group"]; + + private _objects = allMissionObjects "EmptyDetector"; + + if (_objects isEqualTo [] ) exitWith {True}; + + private _leader = (leader _group); + + _objects = _objects select { (triggerText _x == _type) }; + + private "_object"; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _object = (_objects select _count); + + if (_leader inArea _object) exitWith + { + [_type, _group, _object] call (TCL_Groups_F select 6); + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Groups Function #6 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_type","_group"]; + + private _string = call compile _type; + + private _array = (_string select 0); + + if (_group in _array) exitWith + { + private _error = []; + + _error pushBack _group; + + _error pushBack format ["( %1 )", count units _group]; + + private _text = _error joinString " "; + + hint parseText format ["%1A.I. group %2 was about to initialize multiple times in the same A.I. group type '%3'.
Please make sure to use any A.I. group type for each A.I. group except 'Location' A.I. group(s) ONCE only.", (TCL_Text_F select 3), _text, _type]; + }; + + if (_type == "TCL_Idle") exitWith + { + (TCL_Idle select 0) pushBack _group; + }; + + if (_type == "TCL_Hold") exitWith + { + (TCL_Hold select 0) pushBack _group; + + private "_object"; + + if (count _this == 3) then + { + _object = _this select 2; + } + else + { + private _leader = (leader _group); + + _object = createTrigger ["EmptyDetector", (getPos _leader) ]; + + _object setTriggerArea [50, 50, 0, False]; + + private _side = format ["%1", (side _leader) ]; + + _object setTriggerActivation [_side, "PRESENT", False]; + }; + + _group setVariable ["TCL_Enemy", objNull]; + + _group setVariable ["TCL_Trigger", _object]; + + ["TCL_Marker", _group, _object] call (TCL_Marker_F select 0); + }; + + if (_type == "TCL_Defend") exitWith + { + (TCL_Defend select 0) pushBack _group; + }; + + if (_type == "TCL_Custom") exitWith + { + (TCL_Custom select 0) pushBack _group; + }; + + if (_type == "TCL_Freeze") exitWith + { + (TCL_Freeze select 0) pushBack _group; + }; + + if (_type == "TCL_Default") exitWith + { + (TCL_Default select 0) pushBack _group; + }; + + if (_type == "TCL_Disabled") exitWith + { + (TCL_Disabled select 0) pushBack _group; + }; + + if (_type == "TCL_Enhanced") exitWith + { + (TCL_Freeze select 0) pushBack _group; + + (TCL_Default select 0) pushBack _group; + + (TCL_Enhanced select 0) pushBack _group; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Groups Function #7 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _random = (random 15); + + private _units = (units _group); + + private _leader = (leader _group); + + _group setVariable ["TCL_Move", 5]; + + private _vehicle = (vehicle _leader); + + _group setVariable ["TCL_Enemy", objNull]; + + _group setVariable ["TCL_Watch", (time + _random) ]; + + _group setVariable ["TCL_Position", (getPos _leader) ]; + + _group setVariable ["TCL_Waypoint", (getPos _leader) ]; + + _group setVariable ["TCL_Behaviour", [ (behaviour _leader), (combatMode _group), (formation _group), (speedMode _group) ] ]; + + if (getArray (configfile >> "CfgVehicles" >> (typeOf _vehicle) >> "availableForSupportTypes") select 0 isEqualTo "Artillery") then + { + (TCL_Artillery select 0) pushBack _group; + + _group setVariable ["TCL_Artillery", True]; + + if (_group in (TCL_Location select 0) ) exitWith + { + TCL_DeleteAT(TCL_Location,0,_group); + }; + + // player sideChat format ["TCL_Groups_F > Artillery > %1", _group]; + }; + + if (isNil { (_group getVariable "TCL_AI") } )then + { + _group setVariable ["TCL_AI", TCL_AI]; + } + else + { + private _text = format ["%1The 'TCL_AI' settings of %2 are not configurated properly!
Please check the 'TCL_AI' settings of %2 and correct them.", (TCL_Text_F select 3), _group]; + + private _array = TCL_AI; + + private _ai = (_group getVariable "TCL_AI"); + + if (_array isEqualTypeArray _ai) then + { + _text = _text; + } + else + { + hint parseText _text; + }; + }; + + if (_group getVariable "TCL_AI" select 7) then + { + ["TCL_Freeze", _group] call (TCL_Groups_F select 6); + }; + + if (_group getVariable "TCL_AI" select 8) then + { + ["TCL_Default", _group] call (TCL_Groups_F select 6); + }; + + // player sideChat format ["TCL_Groups_F > Conditions > %1", _group]; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Macros.hpp b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Macros.hpp new file mode 100644 index 0000000..37d1f24 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Macros.hpp @@ -0,0 +1,9 @@ +/* //////////////////////////////////////////////////////////////////////////////// +\ \ Tactical Combat Link + \ \------------------------------------------------------------------------------ + \ \ Macros + \ \---------------------------------------------------------------------------- + / / By =\SNKMAN/= + / /----------------------------------------------------------------------------- +*/ /////////////////////////////////////////////////////////////////////////////// +#define TCL_DeleteAT(_array, _index, _object); (_array select _index) deleteAt ( (_array select _index) find _object); \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Players_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Players_F.sqf new file mode 100644 index 0000000..b8d9a6e --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Players_F.sqf @@ -0,0 +1,49 @@ +TCL_Players_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Players Function #0 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_players"]; + + (TCL_Players select 0) append _players; + + private ["_player","_group","_leader"]; + + private _count = 0; + + for "_count" from _count to (count _players - 1) do + { + _player = (_players select _count); + + _group = (group _player); + + _leader = (leader _group); + + [_player] call (TCL_Marker_F select 0); + + if (_player == _leader) then + { + (TCL_Players select 2) pushBackUnique _group; + + { [_x] call (TCL_Marker_F select 0) } forEach units _player; + }; + + _player setVariable ["TCL_Suppressed", time]; + + if (TCL_Dedicated) then + { + _player addEventHandler ["FiredMan", {_this call (TCL_EH_Fired_F select 0) } ]; + }; + }; + + if (TCL_System select 3) then + { + (TCL_Players select 1) append _players; + }; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Units_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Units_F.sqf new file mode 100644 index 0000000..a273f0e --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Units_F.sqf @@ -0,0 +1,50 @@ +TCL_Units_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Units Function #0 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_units"]; + + private ["_unit","_vehicle","_weapon","_ammo"]; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + _unit allowFleeing 0; + + _unit disableAI "TARGET"; + + _vehicle = (vehicle _unit); + + if (_vehicle isKindOf "StaticWeapon") then + { + private _group = (group _unit); + + (TCL_Static_Weapon select 0) pushBack _unit; + + (TCL_Static_Weapon select 1) pushBack _vehicle; + + [_unit, _group, _vehicle] spawn (TCL_Static_Weapon_F select 3); + }; + + [_unit] call (TCL_Skill_F select 0); + + [_unit] call (TCL_Marker_F select 0); + + _unit setVariable ["TCL_Take_Cover", [time, [], (getPos _unit) ] ]; + }; + + if (TCL_System select 3) then + { + (TCL_Players select 1) append _units; + }; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Vehicles_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Vehicles_F.sqf new file mode 100644 index 0000000..83385b7 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Initialize_F/TCL_Vehicles_F.sqf @@ -0,0 +1,33 @@ +TCL_Vehicles_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Vehicles Function #0 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicles"]; + + (TCL_Vehicles select 0) append _vehicles; + + private "_vehicle"; + + private _count = 0; + + for "_count" from _count to (count _vehicles - 1) do + { + _vehicle = (_vehicles select _count); + + if (TCL_Multiplayer) then + { + _vehicle addMPEventHandler ["MPKilled", {_this call (TCL_EH_Killed_F select 0) } ]; + } + else + { + _vehicle addEventHandler ["Killed", {_this call (TCL_EH_Killed_F select 0) } ]; + }; + }; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Macros.hpp b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Macros.hpp new file mode 100644 index 0000000..37d1f24 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Macros.hpp @@ -0,0 +1,9 @@ +/* //////////////////////////////////////////////////////////////////////////////// +\ \ Tactical Combat Link + \ \------------------------------------------------------------------------------ + \ \ Macros + \ \---------------------------------------------------------------------------- + / / By =\SNKMAN/= + / /----------------------------------------------------------------------------- +*/ /////////////////////////////////////////////////////////////////////////////// +#define TCL_DeleteAT(_array, _index, _object); (_array select _index) deleteAt ( (_array select _index) find _object); \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Assign_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Assign_F.sqf new file mode 100644 index 0000000..b90eefe --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Assign_F.sqf @@ -0,0 +1,154 @@ +TCL_Assign_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Assign Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Assign + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_units","_group"]; + + private _return = True; + + if (_units isEqualTo [] ) exitWith {_return = False}; + + private _unit = (_units select 0); + + if (isNull objectParent _unit) then + { + private _objects = _unit nearEntities ["Car", 100]; + + private _array = ( (TCL_Assign select 0) + (TCL_Stuck select 0) ); + + _objects = _objects - _array; + + _objects = _objects select { ( (alive _x) && { (fuel _x > 0) } && { (canMove _x) } && { (_unit knowsAbout _x > 0) } ) }; + + if (_objects isEqualTo [] ) exitWith {}; + + private ["_vehicle","_side","_crew"]; + + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _vehicle = (_objects select _count); + + _side = False; + + if (getNumber (configFile >> "CfgVehicles" >> (typeOf _unit) >> "side") isEqualTo getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "side") ) then + { + _side = True; + }; + + _crew = (crew _vehicle); + + if ( (_side) && { (_crew isEqualTo [] ) } ) exitWith + { + _return = False; + + (TCL_Assign select 0) pushBack _vehicle; + + [_units, _group, _vehicle] call (TCL_Assign_F select 1); + }; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Assign Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Assign + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_units","_group","_vehicle"]; + + private _leader = (leader _group); + + if (_group in (TCL_Artillery select 0) ) exitWith {}; + + // player sideChat format ["TCL_Assign_F > Vehicle > %1", _vehicle]; + + _units select { (_x in (TCL_Static_Weapon select 0) ) } apply {_x leaveVehicle assignedVehicle _x; [_x] orderGetIn False; [_x] allowGetIn False}; + + {if (_x in assignedVehicle _x) then {_units = _units - [_x] } else {if (count assignedVehicleRole _x > 0) then {_units = _units - [_x]; [_x] orderGetIn True; [_x] allowGetIn True} } } count _units; + + if (_units isEqualTo [] ) exitWith {True}; + + _units = [_units, _vehicle] call (TCL_Assign_F select 2); + + if (_units isEqualTo [] ) exitWith {True}; + + {_x assignAsCargo _vehicle} count _units; + + {if (assignedVehicle _x == _vehicle) then {_units = _units - [_x]; [_x] orderGetIn True; [_x] allowGetIn True} } count _units; + + if (_units isEqualTo [] ) exitWith {True}; + + [_units, _group, _vehicle] call (TCL_Assign_F select 0); + + // player sideChat format ["TCL_Assign_F > Units > %1", _units]; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Assign Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Assign + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_units","_vehicle"]; + + private _positions = ["Driver","Gunner","Commander"]; + + private ["_position","_unit"]; + + while { (count _positions > 0) } do + { + _position = (_positions select 0); + + if (_units isEqualTo [] ) exitWith {}; + + // player sideChat format ["TCL_Assign_F > Positions > %1", _positions]; + + if (_vehicle emptyPositions _position > 0) then + { + _unit = (_units select 0); + + if (alive _unit) then + { + if (_position isEqualTo "Driver") exitWith + { + _unit assignAsDriver _vehicle; + }; + + if (_position isEqualTo "Gunner") exitWith + { + _unit assignAsGunner _vehicle; + }; + + if (_position isEqualTo "Commander") exitWith + { + _unit assignAsCommander _vehicle; + }; + }; + + _units deleteAt (_units find _unit); + + [_unit] orderGetIn True; [_unit] allowGetIn True; + + // player sideChat format ["TCL_Assign_F > Position > %1 > %2", _unit, _position]; + }; + + _positions deleteAt (_positions find _position); + }; + + _units + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Behaviour_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Behaviour_F.sqf new file mode 100644 index 0000000..57645eb --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Behaviour_F.sqf @@ -0,0 +1,212 @@ +#include "TCL_Macros.hpp" + +TCL_Behaviour_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Behaviour Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Behaviour + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private ["_behaviour","_combatMode","_speedMode","_formation"]; + + private _units = (units _group); + + private _leader = (leader _group); + + if (_group in (TCL_Reinforcement select 1) ) then + { + if (isNull objectParent _leader) then + { + _behaviour = "AWARE"; + } + else + { + _behaviour = selectRandom ["SAFE","SAFE","AWARE","AWARE"]; + + private _vehicle = (vehicle _leader); + + if (_vehicle isKindOf "Air") then + { + _behaviour = "AWARE"; + }; + }; + + _combatMode = "YELLOW"; + + if (combatMode _group isEqualTo "RED") then + { + _combatMode = "RED"; + + (TCL_Red select 0) pushBack _group; + }; + + if (_group in (TCL_Sneaking select 0) ) then + { + _behaviour = (behaviour _leader); + _combatMode = (combatMode _group); + }; + + if (speedMode _group isEqualTo "NORMAL") then + { + (TCL_Speed select 0) pushBack _group; + } + else + { + _group setVariable ["TCL_Speed", (speedMode _group) ]; + }; + + _speedMode = selectRandom ["FULL","FULL","FULL","FULL"]; + _formation = selectRandom ["WEDGE","COLUMN","STAG COLUMN"]; + } + else + { + _behaviour = "COMBAT"; + + private _random = (TCL_Tweak select 0); + + if (floor (random 100) < _random) then + { + {_x disableAI "AUTOCOMBAT"} count _units; + + _behaviour = "AWARE"; + }; + + _combatMode = "YELLOW"; + + if (_group in (TCL_Red select 0) ) then + { + _combatMode = "RED"; + } + else + { + if (floor (random 100) < 50) then + { + _combatMode = "RED"; + }; + }; + + if (_group in (TCL_Sneaking select 0) ) then + { + _behaviour = (behaviour _leader); + _combatMode = (combatMode _group); + }; + + _formation = selectRandom ["WEDGE","WEDGE","ECH LEFT","ECH RIGHT","VEE"]; + + if (_group in (TCL_Speed select 0) ) then + { + _speedMode = selectRandom ["NORMAL","FULL"]; + } + else + { + _speedMode = (_group getVariable "TCL_Speed"); + }; + }; + + if (behaviour _leader isEqualTo "STEALTH") then + { + _behaviour = "STEALTH"; + }; + + _group setSpeedMode _speedMode; + + _group setFormation _formation; + + _group setBehaviour _behaviour; + + _group setCombatMode _combatMode; + + _units doFollow _leader; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Behaviour Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Behaviour + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + private _units = (units _group); + + private _leader = (leader _group); + + {_x setUnitPos "AUTO"} count _units; + + private _speedMode = (speedMode _group); + + private _formation = (formation _group); + + private _behaviour = (behaviour _leader); + + (TCL_Behaviour select 0) pushBack _group; + + private _combatMode = (combatMode _group); + + if (_leader distance _logic > 300) then + { + [_enemy, _group, _logic] spawn (TCL_Unassign_F select 0); + }; + + // player sideChat format ["TCL_Behaviour_F > Group > %1", _group]; + + _group setSpeedMode "FULL"; + + _group setBehaviour "AWARE"; + + _group setCombatMode "YELLOW"; + + if (floor (random 100) < 35) then + { + _group setFormation "WEDGE"; + } + else + { + _group setFormation "STAG COLUMN"; + }; + + _units = _units - (TCL_Helicopter select 0); + + _units doFollow _leader; + + {_x forceSpeed -1} count _units; + + private ["_waypoint","_knowsAbout"]; + + while { ( (units _group findIf { (alive _x) } > -1) && { (_group in (TCL_Reinforcement select 0) ) } ) } do + { + _waypoint = (_group getVariable "TCL_Waypoint"); + + _knowsAbout = (_group getVariable "TCL_KnowsAbout"); + + if (_knowsAbout == 0) exitWith + { + _group setSpeedMode _speedMode; + + _group setFormation _formation; + + _group setBehaviour _behaviour; + + _group setCombatMode _combatMode; + }; + + if (_leader distance _waypoint < 100) then + { + if (behaviour _leader isEqualTo _behaviour) exitWith {}; + + _group setBehaviour _behaviour; + }; + + sleep 5; + }; + + TCL_DeleteAT(TCL_Behaviour,0,_group); + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Enemy_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Enemy_F.sqf new file mode 100644 index 0000000..09c8791 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Enemy_F.sqf @@ -0,0 +1,136 @@ +#include "TCL_Macros.hpp" + +TCL_Enemy_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Enemy Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Enemy + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group"]; + + private _leader = (leader _group); + + private _units = (TCL_Players select 0); + + if (TCL_System select 3) then + { + _units = (TCL_Players select 1); + }; + + _units = _units select { ( (alive _x) && { (side _group getFriend side _x < 0.6) } ) }; + + if (alive _enemy) then + { + _units = _units select { ( ( (_group knowsAbout vehicle _x) >= (_group knowsAbout vehicle _enemy) ) && { ( (_leader distance _x) < (_leader distance _enemy) ) } ) }; + }; + + private "_unit"; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + if (_group knowsAbout vehicle _unit > 0 ) exitWith + { + _enemy = _unit; + }; + }; + + _enemy + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Enemy Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Enemy + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + private _knowsAbout = (_group getVariable "TCL_KnowsAbout"); + + private _ai = (_group getVariable "TCL_AI" select 10); + + private _value = ["TCL_Time", (time + _ai) ]; + + if ( (alive _enemy) && { (_group knowsAbout vehicle _enemy > 0) } ) then + { + _knowsAbout = 0; + + _logic setVariable _value; + + _group setVariable _value; + } + else + { + if (_group in (TCL_Reinforcement select 1) ) then + { + _knowsAbout = 0; + } + else + { + if (_knowsAbout > 3) then + { + private _time = (_group getVariable "TCL_Time"); + + if (time > _time) then + { + private _array = ( (TCL_Hold select 0) + (TCL_Join select 0) + (TCL_Defend select 0) + (TCL_Artillery select 0) ); + + if (_group in _array) then + { + (TCL_Retreat select 0) pushBack _group; + } + else + { + _group setVariable _value; + }; + }; + }; + + _knowsAbout = _knowsAbout + 1; + }; + }; + + _group setVariable ["TCL_KnowsAbout", _knowsAbout]; + + if (_knowsAbout == 3) then + { + (TCL_Reinforcement select 2) pushBack _group; + } + else + { + if (_knowsAbout == 0) then + { + if (_group in (TCL_Reinforcement select 2) ) then + { + TCL_DeleteAT(TCL_Reinforcement,2,_group); + }; + }; + }; + + if (_group in (TCL_Sneaking select 0) ) then + { + private _leader = (leader _group); + + if ( (_leader distance _logic < 100) || ( [_enemy, _group] call (TCL_Sneaking_F select 0) ) ) then + { + private _units = (units _group); + + {_x setUnitPos "AUTO"} count _units; + + TCL_DeleteAT(TCL_Sneaking,0,_group); + + [_group] call (TCL_Behaviour_F select 0); + }; + }; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Helicopter_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Helicopter_F.sqf new file mode 100644 index 0000000..047ef38 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Helicopter_F.sqf @@ -0,0 +1,210 @@ +TCL_Helicopter_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Helicopter Function #0 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_logic","_vehicle"]; + + private _array = []; + + private _bool = False; + + private _cargo = True; + + private _units = (units _group); + + if (_group getVariable "TCL_Eject") then + { + private "_unit"; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + if (assignedVehicleRole _unit select 0 == "Cargo") then + { + _array pushBack _unit; + + if (backpack _unit isEqualTo "B_Parachute") then + { + _unit action ["EJECT", _vehicle]; + + _unit allowDamage False; + + _array pushBack _unit; + + sleep 1 - (random 1); + } + else + { + _bool = True; + }; + + [_unit] orderGetIn False; [_unit] allowGetIn False; + }; + }; + } + else + { + _bool = True; + + _units select { (assignedVehicleRole _x select 0 == "Cargo") } apply {if ( (floor (random 100) < 35) && { (count (assignedVehicleRole _x) > 1) } ) then {_cargo = False} else {_array pushBack _x; [_x] orderGetIn False; [_x] allowGetIn False} }; + }; + + private _crew = (crew _vehicle); + + _crew = _crew - _array; + + if (_bool) then + { + _vehicle flyInHeight 100; + + _vehicle land "GET OUT"; + }; + + if (count _array > 0) then + { + while { (_array findIf { (_x in _vehicle) } > -1) } do + { + sleep 5; + }; + + {_x allowDamage True} count _array; + + private _leader = (leader _group); + + if (_leader in _array) then + { + _group setVariable ["TCL_Helicopter", (driver _vehicle) ]; + } + else + { + _group setVariable ["TCL_Helicopter", _leader]; + + _leader = (_array select 0); + + _group selectLeader _leader; + + {_x setUnitRank "PRIVATE"} count _crew; + + _array select { (rank _x isEqualTo "PRIVATE") } apply {_x setUnitRank "CORPORAL"}; + }; + }; + + private _random = 75; + + private _driver = (driver _vehicle); + + private _gunner = (gunner _vehicle); + + if ( (alive _gunner) && { (canFire _vehicle) } && { (someAmmo _vehicle) } ) then + { + _random = 50; + }; + + _vehicle flyInHeight 100; + + if ( (alive _logic) && { (_cargo) } && { (floor (random 100) < _random) } ) then + { + private _crew = (crew _vehicle); + + (TCL_Helicopter select 0) append _crew; + + _position = (_group getVariable "TCL_Position"); + + sleep 5 + (random 10); + + _driver doMove _position; + + private _land = "Land_HelipadEmpty_F" createVehicleLocal _position; + + while { ( (alive _vehicle) && { (_vehicle distance2D _position > 100) } ) } do + { + sleep 1; + }; + + if (alive _logic) then + { + _vehicle land "LAND"; + + {doStop _x} count _crew; + + while { (getPos _vehicle select 2 > 10) } do + { + sleep 1; + }; + }; + + deleteVehicle _land; + } + else + { + _vehicle flyInHeight 50; + + if (floor (random 100) < 50) then + { + _group selectLeader _driver; + }; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Helicopter Function #1 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_crew","_vehicle"]; + + _vehicle forceSpeed -1; + + private _units = (units _group); + + private _leader = (leader _group); + + private _driver = (driver _vehicle); + + private _position = (_group getVariable "TCL_Position"); + + _units = _units - _crew; + + if (_units findIf { (alive _x) } > -1) then + { + private _unit = (_units select 0); + + {if (_x == _leader) exitWith {_unit = _x} } count _units; + + _driver doMove (getPos _unit); + + while { (_vehicle distance2D _unit > 100) } do + { + sleep 1; + }; + + if (floor (random 100) < 50) then + { + _vehicle land "LAND"; + } + else + { + _vehicle land "GET IN"; + }; + }; + + _group move _position; + + [_group] call (TCL_Remount_F select 2); + + while { ( (alive _vehicle) && { (_vehicle distance2D _position > 100) } ) } do + { + sleep 1; + }; + + _vehicle land "LAND"; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Join_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Join_F.sqf new file mode 100644 index 0000000..c64d700 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Join_F.sqf @@ -0,0 +1,87 @@ +TCL_Join_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Join Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Join + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_logic","_units"]; + + private _ai = (_group getVariable "TCL_AI" select 8); + + if (_ai) then + { + private _array = ( (TCL_Hold select 0) + (TCL_Defend select 0) + (TCL_Location select 0) ); + + if (_group in _array) exitWith {}; + + if (_units < 3) then + { + private _groups = (_logic getVariable "TCL_Reinforcement"); + + _groups = _groups - [_group]; + + _groups = _groups select { (side _group isEqualTo side _x) }; + + if (_groups isEqualTo [] ) exitWith {}; + + [_group, _logic, _units, _groups] call (TCL_Join_F select 1); + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Join Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Join + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_logic","_units","_groups"]; + + private _alpha = _group; + + private _leader = (leader _alpha); + + if (_leader == vehicle _leader) then + { + private _rank = [_leader] call TCL_Rank_F; + + private "_bravo"; + + private _count = 0; + + for "_count" from _count to (count _groups - 1) do + { + _bravo = (_groups select _count); + + _condition = (units _bravo) select { ( (alive _x) && { (isNull objectParent _x) } && { (_x distance _leader < 100) } ) }; + + if ( (_units <= count _condition) && { (_rank <= [leader _bravo] call TCL_Rank_F) } && { ( [_alpha, _bravo] call (TCL_KnowsAbout_F select 4) ) } ) exitWith + { + private _units = (units _alpha); + + ["TCL_Position", _alpha] call (TCL_Marker_F select 0); + + // player sideChat format ["TCL_Join_F > Group > %1", _alpha]; + + _groups = (_logic getVariable "TCL_Reinforcement"); + + _groups deleteAt (_groups find _alpha); + + _units join _bravo; + + (TCL_Regroup select 0) append _units; + + _units select { (count assignedVehicleRole _x > 0) } apply { [_x] orderGetIn False; [_x] allowGetIn False}; + }; + }; + }; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_KnowsAbout_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_KnowsAbout_F.sqf new file mode 100644 index 0000000..08c1458 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_KnowsAbout_F.sqf @@ -0,0 +1,205 @@ +TCL_KnowsAbout_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // KnowsAbout Function #0 + // //////////////////////////////////////////////////////////////////////////// + // KnowsAbout + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _units = (TCL_Players select 0); + + if (TCL_System select 3) then + { + _units = (TCL_Players select 1); + }; + + _units = _units select { ( (alive _x) && { (_group knowsAbout vehicle _x > 0) } && { (side _group getFriend side _x < 0.6) } ) }; + + private "_unit"; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + if ( [_unit, _group] call (TCL_KnowsAbout_F select 1) ) exitWith + { + private _enemy = _unit; + + private _logic = [_enemy] call (TCL_Logic_F select 0); + + (TCL_Logic select 0) pushBack _logic; + + _logic setVariable ["TCL_Group", (group _enemy) ]; + + _logic setVariable ["TCL_Units", (units _enemy) ]; + + ["TCL_Logic", _logic] call (TCL_Marker_F select 0); + + _logic setVariable ["TCL_Artillery", [True, False] ]; + + [_enemy, _group, _logic] call (TCL_Reinforcement_F select 0); + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // KnowsAbout Function #1 + // //////////////////////////////////////////////////////////////////////////// + // KnowsAbout + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group"]; + + if (_group in (TCL_Reinforcement select 0) ) exitWith {_return = False}; + + private _return = True; + + private _array = (TCL_Logic select 0); + + private _ai = (_group getVariable "TCL_AI"); + + private "_logic"; + + private _count = 0; + + for "_count" from _count to (count _array - 1) do + { + _logic = (_array select _count); + + if ( [_enemy, _group, _logic] call (TCL_KnowsAbout_F select 2) ) exitWith + { + _return = False; + + if (_ai select 3) then + { + _return = True; + } + else + { + private _bool = False; + + if (_group knowsAbout vehicle _enemy > (_ai select 4) ) then + { + _bool = True; + } + else + { + private _leader = (leader _group); + + if (_leader distance _logic < (_ai select 5) ) then + { + _bool = True; + }; + }; + + if (_bool) then + { + if (_ai select 6) then + { + (TCL_Join select 0) pushBack _group; + }; + + [_enemy, _group, _logic] call (TCL_Reinforcement_F select 0); + }; + }; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // KnowsAbout Function #2 + // //////////////////////////////////////////////////////////////////////////// + // KnowsAbout + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + private _return = False; + + private _groups = (_logic getVariable "TCL_Reinforcement"); + + if (_groups findIf { (side _group getFriend side _x < 0.6) } > -1) exitWith {_return}; + + if ( (group _enemy) isEqualTo (_logic getVariable "TCL_Group") ) then + { + _return = True; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // KnowsAbout Function #3 + // //////////////////////////////////////////////////////////////////////////// + // KnowsAbout + // By =\SNKMAN/= + // Used: TCL_System.fsm + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + private _time = (TCL_Radio select 1); + + private _random = (random _time); + + _time = (_time + _random); + + _skill = [_group] call TCL_Accuracy_F; + + _time = (_time / _skill); + + // player sideChat format ["TCL_KnowsAbout_F > Time > %1 > %2 > %3", _group, _skill, (round _time) ]; + + _time = (time + _time); + + private _return = _time; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // KnowsAbout Function #4 + // //////////////////////////////////////////////////////////////////////////// + // KnowsAbout + // By =\SNKMAN/= + // Used: Join Function #1 Reveal Function #1 + // //////////////////////////////////////////////////////////////////////////// + {params ["_echo","_kilo"]; + + private _return = False; + + private _units = (units _kilo); + + private _value = (TCL_IQ select 0); + + private _knowsAbout = (_units findIf { ( (alive _x) && { (_echo knowsAbout vehicle _x > _value) } ) } ); + + if (_knowsAbout == -1) then + { + _units = (units _echo); + + _knowsAbout = (_units findIf { ( (alive _x) && { (_kilo knowsAbout vehicle _x > _value) } ) } ); + }; + + if (_knowsAbout > -1) then + { + _return = True; + }; + + // player sideChat format ["TCL_KnowsAbout_F > KnowsAbout > %1 > %2", _echo, _knowsAbout]; + + _return + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Logic_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Logic_F.sqf new file mode 100644 index 0000000..69113eb --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Logic_F.sqf @@ -0,0 +1,67 @@ +#include "TCL_Macros.hpp" + +TCL_Logic_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Logic Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Logic + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy"]; + + private _side = createCenter sideLogic; + + private _group = createGroup _side; + + private _logic = _group createUnit ["Logic", (getPos _enemy), [], 0, "NONE"]; + + [_logic] join _group; + + _logic allowDamage False; + + _logic + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Logic Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Logic + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_logic","_spot"]; + + if (alive _spot) then + { + deleteVehicle _spot; + }; + + private _units = (units _group); + + private _array = (_logic getVariable "TCL_Reinforcement"); + + {TCL_DeleteAT(TCL_Reinforcement,_x,_group) } forEach [0,1,2]; + + {TCL_DeleteAT(_x,0,_group) } forEach [TCL_Red, TCL_Join, TCL_Retreat, TCL_Request, TCL_Waiting, TCL_Sneaking, TCL_Flanking, TCL_Behaviour]; + + if (_units findIf { (alive _x) } < 0) then + { + ["TCL_Position", _group] call (TCL_Marker_F select 0); + }; + + _array deleteAt (_array find _group); + + if (_array isEqualTo [] ) then + { + TCL_DeleteAT(TCL_Logic,0,_logic); + + ["TCL_Delete", _logic] call (TCL_Marker_F select 0); + + deleteVehicle _logic; + }; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Macros.hpp b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Macros.hpp new file mode 100644 index 0000000..37d1f24 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Macros.hpp @@ -0,0 +1,9 @@ +/* //////////////////////////////////////////////////////////////////////////////// +\ \ Tactical Combat Link + \ \------------------------------------------------------------------------------ + \ \ Macros + \ \---------------------------------------------------------------------------- + / / By =\SNKMAN/= + / /----------------------------------------------------------------------------- +*/ /////////////////////////////////////////////////////////////////////////////// +#define TCL_DeleteAT(_array, _index, _object); (_array select _index) deleteAt ( (_array select _index) find _object); \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Move_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Move_F.sqf new file mode 100644 index 0000000..3e00c1d --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Move_F.sqf @@ -0,0 +1,244 @@ +TCL_Move_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Move Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Move + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic","_array","_spot","_waypoint"]; + + private _leader = (leader _group); + + private _position = (_group getVariable "TCL_Position"); + + if ( [_enemy, _group, _logic] call (TCL_Move_F select 1) ) then + { + _position = [_enemy, _group, _logic, _array] call (TCL_Move_F select 2); + }; + + if ( (_leader distance _position > 10) || (_leader distance _waypoint > 10) ) then + { + _group move _position; + + if (alive _spot) then + { + _spot setPos _position; + }; + }; + + _group setVariable ["TCL_Waypoint", _position]; + + ["TCL_Position", _group, _position] call (TCL_Marker_F select 0); + + // player sideChat format ["TCL_Move_F > Group > %1 > %2", _group, _position]; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Move Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Move + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + private _return = False; + + if (_group in (TCL_Hold select 0) ) then + { + if ( [_group, _logic] call TCL_Trigger_F ) then + { + _return = True; + }; + } + else + { + if (_group in (TCL_Waiting select 0) ) then + { + if ( [_enemy, _group, _logic] call (TCL_Waiting_F select 0) ) then + { + _return = True; + + TCL_Waiting set [0, (TCL_Waiting select 0) - [_group] ]; + }; + } + else + { + _return = True; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Move Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Move + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic","_array"]; + + private "_position"; + + private _knowsAbout = 0; + + if (alive _enemy) then + { + _knowsAbout = (_group knowsAbout vehicle _enemy); + }; + + private _value = 100; + + private _distance = 0; + + private _object = _logic; + + private _leader = (leader _group); + + private _direction = (random 360); + + if (_knowsAbout > 0) then + { + private _count = (count _array); + + // if ( (_count > 0) || { (floor (random 100) < 50) } ) then + + if (_count > 0) then + { + if (_count == 0) then + { + _count = 1; + }; + + private _units = (units _group); + + private _range = (TCL_Tweak select 1); + + private _random = (TCL_Tweak select 2); + + if (_leader distance _logic < _range) then + { + if (combatmode _group isEqualTo "RED") then + { + _random = (_random + 15); + }; + + if (_leader in _array) then + { + if (isNull objectParent _leader) exitWith {}; + + _random = (_random / _count); + + // player sideChat format ["TCL_Move_F > Leader > %1 > %2 > %3", _group, _random, _count]; + }; + } + else + { + _random = 100; + }; + + if (floor (random 100) < _random) then + { + _distance = (_leader distance _enemy); + + private _tweak = (TCL_Tweak select 3); + + _value = 1 + (random _tweak); + + _distance = (_distance / _value); + + // player sideChat format ["TCL_Move_F > Move > %1 > %2 > %3%4 > %5 > %6 > %7 > %8", _group, (count _array), (round _random), "%", round (_leader distance _enemy), (round _range), (behaviour _leader), (combatMode _group ) ]; + } + else + { + _distance = 0; + + _object = _leader; + + // player sideChat format ["TCL_Move_F > Stop > %1 > %2 > %3 > %4 > %5 > %6 > %7%8", _group, round (_leader distance _enemy), (behaviour _leader ), (combatMode _group), (count _array), (round _range), (round _random), "%"]; + }; + + // player sideChat format ["TCL_Move_F > Visible > %1 > %2 > %3 > %4 > %5", _group, _range, round (_leader distance _enemy), (combatMode _group), (behaviour _leader ) ]; + + _direction = (_enemy getDir _leader); + + if (floor (random 100) < 50) then + { + _random = (random 10 - random 10); + + _direction = (_direction + _random); + }; + + // player sideChat format ["TCL_Move_F > Direction > %1 > %2", _group, _direction]; + } + else + { + _skill = [_group] call TCL_Accuracy_F; + + _value = (_value / _skill); + + _distance = (random _value - random _value); + + // player sideChat format ["TCL_Move_F > Random > %1 > %2 > %3", _group, _skill, _value]; + + // player sideChat format ["TCL_Move_F > Random > %1 > %2 > %3 > %4 > %5", _group, round (_leader distance _enemy), (behaviour _leader ), (combatMode _group), (count _array) ]; + }; + } + else + { + _distance = (random _value - random _value); + + if (alive _enemy) then + { + if ( (group _enemy) isEqualTo (_logic getVariable "TCL_Group") ) then + { + _groups = (_logic getVariable "TCL_Reinforcement"); + + {if (_x knowsAbout vehicle _enemy > 0) exitWith {_logic setPos (getPos _enemy) } } count _groups; + }; + }; + }; + + if (vehicle _leader isKindOf "Ship") then + { + _direction = (_enemy getDir _leader); + + _distance = (_leader distance _enemy); + + _distance = (_distance - 300); + + private _position = [_object, _distance, _direction] call TCL_Real_Pos_F; + + if (surfaceIsWater _position) then + { + _distance = _distance; + } + else + { + _distance = (_distance + 200); + }; + }; + + if (_logic getVariable "TCL_Artillery" select 1) then + { + if (_leader distance _logic < 200) then + { + _distance = 0; + + _object = _leader; + + // player sideChat format ["TCL_Move_F > Artillery > %1", _group]; + }; + }; + + _position = [_object, _distance, _direction] call TCL_Real_Pos_F; + + _position + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Radio_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Radio_F.sqf new file mode 100644 index 0000000..4825dfe --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Radio_F.sqf @@ -0,0 +1,108 @@ +TCL_Radio_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Radio Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Radio + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_x"]; + + private _return = True; + + if (TCL_Radio select 0) then + { + _return = False; + + private _bool = [_group] call (TCL_Radio_F select 1); + + if (_bool) then + { + private _leader = (leader _group); + + private _distance = [_group] call (TCL_Radio_F select 2); + + if (_leader distance leader _x < _distance) then + { + _bool = [_x] call (TCL_Radio_F select 1); + + if (_bool) then + { + _leader = (leader _x); + + _distance = [_x] call (TCL_Radio_F select 2); + + if (_leader distance leader _group < _distance) then + { + _return = True; + }; + }; + }; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Radio Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Radio + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _return = False; + + private _units = (units _group); + + if (_units findIf { ( (alive _x) && ( ("ItemRadio" in items _x) || ("ItemRadio" in assigneditems _x) ) ) } > -1) then {_return = True}; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Radio Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Radio + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _vehicle = (vehicle leader _group); + + private "_index"; + + if (True) then + { + if (_vehicle isKindOf "Man") exitWith + { + _index = 0; + }; + + if (_vehicle isKindOf "Car") exitWith + { + _index = 1; + }; + + if (_vehicle isKindOf "Tank") exitWith + { + _index = 2; + }; + + if (_vehicle isKindOf "Air") exitWith + { + _index = 3; + }; + + _index = 0; + }; + + private _return = (TCL_Radio select 2 select _index); + + _return + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Rating_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Rating_F.sqf new file mode 100644 index 0000000..8daad97 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Rating_F.sqf @@ -0,0 +1,125 @@ +TCL_Rating_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Rating Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Rating + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group"]; + + private _array = []; + + private _rating = []; + + private _units = (units _group); + + _array = (units _enemy) select { ( (alive _x) && { (_group knowsAbout vehicle _x > 0) } ) }; + + {_rating = [_x, _rating] call (TCL_Rating_F select 1) } count [_array, _units]; + + private _ai = (_group getVariable "TCL_AI" select 1); + + private _return = [_rating, _ai] call (TCL_Rating_F select 2); + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rating Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Rating + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_units","_rating"]; + + private _array = []; + + private _value = 0.01; + + private ["_unit","_vehicle"]; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + if (alive _unit) then + { + if ( (weapons _unit isEqualTo [] ) || (magazines _unit isEqualTo [] ) ) exitWith {}; + + _value = _value + 1; + + _array pushBack _unit; + }; + + _vehicle = (vehicle _unit); + + if (_vehicle in _array) then + { + _array = _array; + } + else + { + _array pushBack _vehicle; + + if ( (canFire _vehicle) && { (someAmmo _vehicle) } ) then + { + if (_vehicle isKindOf "Car") exitWith + { + _value = _value + 5; + }; + + if (_vehicle isKindOf "Tank") exitWith + { + _value = _value + 10; + }; + + if (_vehicle isKindOf "Air") exitWith + { + _value = _value + 15; + }; + + if (_vehicle isKindOf "Ship") exitWith + { + _value = _value + 15; + }; + + _value = _value + 1; + }; + }; + }; + + _rating pushBack _value; + + _rating + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Rating Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Rating + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_array","_ai"]; + + private _rating = ( (_array select 0) / (_array select 1) ); + + _rating = (_rating + 0.01) / 2; + + if (_rating > 1) then {_rating = 1}; + + private _return = False; + + if (_rating > _ai) then + { + _return = True; + }; + + _return + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Reinforcement_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Reinforcement_F.sqf new file mode 100644 index 0000000..973a072 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Reinforcement_F.sqf @@ -0,0 +1,285 @@ +#include "TCL_Macros.hpp" + +TCL_Reinforcement_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Reinforcement Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Reinforcement + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + private "_groups"; + + private _leader = (leader _group); + + private _ai = (_group getVariable "TCL_AI"); + + { (TCL_Reinforcement select _x) pushBack _group} forEach [0,1]; + + if (isNil { (_logic getVariable "TCL_Reinforcement") } ) then + { + (TCL_Request select 0) pushBack _group; + + _logic setVariable ["TCL_AI", _ai]; + + _logic setVariable ["TCL_Reinforcement", [_group] ]; + + if (_group in (TCL_Hold select 0) ) exitWith {}; + + if (floor (random 100) < 15) then + { + [_enemy, _group] call (TCL_Sneaking_F select 0); + + // player sideChat format ["TCL_Reinforcement_F > Sneaking > %1", _group]; + } + else + { + if ( (floor (random 100) < 35) && { ( { (alive _x) } count (units _group) < { (alive _x) } count (units _enemy) ) } ) then + { + if (_leader distance _enemy > 300) then + { + (TCL_Waiting select 0) pushBack _group; + + private _time = (time + 50); + + _time = _time + (random 70); + + _group setVariable ["TCL_Waiting", _time]; + }; + }; + }; + } + else + { + _groups = (_logic getVariable "TCL_Reinforcement"); + + _groups pushBack _group; + + if (floor (random 100) < 15) then + { + [_enemy, _group] call (TCL_Sneaking_F select 0); + }; + }; + + if (_group in (TCL_Location select 0) ) then + { + _groups = (_group getVariable "TCL_Location"); + + _ai set [2, count _groups]; + }; + + private _units = (units _group); + + if (_group in (TCL_Garrison select 0) ) then + { + // _units doFollow _leader; + + if (_group in (TCL_Hold select 0) ) exitWith {}; + + private _array = (_group getVariable "TCL_Garrison"); + + TCL_DeleteAT(TCL_Garrison,0,_group); + + TCL_Garrison set [1, (TCL_Garrison select 1) - _array]; + }; + + if (TCL_Feature select 19) then + { + if (floor (random 100) < (TCL_Feature select 20) ) then + { + if (floor (random 100) < 50) then + { + (TCL_Flanking select 3) pushBack _group; + }; + + [_group] call (TCL_Flanking_F select 0); + }; + }; + + private _time = (_ai select 10); + + _group setVariable ["TCL_Time", (time + _time) ]; + + [_enemy, _group, _logic] execFSM (TCL_Path+"TCL\TCL_Reinforcement_F\TCL_System.fsm"); + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Reinforcement Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Reinforcement + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + if (alive _enemy) then + { + if ( [_enemy, _group, _logic] call (TCL_Reinforcement_F select 2) ) then + { + private _x = [_enemy, _group] call (TCL_Reinforcement_F select 3); + + private _units = (units _x); + + if (_units findIf { (alive _x) } > -1) then + { + private _leader = (leader _x); + + if (_x in (TCL_Join select 0) ) exitWith + { + TCL_DeleteAT(TCL_Join,0,_x); + }; + + if (isNull objectParent _leader) then + { + _leader playMove "Acts_listeningToRadio_Loop"; + + [_leader] spawn + { + params ["_leader"]; + + private _value = 5 + (random 7); + + sleep _value; + + _leader switchMove ""; + }; + }; + + private _ai = (_logic getVariable "TCL_AI"); + + if (_ai select 11) then + { + _x setVariable ["TCL_AI", _condition]; + }; + + [_enemy, _x, _logic] call (TCL_Reinforcement_F select 0); + + private _vehicle = (vehicle _leader); + + if (_vehicle isKindOf "Helicopter") then + { + [_enemy, _group, _vehicle] spawn (TCL_Smoke_F select 0); + }; + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Reinforcement Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Reinforcement + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + private _return = False; + + private _groups = (_logic getVariable "TCL_Reinforcement"); + + if (_group in (TCL_Location select 0) ) then + { + private _array = (_group getVariable "TCL_Location"); + + {if (_x in _groups) then {_x = _x} else {_return = True} } count _array; + } + else + { + if (_group in (TCL_Join select 0) ) then + { + _return = False; + } + else + { + _groups = _groups - (TCL_Join select 0); + + private _ai = (_group getVariable "TCL_AI" select 2); + + _ai = _ai + 1; + + if (count _groups < _ai) then + { + _return = True; + }; + + // player sideChat format ["TCL_Reinforcement_F > Request > %1 > %2 > %3", _group, (count _groups), _ai]; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Reinforcement Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Reinforcement + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group"]; + + private _groups = (TCL_Groups select 0); + + if (_group in (TCL_Location select 0) ) then + { + _groups = (_group getVariable "TCL_Location"); + } + else + { + _groups = _groups - (TCL_Location select 0); + }; + + private _array = ( (TCL_Hold select 0) + (TCL_Zeus select 1) + (TCL_Defend select 0) + (TCL_Freeze select 0) + (TCL_Default select 0) + (TCL_Artillery select 0) + (TCL_Reinforcement select 0) ); + + _groups = _groups - _array; + + _groups append (TCL_Join select 0); + + private _return = grpNull; + + if (_groups isEqualTo [] ) exitWith {_return}; + + if ( [_enemy, _group] call (TCL_Rating_F select 0) ) then + { + private _leader = (leader _group); + + private _condition = [_group] call (TCL_Radio_F select 2); + + private ["_distance","_units","_bool"]; + + {_distance = (_leader distance leader _x); + + if (_distance < _condition) then + { + _units = (units _x); + + if ( (_units findIf { (alive _x) } > -1) && { (side _group getFriend side _x > 0.6) } ) then + { + if (side _x getFriend side _enemy < 0.6) then + { + _bool = [_group, _x] call (TCL_Radio_F select 0); + + if (_bool) then + { + _return = _x; + + _condition = _distance; + }; + }; + }; + }; + + } count _groups; + }; + + _return + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Remount_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Remount_F.sqf new file mode 100644 index 0000000..044a41c --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Remount_F.sqf @@ -0,0 +1,281 @@ +TCL_Remount_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Remount Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Remount + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _units = (units _group); + + private _leader = (leader _group); + + {_x setUnitPos "AUTO"} count _units; + + _group setVariable ["TCL_Enemy", objNull]; + + if (isNil { (_group getVariable "TCL_Helicopter") } ) then + { + _leader = _leader; + } + else + { + _leader = (_group getVariable "TCL_Helicopter"); + + if (alive _leader) then + { + _group selectLeader _leader; + } + else + { + _leader = (leader _group); + }; + }; + + private _vehicle = (assignedVehicle _leader); + + if ( (alive _vehicle) && { (canMove _vehicle) } ) then + { + _vehicle = _vehicle; + } + else + { + _vehicle = (vehicle _leader); + }; + + // player sideChat format ["TCL_Remount_F > Vehicle > %1", _vehicle]; + + [_group, _vehicle] call (TCL_Remount_F select 1); + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Remount Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Remount + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_vehicle"]; + + private _units = (units _group); + + private _leader = (leader _group); + + private _position = (_group getVariable "TCL_Position"); + + ["TCL_Remount", _group] call (TCL_Marker_F select 0); + + if (_leader in (TCL_Static_Weapon select 0) ) then + { + + } + else + { + _units select { (_x in (TCL_Static_Weapon select 0) ) } apply {_x leaveVehicle assignedVehicle _x; [_x] orderGetIn False; [_x] allowGetIn False}; + + // {if (_x in (TCL_Static_Weapon select 0) ) then {_x leaveVehicle assignedVehicle _x; [_x] orderGetIn False; [_x] allowGetIn False} } forEach _units; + }; + + if (True) then + { + if (_vehicle isKindOf "Ship") exitWith + { + [_group] call (TCL_Remount_F select 2); + }; + + if (_vehicle isKindOf "Helicopter") exitWith + { + private _crew = (crew _vehicle); + + if (_crew findIf { (alive _x) } > -1) then + { + [_group, _crew, _vehicle] spawn (TCL_Helicopter_F select 1); + }; + + TCL_Helicopter set [0, (TCL_Helicopter select 0) - _crew]; + }; + + if (_vehicle isKindOf "LandVehicle") exitWith + { + [_group] call (TCL_Remount_F select 2); + + // player sideChat format ["TCL_Remount_F > Vehicle > %1", (typeOf _vehicle) ]; + }; + }; + + _group lockWp False; + + _group move _position; + + _units doFollow _leader; + + [_group] call (TCL_Remount_F select 4); + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Remount Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Remount + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _vehicles = []; + + private _units = (units _group); + + private _leader = (leader _group); + + (TCL_Remount select 0) pushBack _group; + + private ["_unit","_vehicle"]; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + _vehicle = (assignedVehicle _unit); + + if (_vehicle in _vehicles) then + { + _vehicle = _vehicle; + } + else + { + if (_unit in _vehicle) then + { + _unit = _unit; + } + else + { + _vehicles pushBack _vehicle; + + TCL_Assign set [0, (TCL_Assign select 0) - [_vehicle] ]; + + ["TCL_Remount", _group, _vehicle] call (TCL_Marker_F select 0); + }; + }; + }; + + _units orderGetIn True; _units allowGetIn True; + + [_group, _vehicles] spawn (TCL_Remount_F select 3); + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Remount Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Remount + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_vehicles"]; + + private _units = (units _group); + + {_x forceSpeed 0} count _vehicles; + + while { (count _units > 0) } do + { + // player sideChat format ["TCL_Remount_F > Units > %1", _units]; + + _units = _units select { ( (alive _x) && { (isNull objectParent _x) } && { (count assignedVehicleRole _x > 0) } && { (assignedVehicle _x in _vehicles) } && { (_x in units _group) } ) }; + + if (_group in (TCL_Reinforcement select 0) ) exitWith + { + {if (_x distance assignedVehicle _x > 100) then { [_x] orderGetIn False; [_x] allowGetIn False} } count _units; + }; + + sleep 5; + }; + + {_x forceSpeed -1} count _vehicles; + + TCL_Remount set [0, (TCL_Remount select 0) - [_group] ]; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Remount Function #4 + // //////////////////////////////////////////////////////////////////////////// + // Remount + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + private _array = (_group getVariable "TCL_Behaviour"); + + _group setBehaviour (_array select 0); + + _group setCombatMode (_array select 1); + + _group setFormation (_array select 2); + + _group setSpeedMode (_array select 3); + + [_group] spawn (TCL_Remount_F select 5); + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Remount Function #5 + // //////////////////////////////////////////////////////////////////////////// + // Remount + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + if (_group in (TCL_Garrison select 2) ) then + { + private _bool = True; + + private _leader = (leader _group); + + private _position = (_group getVariable "TCL_Position"); + + private _distance = (_leader distance _position); + + private _time = (time + 30); + + _time = (_time + _distance); + + while { (_leader distance _position > 10) } do + { + if ( (time > _time) || (_group in (TCL_Reinforcement select 0) ) ) exitWith + { + _bool = False; + }; + + sleep 10; + }; + + if (_bool) then + { + private _units = (units _group); + + if (vehicle _leader isKindOf "Car") then + { + { [_x] orderGetIn False; [_x] allowGetIn False} count _units; + + sleep 10; + }; + + [_group] spawn (TCL_Garrison_F select 0); + }; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Reveal_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Reveal_F.sqf new file mode 100644 index 0000000..8355ee0 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Reveal_F.sqf @@ -0,0 +1,162 @@ +TCL_Reveal_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Reveal Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Reveal + // By =\SNKMAN/= + // Used: Unassign Function #3 + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_logic"]; + + private _units = (units _group); + + private _skill = [_group] call TCL_Accuracy_F; + + private _groups = (_logic getVariable "TCL_Reinforcement"); + + // player sideChat format ["TCL_Reveal_F > TCL_Unassign_F > %1", _groups]; + + _groups = _groups - [_group]; + + private ["_enemy","_bool","_knowsAbout","_knowledge","_random"]; + + {_enemy = (_x getVariable "TCL_Enemy"); + + _bool = [_group, _x] call (TCL_Radio_F select 0); + + if ( (alive _enemy) && { (_bool) } ) then + { + _knowsAbout = (_x knowsAbout vehicle _enemy); + + if (_knowsAbout > (_group knowsAbout vehicle _enemy) ) then + { + _bool = [_group, _x] call (TCL_KnowsAbout_F select 4); + + if (_bool) then + { + _knowledge = (_group knowsAbout vehicle _enemy); + + _random = (random _knowsAbout); + + _random = (_random * _skill); + + _knowledge = (_knowledge + _random); + + _group reveal [_enemy, _knowledge]; + + // player sideChat format ["TCL_Reveal_F > Unassign > Reveal > %1 > %2", _x, _group]; + } + else + { + _units doWatch (getPos _enemy); + + // player sideChat format ["TCL_Reveal_F > Unassign > Watch > %1 > %2", _x, _group]; + }; + + // player sideChat format ["TCL_Reveal_F > Unassign > %1 > %2 > %3 > %4", _enemy, _x, _group, _knowsAbout]; + }; + }; + + } count _groups; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Reveal Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Reveal + // By =\SNKMAN/= + // Used: TCL_System.fsm + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + private _groups = (TCL_Groups select 0); + + private _skill = [_group] call TCL_Accuracy_F; + + _groups = _groups - (TCL_Reinforcement select 0); + + _groups = _groups select { (side _group getFriend side _x > 0.6) }; + + if (_groups isEqualTo [] ) exitWith {True}; + + private _value = (TCL_IQ select 0); + + private _distance = (TCL_IQ select 1); + + private _knowsAbout = (_group knowsAbout vehicle _enemy); + + private ["_leader","_bool","_units","_random"]; + + {_leader = (leader _x); + + _bool = [_group, _x, _distance] call (TCL_Reveal_F select 2); + + if ( (isNull objectParent _leader) && { (_bool) } ) exitWith + { + _units = (units _x); + + _random = (random _knowsAbout); + + // _random = (_random / _skill); + + if (_random > _value) then + { + _x reveal [_enemy, _random]; + + // player sideChat format ["TCL_Reveal_F > Communicate > Reveal > %1 > %2 > %3", _enemy, _group, _x]; + } + else + { + _units doWatch (getPos _enemy); + + // player sideChat format ["TCL_Reveal_F > Communicate > Watch > %1 > %2 > %3", _enemy, _group, _x]; + }; + + // player sideChat format ["TCL_Reveal_F > Enemy > %1 > %2 > %3 > %4", _enemy, _group, _x, _random]; + }; + + } count _groups; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Reveal Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Reveal + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_x","_distance"]; + + private _return = False; + + private _units = (units _group); + + private ["_unit","_bool"]; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + if ( (alive _unit) && { (units _x findIf { ( (alive _x) && { (_unit distance _x < _distance) } ) } > -1) } ) exitWith + { + _bool = [_group, _x] call (TCL_KnowsAbout_F select 4); + + if (_bool) then + { + _return = True; + }; + }; + }; + + _return + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Ship_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Ship_F.sqf new file mode 100644 index 0000000..f705ee7 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Ship_F.sqf @@ -0,0 +1,22 @@ +TCL_Ship_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Ship Function #0 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_logic","_vehicle"]; + + private _bool = True; + + while { ( (alive _vehicle) && (canMove _vehicle) ) } do + { + if (getPosATL _vehicle select 2 < 3) exitWith {}; + + sleep 1; + }; + + { [_x] orderGetIn False; [_x] allowGetIn False} forEach units _group; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Sneaking_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Sneaking_F.sqf new file mode 100644 index 0000000..a27c1eb --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Sneaking_F.sqf @@ -0,0 +1,58 @@ +TCL_Sneaking_F = [ + + ////////////////////////////////////////////////////////////////////////////// + /* /-------------------------------------------------------------------------- + \ \ Sneaking Function #0 + \ \------------------------------------------------------------------------- + \ \ By =\SNKMAN/= + / /------------------------------------------------------------------------ + *////////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group"]; + + private _return = False; + + private _units = (units _group); + + _knowsAbout = (_units findIf { ( (alive _x) && { (group _enemy knowsAbout vehicle _x > 0) } ) } ); + + if (_group in (TCL_Sneaking select 0) ) then + { + if (_knowsAbout > -1) then + { + _return = True; + }; + } + else + { + if (_knowsAbout == -1) then + { + private _leader = (leader _group); + + if (_leader distance _enemy < 300) then + { + if ( (units _enemy findIf { (_group knowsAbout vehicle _x > 0) } > -1) || (_group in (TCL_Reinforcement select 1) ) ) then + { + if (isNull objectParent _leader) then + { + _return = True; + + {_x disableAI "AUTOCOMBAT"} count _units; + + _group setBehaviour "AWARE"; + _group setCombatMode "WHITE"; + + (TCL_Sneaking select 0) pushBack _group; + + // player sideChat format ["TCL_Sneaking_F > Sneaking > %1", _group]; + + {if (floor (random 100) < 50) then {_x setUnitPos "MIDDLE"} } count _units; + }; + }; + }; + }; + }; + + _return + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Stuck_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Stuck_F.sqf new file mode 100644 index 0000000..e176482 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Stuck_F.sqf @@ -0,0 +1,89 @@ +TCL_Stuck_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Stuck Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Stuck + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_vehicle"]; + + private _leader = (leader _group); + + if (_leader in assignedVehicle _leader) then + { + private _driver = (driver _vehicle); + + if (alive _driver) then + { + + } + else + { + [_leader] orderGetIn False; + + _leader assignAsDriver _vehicle; + + [_leader] orderGetIn True; + }; + + private _units = (units _group); + + if (_count == 0) then + { + if (_units findIf { (currentCommand _x isEqualTo "GET IN") } > -1) then + { + _count = 30; + + // player sideChat format ["TCL_Stuck_F > Get In > %1", _group]; + } + else + { + if (_vehicle distance _position > 3) then + { + _count = 30; + + _position = (getPos _vehicle); + + // player sideChat format ["TCL_Stuck_F > Moving > %1", _group]; + } + else + { + if (_vehicle in (TCL_Stuck select 0) ) then + { + _count = _count - 1; + + _group leaveVehicle _vehicle; + + // player sideChat format ["TCL_Stuck_F > Stuck > %1", _group]; + } + else + { + _count = 30; + + (TCL_Stuck select 0) pushBack _vehicle; + }; + }; + }; + } + else + { + private _array = [5,15,25]; + + if (_count in _array) then + { + // _return = _units findIf { ( (_x == vehicle _x) && { (currentCommand _x isEqualTo "GET IN") } && { (_x distance assignedVehicle _x < 100) } ) }; + + {if ( (isNull objectParent _x) && { (currentCommand _x isEqualTo "GET IN") } && { (_x distance assignedVehicle _x < 100) } ) exitWith { [_group, assignedVehicle _x] spawn (TCL_Vehicle_F select 2) } } count _units; + }; + + _count = _count - 1; + }; + + // player sideChat format ["TCL_Stuck_F > Count > %1 > %2", _group, _count]; + }; + + _count + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_System.fsm b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_System.fsm new file mode 100644 index 0000000..b79ffef --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_System.fsm @@ -0,0 +1,488 @@ +/*%FSM*/ +/*%FSM*/ +/* +item0[] = {"Initialize",0,250,100.000000,-150.000000,200.000000,-100.000000,0.000000,"Initialize"}; +item1[] = {"Always",8,218,100.000000,-50.000000,200.000000,0.000000,0.000000,"Always"}; +item2[] = {"Regroup",2,250,100.000000,50.000000,200.000000,100.000000,0.000000,"Regroup"}; +item3[] = {"Alive",4,218,100.000000,150.000000,200.000000,200.000000,1.000000,"Alive"}; +item4[] = {"Enemy",2,250,100.000000,250.000000,200.000000,300.000000,0.000000,"Enemy"}; +item5[] = {"Lock",4,218,-50.000000,350.000000,50.000000,400.000000,1.000000,"Lock"}; +item6[] = {"Feature",2,4346,-48.035065,444.105225,51.964935,494.105225,0.000000,"Feature"}; +item7[] = {"Always",8,218,-50.000000,550.000000,50.000000,600.000000,0.000000,"Always"}; +item8[] = {"Move",2,250,-200.000000,550.000000,-100.000000,600.000000,0.000000,"Move"}; +item9[] = {"Always",8,218,-200.000000,450.000000,-100.000000,500.000000,0.000000,"Always"}; +item10[] = {"Always",8,218,-50.000000,250.000000,50.000000,300.000000,0.000000,"Always"}; +item11[] = {"Request",2,250,-200.000000,250.000000,-100.000000,300.000000,0.000000,"Request"}; +item12[] = {"Time",4,218,-200.000000,50.000000,-100.000000,100.000000,0.000000,"Time"}; +item13[] = {"Always",8,218,250.000000,50.000000,350.000000,100.000000,0.000000,"Always"}; +item14[] = {"Time",4,218,100.000000,350.000000,200.000000,400.000000,2.000000,"Time"}; +item15[] = {"Remount",2,250,100.000000,450.000000,200.000000,500.000000,0.000000,"Remount"}; +item16[] = {"Always",8,218,250.000000,450.000000,350.000000,500.000000,0.000000,"Always"}; +item17[] = {"End",1,250,250.000000,250.000000,350.000000,300.000000,0.000000,"End"}; +link0[] = {0,1}; +link1[] = {1,2}; +link2[] = {2,3}; +link3[] = {2,13}; +link4[] = {3,4}; +link5[] = {4,5}; +link6[] = {4,10}; +link7[] = {4,14}; +link8[] = {5,6}; +link9[] = {6,7}; +link10[] = {7,8}; +link11[] = {8,9}; +link12[] = {9,11}; +link13[] = {10,11}; +link14[] = {11,12}; +link15[] = {12,2}; +link16[] = {13,17}; +link17[] = {14,15}; +link18[] = {15,16}; +link19[] = {16,17}; +globals[] = {0.000000,0,0,0,0,640,480,1,25,6316128,1,-343.852997,492.227051,672.140503,-207.168152,851,895,1}; +window[] = {2,-1,-1,-32000,-32030,944,225,1185,225,3,869}; +*//*%FSM*/ +class FSM +{ + fsmName = "TCL_System"; + class States + { + /*%FSM*/ + class Initialize + { + name = "Initialize"; + itemno = 0; + init = /*%FSM*/"/* ////////////////////////////////////////////////////////////////////////////////" \n + "\ \ Tactical Combat Link ( F.S.M. ) A.I. System" \n + " \ \------------------------------------------------------------------------------" \n + " \ \ By =\SNKMAN/=" \n + " / /-----------------------------------------------------------------------------" \n + "*/ ///////////////////////////////////////////////////////////////////////////////" \n + "private [""_enemy"",""_group"",""_logic"",""_key"",""_time"",""_array"",""_knowsAbout"",""_lock"",""_knowledge"",""_radio"",""_move"",""_request"",""_sleep"",""_spot"",""_units"",""_count"",""_random"",""_bool"",""_waypoint""];" \n + "" \n + "_enemy = _this select 0;" \n + "_group = _this select 1;" \n + "_logic = _this select 2;" \n + "" \n + "_key = 5;" \n + "" \n + "_time = 0;" \n + "" \n + "_array = [];" \n + "" \n + "_knowsAbout = 0;" \n + "" \n + "_group lockWP True;" \n + "" \n + "_lock = [1, 3, 5, 7];" \n + "" \n + "_leader = (leader _group);" \n + "" \n + "_position = (getPos _logic);" \n + "" \n + "_group setVariable [""TCL_KnowsAbout"", 0];" \n + "" \n + "_group setVariable [""TCL_Logic"", _logic];" \n + "" \n + "[_group] call (TCL_Behaviour_F select 0);" \n + "" \n + "_group setVariable [""TCL_Waypoint"", _position];" \n + "" \n + "_knowledge = (_group getVariable ""TCL_AI"" select 0);" \n + "" \n + "[_enemy, _group, _logic] spawn (TCL_Unassign_F select 0);" \n + "" \n + "_radio = False;" \n + "" \n + "if (TCL_Radio select 0) then" \n + "{" \n + " _radio = True;" \n + "};" \n + "" \n + "_move = True;" \n + "" \n + "if (_group in (TCL_Freeze select 0) ) then" \n + "{" \n + " _move = False;" \n + "}" \n + "else" \n + "{" \n + " if (_group getVariable ""TCL_AI"" select 7) then" \n + " {" \n + " _move = False;" \n + " };" \n + "};" \n + "" \n + "_request = True;" \n + "" \n + "if (_move) then" \n + "{" \n + " if (_group in (TCL_Default select 0) ) then" \n + " {" \n + " _request = False;" \n + " }" \n + " else" \n + " {" \n + " if (_group getVariable ""TCL_AI"" select 8) then" \n + " {" \n + " _request = False;" \n + " };" \n + " };" \n + "};" \n + "" \n + "if (_request) then" \n + "{" \n + " _sleep = 0;" \n + "};" \n + "" \n + "_spot = objNull;" \n + "" \n + "if (TCL_Debug select 6) then" \n + "{" \n + " _spot = createVehicle [""Sign_Arrow_Large_Pink_F"", _position, [], 0, ""CAN_COLLIDE""];" \n + "};" \n + "" \n + "// player sideChat format [""TCL_System > %1 > %2 > %3"", _radio, _move, _request];"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Always + { + itemno = 1; + priority = 0.000000; + to="Regroup"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Regroup + { + name = "Regroup"; + itemno = 2; + init = /*%FSM*/"_units = (units _group);" \n + "" \n + "_units = _units select { ( (alive _x) && { (isNull objectParent _x) } ) };" \n + "" \n + "if (_key == 3) then" \n + "{ " \n + " if ( (alive _enemy) && { (_knowsAbout > 0) } ) then" \n + " {" \n + " _count = (count _units);" \n + " " \n + " if (_count > 0) then" \n + " {" \n + " _random = 5;" \n + " " \n + " _random = (_random / _count);" \n + " " \n + " if (floor (random 100) < _random) then" \n + " {" \n + " [_group, _logic, _count] call (TCL_Regroup_F select 0);" \n + " };" \n + " };" \n + " };" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Alive + { + itemno = 3; + priority = 1.000000; + to="Enemy"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(units _group) findIf { (alive _x) } > -1"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Always + { + itemno = 13; + priority = 0.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Enemy + { + name = "Enemy"; + itemno = 4; + init = /*%FSM*/"_enemy = [_enemy, _group] call (TCL_Enemy_F select 0);" \n + "" \n + "_group setVariable [""TCL_Enemy"", _enemy];" \n + "" \n + "[_enemy, _group, _logic] call (TCL_Enemy_F select 1);" \n + "" \n + "_knowsAbout = (_group knowsAbout vehicle _enemy);" \n + "" \n + "if (_knowsAbout > 0) then" \n + "{" \n + " if (alive _enemy) then" \n + " {" \n + " _logic setPos (getPos _enemy);" \n + " };" \n + "};" \n + "" \n + "// player sideChat format [""TCL_System > Enemy > %1 > %2"", _enemy, _group];"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Time + { + itemno = 14; + priority = 2.000000; + to="Remount"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"( (time > (_logic getVariable ""TCL_Time"") ) || (_group in (TCL_Retreat select 0) ) )"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Lock + { + itemno = 5; + priority = 1.000000; + to="Feature"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(_key in _lock)"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Always + { + itemno = 10; + priority = 0.000000; + to="Request"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Feature + { + name = "Feature"; + itemno = 6; + init = /*%FSM*/"if (_knowsAbout > 0) then" \n + "{" \n + " [_enemy, _group, _logic] call (TCL_Reveal_F select 1);" \n + " " \n + " if (_key == 5) then" \n + " {" \n + " if (floor (random 100) < 15) then" \n + " {" \n + " [_group] call (TCL_Flanking_F select 3);" \n + " };" \n + " };" \n + "};" \n + "" \n + "_array = [];" \n + "" \n + "if (_key == 5) then" \n + "{" \n + " // _array = [];" \n + " " \n + " [_group, _units] call (TCL_Feature_F select 0);" \n + "};" \n + "" \n + "// [_enemy, _group, _logic, _units] call (TCL_Tank_F select 0);" \n + "" \n + "// player sideChat format [""TCL_System > %1 > %2"", _group, _array];" \n + "" \n + "_array = [_enemy, _group, _logic, _array, _knowsAbout] call (TCL_Feature_F select 1);" \n + "" \n + "// player sideChat format [""TCL_System > %1 > %2 > %3 > %4 > %5"", _group, (behaviour leader _group), (combatMode _group), round time, _key];"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Always + { + itemno = 7; + priority = 0.000000; + to="Move"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Move + { + name = "Move"; + itemno = 8; + init = /*%FSM*/"if (_group in (TCL_Zeus select 1) ) exitWith {};" \n + "" \n + "if (_move) then" \n + "{" \n + " _waypoint = (_group getVariable ""TCL_Waypoint"");" \n + " " \n + " // if (_key == 5) then" \n + " " \n + " if ( (_key == 3) || (_key == 5) ) then" \n + " {" \n + " // player sideChat format [""TCL_System > %1 > %2"", _group, _key];" \n + " " \n + " [_enemy, _group, _logic, _array, _spot, _waypoint] call (TCL_Move_F select 0);" \n + " };" \n + " " \n + " if (_group in (TCL_Reinforcement select 2) ) then" \n + " {" \n + " if (_group in (TCL_Behaviour select 0) ) exitWith {};" \n + " " \n + " // if (leader _group distance _waypoint > 300) then" \n + " // {" \n + " [_enemy, _group, _logic, _waypoint] spawn (TCL_Behaviour_F select 1);" \n + " // };" \n + " };" \n + "};" \n + "" \n + "if (_key == 5) then" \n + "{" \n + " _key = -1;" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Always + { + itemno = 9; + priority = 0.000000; + to="Request"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Request + { + name = "Request"; + itemno = 11; + init = /*%FSM*/"_key = _key + 1;" \n + "" \n + "_time = (time + 5);" \n + "" \n + "if (_knowsAbout > _knowledge) then" \n + "{" \n + " if (_request) then" \n + " {" \n + " _bool = True;" \n + " " \n + " if (_radio) then" \n + " {" \n + " _bool = False;" \n + " " \n + " if (units _group findIf { ( (alive _x) && ( (""ItemRadio"" in items _x) || (""ItemRadio"" in assigneditems _x) ) ) } > -1) then {_bool = True};" \n + " " \n + " // player sideChat format [""TCL_System > Radio > %1 > %2"", _group, _bool];" \n + " };" \n + " " \n + " if (_bool) then" \n + " {" \n + " if (_sleep == 0) then" \n + " {" \n + " _sleep = [_enemy, _group, _logic] call (TCL_KnowsAbout_F select 3);" \n + " };" \n + " " \n + " if (time > _sleep) then" \n + " {" \n + " [_enemy, _group, _logic] call (TCL_Reinforcement_F select 1);" \n + " " \n + " _sleep = 0;" \n + " };" \n + " };" \n + " };" \n + "};" \n + "" \n + "// player sideChat format [""TCL_System > Key > %1"", _key];" \n + "" \n + "{ [_x, _enemy, _group, _logic] call (TCL_Marker_F select 0) } count [""TCL_Spot"",""TCL_Enemy"",""TCL_KnowsAbout""];" \n + "" \n + "// player sideChat format [""TCL_System > %1 > %2 > %3 > %4 > %5 > %6"", _group, (behaviour leader _group), (combatMode _group), round time, _key, round (leader _group distance _waypoint) ];"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Time + { + itemno = 12; + priority = 0.000000; + to="Regroup"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(time > _time)"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Remount + { + name = "Remount"; + itemno = 15; + init = /*%FSM*/"[_group] spawn (TCL_Remount_F select 0);"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Always + { + itemno = 16; + priority = 0.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class End + { + name = "End"; + itemno = 17; + init = /*%FSM*/"[_group, _logic, _spot] call (TCL_Logic_F select 1);"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + }; + }; + /*%FSM*/ + }; + initState="Initialize"; + finalStates[] = + { + "End", + }; +}; +/*%FSM*/ \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Unassign_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Unassign_F.sqf new file mode 100644 index 0000000..fed6aee --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Unassign_F.sqf @@ -0,0 +1,307 @@ +#include "TCL_Macros.hpp" + +TCL_Unassign_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Unassign Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Unassign + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + private _time = 0; + + private _count = 30; + + private _units = (units _group); + + private _leader = (leader _group); + + private _vehicle = (vehicle _leader); + + private _position = (getPos _vehicle); + + // player sideChat format ["TCL_Unassign_F > Group > %1", _group]; + + private _distance = [_group, _logic, _vehicle] call (TCL_Unassign_F select 1); + + private _assign = True; + + if (_group knowsAbout vehicle _enemy > 0) then + { + _assign = False; + }; + + if (_assign) then + { + if (assignedVehicle _leader isKindOf "LandVehicle") then + { + _assign = False; + + _position = (getPos assignedVehicle _leader); + + private _distance = (_leader distance _logic); + + _distance = (_distance / 3); + + _units = _units select { ( (isNull objectParent _x) && { (_x distance assignedVehicle _x < _distance) } ) }; + + if (_leader in _units) then + { + if (_units findIf { (assignedVehicleRole _x select 0 == "Driver") } < 0) then {_leader assignAsDriver assignedVehicle _leader}; + + [_units, _group, _vehicle] call (TCL_Assign_F select 1); + }; + }; + }; + + private ["_waypoint","_driver","_enemy"]; + + while { ( (units _group findIf { (alive _x) } > -1) && { (_group in (TCL_Reinforcement select 0) ) } ) } do + { + _waypoint = (_group getVariable "TCL_Waypoint"); + + if ( (units _enemy findIf { ( (alive _x) && { (_group knowsAbout vehicle _x > 0) } ) } > -1) || (units _group findIf { ( (alive _x) && { ( (_x distance2D _waypoint < _distance) || (_x distance2D _logic < _distance) ) } ) } > -1) ) exitWith + { + if (_count < 0) exitWith + { + [_group] call (TCL_Behaviour_F select 0); + + [_enemy, _group, _logic] spawn (TCL_Unassign_F select 0); + + // player sideChat format ["TCL_Unassign_F > Stuck > %1", _group]; + }; + + [_enemy, _group, _logic] call (TCL_Unassign_F select 2); + }; + + _leader = (leader _group); + + _vehicle = (vehicle _leader); + + if (_assign) then + { + if (isNull objectParent _leader) then + { + if (_leader distance _waypoint > 300) then + { + if (time > _time) then + { + _units = (units _group); + + _assign = [_units, _group] call (TCL_Assign_F select 0); + + if (_assign) exitWith + { + _time = (time + 30); + }; + + _vehicle = (assignedVehicle _leader); + + _position = (getPos assignedVehicle _leader); + }; + }; + }; + } + else + { + _driver = (driver _vehicle); + + if (alive _driver) then + { + _count = [_group, _vehicle] call (TCL_Stuck_F select 0); + }; + }; + + _enemy = [_enemy, _group] call (TCL_Enemy_F select 0); + + sleep 1; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Unassign Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Unassign + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_logic","_vehicle"]; + + private _distance = 100; + + private _random = (random _distance); + + _distance = (_distance + _random); + + if (_vehicle isKindOf "Helicopter") then + { + private _value = 0; + + private _crew = (crew _vehicle); + + if (_crew findIf { ( (assignedVehicleRole _x select 0 == "Cargo") && { (backpack _x isEqualTo "B_Parachute") } ) } > -1) then + { + _value = 50; + }; + + if (floor (random 100) < _value) then + { + _vehicle flyInHeight _distance; + + _group setVariable ["TCL_Eject", True]; + } + else + { + _group setVariable ["TCL_Eject", False]; + }; + + _random = 1 + (random 1); + + _distance = (_distance * _random); + }; + + // private _value = 1 + (random 1); + + // _distance = (_distance * _value); + + // player sideChat format ["TCL_Unassign_F > Distance > %1 > %2", _group, _distance]; + + _distance + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Unassign Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Unassign + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + private _leader = (leader _group); + + private _vehicle = (vehicle _leader); + + // _group setVariable ["TCL_KnowsAbout", 0]; + + if (_group in (TCL_Reinforcement select 1) ) then + { + TCL_DeleteAT(TCL_Reinforcement,1,_group); + + [_group] call (TCL_Behaviour_F select 0); + }; + + if (_group in (TCL_Reinforcement select 2) ) then + { + TCL_DeleteAT(TCL_Reinforcement,2,_group); + }; + + [_enemy, _group, _logic] call (TCL_Unassign_F select 3); + + if (True) then + { + private _units = (units _group); + + if (_vehicle isKindOf "Man") exitWith + { + if (_units findIf { (count assignedVehicleRole _x > 0) } > -1) then + { + [_group, _logic] call (TCL_Vehicle_F select 0); + }; + }; + + if (_vehicle isKindOf "Ship") exitWith + { + [_group, _logic, _vehicle] spawn (TCL_Ship_F select 0); + }; + + if (_vehicle isKindOf "Helicopter") exitWith + { + if (getPos _vehicle select 2 < 10) then + { + _vehicle land "LAND"; + + _units orderGetIn False; _units allowGetIn False; + } + else + { + if (_units findIf { ( (assignedVehicleRole _x select 0 == "Cargo") && (count (assignedVehicleRole _x) == 1) ) } > -1) then + { + [_group, _logic, _vehicle] spawn (TCL_Helicopter_F select 0); + } + else + { + _vehicle flyInHeight 50; + }; + }; + }; + + if (_vehicle isKindOf "LandVehicle") exitWith + { + private _driver = (driver _vehicle); + + if (alive _driver) then + { + [_group, _logic] call (TCL_Vehicle_F select 0); + }; + }; + }; + + // player sideChat format ["TCL_Unassign_F > Vehicle > %1 > %2", _vehicle, (assignedVehicle _leader) ]; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Unassign Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Unassign + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + [_group, _logic] call (TCL_Reveal_F select 0); + + if (_group knowsAbout vehicle _enemy > 0) then + { + private _units = (units _group); + + _units doWatch (getPos _enemy); + + _group setVariable ["TCL_KnowsAbout", 0]; + + if ( [dayTime] call TCL_Daytime_F) then + { + private _leader = (leader _group); + + if (isNull objectParent _leader) then + { + [_enemy, _group] spawn (TCL_Smoke_F select 0); + + _units select { ( (alive assignedVehicle _x) && { (assignedVehicle _x isKindOf "LandVehicle") } && { (_x == driver assignedVehicle _x) } ) } apply { [_enemy, _group, assignedVehicle _x] spawn (TCL_Smoke_F select 1) }; + } + else + { + private _vehicle = (vehicle _leader); + + if (_vehicle isKindOf "LandVehicle") then + { + [_enemy, _group, _vehicle] spawn (TCL_Smoke_F select 1); + }; + }; + } + else + { + [_enemy, _group, _logic] spawn (TCL_Flare_F select 0); + }; + + [_enemy, _group, _logic] call (TCL_Artillery_F select 0); + }; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Vehicle_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Vehicle_F.sqf new file mode 100644 index 0000000..1f04060 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Vehicle_F.sqf @@ -0,0 +1,187 @@ +#include "TCL_Macros.hpp" + +TCL_Vehicle_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Vehicle Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Vehicle + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_logic"]; + + private _units = (units _group); + + private ["_unit","_vehicle","_gunner","_driver"]; + + private _count = 0; + + for "_count" from _count to (count _units - 1) do + { + _unit = (_units select _count); + + if (isNull objectParent _unit) then + { + [_unit] orderGetIn False; [_unit] allowGetIn False; + } + else + { + if (assignedVehicleRole _unit select 0 == "Cargo") then + { + [_unit] orderGetIn False; [_unit] allowGetIn False; + } + else + { + _vehicle = (vehicle _unit); + + _gunner = (gunner _vehicle); + + if ( (alive _gunner) && { (canFire _vehicle) } && { (someAmmo _vehicle) } ) then + { + _driver = (driver _vehicle); + + if (_unit == _driver) then + { + if (_vehicle in (TCL_Vehicle select 0) ) exitWith {}; + + [_group, _logic, _vehicle] spawn (TCL_Vehicle_F select 1); + + // player sideChat format ["TCL_Vehicle_F > Vehicle > %1", _vehicle]; + }; + } + else + { + [_unit] orderGetIn False; [_unit] allowGetIn False; + }; + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Vehicle Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Vehicle + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_logic","_vehicle"]; + + (TCL_Assign select 0) pushBack _vehicle; + + (TCL_Vehicle select 0) pushBack _vehicle; + + private _driver = (driver _vehicle); + private _gunner = (gunner _vehicle); + + _vehicle forceSpeed 0; + + sleep 10; + + _vehicle forceSpeed -1; + + private _time = (time + 10); + + while { ( (_group in (TCL_Reinforcement select 0) ) && { (canFire _vehicle) } && { (someAmmo _vehicle) } && { (alive _driver) } && { (_driver in _vehicle) } && { (alive _gunner) } && { (_gunner in _vehicle) } ) } do + { + if (time > _time) then + { + private _units = (units _group); + + if (_units findIf { ( (isNull objectParent _x) && { (currentCommand _x isEqualTo "GET IN") } && { (assignedVehicle _x == _vehicle) } ) } > -1) exitWith + { + _time = (time + 10); + + [_group, _vehicle] spawn (TCL_Vehicle_F select 2); + }; + }; + + sleep 5; + }; + + if ( (_group in (TCL_Reinforcement select 0) ) && { (someAmmo _vehicle) } ) then + { + if (alive _driver) then + { + [_driver] orderGetIn False; [_driver] allowGetIn False; + + while { ( (alive _driver) && { (_driver in _vehicle) } ) } do + { + sleep 1; + }; + + if (alive _driver) then + { + _driver assignAsGunner _vehicle; + + [_driver] orderGetIn True; [_driver] allowGetIn True; + + sleep 30 + (random 50); + + _gunner = _driver; + }; + }; + + if (alive _gunner) then + { + sleep 30 + (random 50); + }; + + if (_group in (TCL_Reinforcement select 0) ) then + { + private _crew = (crew _vehicle); + + _crew orderGetIn False; _crew allowGetIn False; + + // player sideChat format ["TCL_Vehicle_F > Crew > %1 > %2", _group, _crew]; + }; + }; + + TCL_DeleteAT(TCL_Vehicle,0,_vehicle); + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Vehicle Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Vehicle + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group","_vehicle"]; + + private _array = []; + + _array pushBack _vehicle; + + private _units = (units _group); + + private _leader = (leader _group); + + if ( (isNull objectParent _leader) || (_leader in _vehicle) ) then + { + _array = _array; + } + else + { + _array pushBack (vehicle _leader); + }; + + // player sideChat format ["TCL_Vehicle_F > Stop > Group > %1", _group]; + + {_x forceSpeed 0} count _array; + + sleep 10; + + {_x forceSpeed -1} count _array; + + if (isNull objectParent _leader) then + { + _leader forceSpeed -1; + }; + + _units doFollow _leader; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Waiting_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Waiting_F.sqf new file mode 100644 index 0000000..5a588c5 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/TCL_Waiting_F.sqf @@ -0,0 +1,58 @@ +TCL_Waiting_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Waiting Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Waiting + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + private _return = False; + + private _units = (units _enemy); + + private _leader = (leader _group); + + // if ( ( { (_x distance _leader < 100) } count (units _enemy) > 0) || (_group in (TCL_Reinforcement select 2) ) ) then + + if ( (_units findIf { (_x distance _leader < 100) } > -1) || (_group in (TCL_Reinforcement select 2) ) ) then + { + _return = True; + } + else + { + private _groups = (_logic getVariable "TCL_Reinforcement"); + + _groups = _groups - [_group]; + + if (_groups isEqualTo [] ) then + { + private _time = (_group getVariable "TCL_Waiting"); + + if (time > _time) then + { + _return = True; + }; + } + else + { + // if ( ( { ( ( (leader _x distance _enemy) < (_leader distance _enemy) ) || (_leader distance leader _x < 100) ) } count _groups > 0) ) then + + if (_groups findIf { ( ( (leader _x distance _enemy) < (_leader distance _enemy) ) || (leader _x distance _leader < 100) ) } > -1) then + { + _return = True; + } + else + { + // if (_groups findIf { (_x in (TCL_Reinforcement select 1) ) } > -1) then {_return = False}; + + {if (_x in (TCL_Reinforcement select 1) ) then {_x = _x} else {_return = True} } count _groups; + }; + }; + }; + + _return + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/Temp/TCL_Move_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/Temp/TCL_Move_F.sqf new file mode 100644 index 0000000..6d36833 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_Reinforcement_F/Temp/TCL_Move_F.sqf @@ -0,0 +1,417 @@ +TCL_Move_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Move Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Move + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic","_array","_spot","_waypoint"]; + + private _leader = (leader _group); + + private _position = (_group getVariable "TCL_Position"); + + if ( [_enemy, _group, _logic] call (TCL_Move_F select 1) ) then + { + _position = [_enemy, _group, _logic, _array] call (TCL_Move_F select 2); + }; + + if ( (_leader distance _position > 10) || (_leader distance _waypoint > 10) ) then + { + if (isNull objectParent _leader) then + { + + } + else + { + // _leader setDestination [_position, "VEHICLE PLANNED", True]; + }; + + _group move _position; + + if (alive _spot) then + { + _spot setPos _position; + }; + }; + + _group setVariable ["TCL_Waypoint", _position]; + + ["TCL_Position", _group, _position] call (TCL_Marker_F select 0); + + // player sideChat format ["TCL_Move_F > Group > %1 > %2", _group, _position]; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Move Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Move + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic"]; + + private _return = False; + + if (_group in (TCL_Hold select 0) ) then + { + if ( [_group, _logic] call TCL_Trigger_F ) then + { + _return = True; + }; + } + else + { + if (_group in (TCL_Waiting select 0) ) then + { + if ( [_enemy, _group, _logic] call (TCL_Waiting_F select 0) ) then + { + _return = True; + + TCL_Waiting set [0, (TCL_Waiting select 0) - [_group] ]; + }; + } + else + { + _return = True; + }; + }; + + _return + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Move Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Move + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_logic","_array"]; + + private "_position"; + + private _knowsAbout = 0; + + if (alive _enemy) then + { + _knowsAbout = (_group knowsAbout vehicle _enemy); + }; + + private _value = 100; + + // private _random = 1 + (random 1); + + // _value = (_value * _random); + + private _distance = 0; + + private _object = _logic; + + private _leader = (leader _group); + + private _direction = (random 360); + + if (_knowsAbout > 0) then + { + if (_knowsAbout < 1) then + { + _knowsAbout = 1; + }; + + if (count _array > 0) then + { + // _range = 300; + + private _tweak = (TCL_Tweak select 1); + + private _range = (random _tweak); + + // private _range = (random _tweak); + + // private _random = (random _tweak); + + // private _range = (_tweak - _random); + + // player sideChat format ["TCL_Move_F > Range > %1 > %2 > %3", _group, _range, _random]; + + private _bool = False; + + private _units = (units _group); + + if (_array isEqualTo _units) then + { + _bool = True; + + if (_leader distance _enemy < _tweak) then + { + _tweak = (TCL_Tweak select 2); + + private _random = (random 5); + + if (combatMode _group isEqualTo "RED") then + { + _random = (random 15); + }; + + _tweak = (_tweak - _random); + + if (floor (random 100) < _tweak) then + { + _bool = True; + + // player sideChat format ["TCL_Move_F > Stop > %1", _group]; + }; + }; + }; + + // private + + // _bool = True; + + // _random = (TCL_Tweak select 4); + + if (count _array > 0) then + + // if ( (_bool) || (_leader distance _enemy < _range) ) then + + // if ( (_bool) || (floor (random 100) < _random) ) then + { + _tweak = (TCL_Tweak select 3); + + private _random = [_enemy, _group, _array, _range, _tweak] call (TCL_Move_F select 3); + + _random = (TCL_Tweak select 4); + + if (combatmode _group isEqualTo "RED") then + { + _value = (random 15); + + _random = (_random + _value); + }; + + if (_leader in _array) then + { + _count = (count _array); + + _random = (_random / _count); + + // player sideChat format ["TCL_Move_F > Leader > %1 > %2 > %3", _group, _random, (count _array) ]; + + // _random = (_random / 2); + + // _random = (_random + 2); + }; + + if (_bool) then + { + // _random = (_random - 15); + }; + + if (_leader in _array) then + { + // _random = (_random - 15); + + // player sideChat format ["TCL_Move_F > Leader > %1 > %2 > %3", _group, _random, (count _array) ]; + }; + + // player sideChat format ["TCL_Move_F > Leader > %1 > %2 > %3", _group, _random, (count _array) ]; + + // player sideChat format ["TCL_Move_F > Leader > %1 > %2 > %3", _group, _random, (count _array) ]; + + private _tweak = (TCL_Tweak select 1); + + _range = _tweak; + + if (_leader distance _logic > _tweak) then + { + _random = 100; + }; + + if (floor (random 100) < _random) then + { + _distance = (_leader distance _enemy); + + _tweak = (TCL_Tweak select 3); + + private _value = 1 + (random _tweak); + + _distance = (_distance / _value); + + // _distance = 0; + + player sideChat format ["TCL_Move_F > Move > %1 > %2 > %3 > %4 > %5 > %6 > %7%8", _group, round (_leader distance _enemy), (behaviour _leader), (combatMode _group ), (count _array), (round _range), (round _random), "%"]; + } + else + { + _distance = 0; + + _object = _leader; + + player sideChat format ["TCL_Move_F > Stop > %1 > %2 > %3 > %4 > %5 > %6 > %7%8", _group, round (_leader distance _enemy), (behaviour _leader ), (combatMode _group), (count _array), (round _range), (round _random), "%"]; + }; + }; + + // player sideChat format ["TCL_Move_F > Visible > %1 > %2 > %3 > %4 > %5", _group, _range, round (_leader distance _enemy), (combatMode _group), (behaviour _leader ) ]; + + _direction = (_enemy getDir _leader); + + private _random = (random 10 - random 10); + + if (floor (random 100) < 50) then + { + // _random = 10 - (random 30); + }; + + _direction = (_direction + _random); + + // player sideChat format ["TCL_Move_F > Direction > %1 > %2", _group, _direction]; + } + else + { + _skill = [_group] call TCL_Accuracy_F; + + _value = (_value / _skill); + + _distance = (random _value - random _value); + + // player sideChat format ["TCL_Move_F > Random > %1 > %2 > %3", _group, _skill, _value]; + + player sideChat format ["TCL_Move_F > Random > %1 > %2 > %3 > %4 > %5", _group, round (_leader distance _enemy), (behaviour _leader ), (combatMode _group), (count _array) ]; + }; + } + else + { + _distance = (random _value - random _value); + + if (False) then + { + if (_group in (TCL_Reinforcement select 1) ) then + { + _distance = 10; + + _direction = (_enemy getDir _leader); + + private _random = (random 10 - random 10); + + if (floor (random 100) < 50) then + { + _random = 10 - (random 30); + }; + + _direction = (_direction + _random); + }; + }; + + if (alive _enemy) then + { + if ( (group _enemy) isEqualTo (_logic getVariable "TCL_Group") ) then + { + _groups = (_logic getVariable "TCL_Reinforcement"); + + {if (_x knowsAbout vehicle _enemy > 0) exitWith {_logic setPos (getPos _enemy) } } count _groups; + }; + }; + }; + + if (vehicle _leader isKindOf "Ship") then + { + _direction = (_enemy getDir _leader); + + _distance = (_leader distance _enemy); + + _distance = (_distance - 300); + + private _position = [_object, _distance, _direction] call TCL_Real_Pos_F; + + if (surfaceIsWater _position) then + { + _distance = _distance; + } + else + { + _distance = (_distance + 200); + }; + }; + + if (_logic getVariable "TCL_Artillery" select 1) then + { + if (_leader distance _logic < 200) then + { + _distance = 0; + + _object = _leader; + + // player sideChat format ["TCL_Move_F > Artillery > %1", _group]; + }; + }; + + _position = [_object, _distance, _direction] call TCL_Real_Pos_F; + + _position + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Move Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Move + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_enemy","_group","_array","_range","_tweak"]; + + if (_group in (TCL_Sneaking select 0) ) exitWith {_return = 100; _return}; + + private _return = (TCL_Tweak select 4); + + private _random = (random 5); + + private _value = 1 + (random _tweak); + + _range = (_range / _value); + + // player sideChat format ["TCL_Move_F > Range > %1 > %2", _group, _range]; + + private _count = (count _array); + + private _leader = (leader _group); + + if (_leader distance _enemy < _range) then + { + if (_count > 0) then + { + _return = (_return / _count); + }; + } + else + { + private _units = { (alive _x) } count (units _group); + + // if (_count isEqualTo _units) exitWith {}; + + _units = (_units / 3); + + if (_count > _units) then + { + if (combatMode _group isEqualTo "YELLOW") then + { + _random = (random 5); + } + else + { + _random = (random 15); + }; + }; + }; + + _return = (_return + _random); + + // player sideChat format ["TCL_Move_F > Push > %1 > %2 > %3%4", _group, (combatMode _group), (round _return), "%"]; + + _return + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Debug_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Debug_F.sqf new file mode 100644 index 0000000..117323d --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Debug_F.sqf @@ -0,0 +1,222 @@ +TCL_Debug_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Debug Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Debug + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {private ["_array"]; + + _array = _this; + + private _header = _array call (TCL_Header_F select 1); + + private ["_text","_string"]; + + while { (TCL_Preprocess) } do + { + _text = "Working"; + + _string = parseText (_header + _text); + + hint _string; + + sleep 0.01; + }; + + if (TCL_Path isEqualTo "\TCL_System\") then + { + _text = " AddOn Based ( Done )"; + } + else + { + _text = " Sctipt Based ( Done )"; + }; + + _string = parseText (_header + _text); + + hint _string; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Debug Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Debug + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {private ["_array"]; + + _array = _this; + + private _header = _array call (TCL_Header_F select 1); + + private _text = format ["Server: %1
Multiplayer: %2
Dedicated: %3", (TCL_Server), (TCL_Multiplayer), (TCL_Dedicated) ]; + + private ["_object","_group","_string","_enemy","_knowledge"]; + + while { (True) } do + { + _object = cursorTarget; + + if (alive _object) then + { + _group = (group _object); + + if (isNull _group) then + { + _string = format ["%1Object: %2
Type: %3
Distance: %4
%5", _header, _object, (typeOf _object), (player distance _object), _text]; + } + else + { + // _string = format ["%1Group: %2
Unit: %3
Knowledge: %4
Behaviour: %5
Combat Mode: %6
Type: %7
Distance: %8
%9", _header, _group, _object, (_object knowsAbout vehicle player), (behaviour _object), (combatMode _object), (typeOf _object), (player distance _object), _text]; + + _knowledge = 0; + + _enemy = objNull; + + if (_group in (TCL_Groups select 0) ) then + { + + _enemy = (_group getVariable "TCL_Enemy"); + + if (alive _enemy) then + { + if (_object targetKnowledge _enemy select 0) then + { + _knowledge = (_object knowsAbout vehicle _enemy); + }; + } + else + { + _enemy = "Unknown"; + }; + + }; + + _string = format ["%1Group: %2
Unit: %3
Skill: %4
Enemy: %5
Knowledge: %6
Behaviour: %7
Combat Mode: %8
Speed Mode: %9
Type: %10
Distance: %11
%12", _header, _group, _object, (skill _object), _enemy, _knowledge, (behaviour _object), (combatMode _object), (speedMode _object), (typeOf _object), (player distance _object), _text]; + }; + + hint parseText _string; + }; + + sleep 1; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Debug Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Debug + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {private ["_array","_groups","_array","_count","_logic","_group","_units","_textUnit","_textGroup","_string"]; + + _array = _this; + + private _header = _array call (TCL_Header_F select 1); + + while { (True) } do + { + _array = (TCL_Logic select 0); + + if (count _array > 0) then + { + _groups = []; + + _count = 0; + + for "_count" from _count to (count _array - 1) do + { + _logic = (_array select _count); + + _group = (_logic getVariable "TCL_Group"); + + if (_group == group player) exitWith + { + _groups = (_logic getVariable "TCL_Reinforcement"); + }; + }; + + if (count _groups > 0) then + { + _units = []; + + {_units append units _x} forEach _groups; + + _textUnit = "Unit"; + + if (count _units > 1) then + { + _textUnit = "Units"; + }; + + _textGroup = "Group"; + + if (count _groups > 1) then + { + _textGroup = "Groups"; + }; + + _string = format ["%1Currently there are
%2 A.I. %3
which holds
%4 A.I. %5
trying to kill you!", _header, count _groups, _textGroup, count _units, _textUnit]; + + hint parseText _string; + + sleep 10; + + hint ""; + }; + }; + + sleep 5; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Debug Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Debug + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_enemy","_array"]; + + private _rgba = [1,1,1,1]; + + private _marker = format ["%1", _unit]; + + private _color = "colorWhite"; + + if (_unit in _array) then + { + _rgba = [1,0,0,1]; + + _color = (markerColor _marker); + }; + + private _count = 100; + + while { (_count > 0) } do + { + if (alive _unit) then + { + drawLine3D [getPos _unit, getPos _enemy, _rgba]; + + _marker setMarkerColor _color; + + sleep 0.01; + } + else + { + _count = 0; + + _marker setMarkerColor "ColorGrey"; + }; + + _count = _count - 1; + }; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Get_In_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Get_In_F.sqf new file mode 100644 index 0000000..c6d3ab4 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Get_In_F.sqf @@ -0,0 +1,194 @@ +TCL_Get_In_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Get In Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Get In + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_group"]; + + if (TCL_System select 4) then + { + private _leader = (leader _group); + + private _objects = []; + + {_objects append (synchronizedObjects _x) } forEach units _group; + + {if (vehicle _x isKindOf "Man") then {_objects = _objects - [_x] } } forEach _objects; + + if (count _this == 1) then + { + _leader setVariable ["TCL_Get_In", True]; + } + else + { + private _vehicle = _this select 1; + + _leader setVariable ["TCL_Get_In", False]; + + _objects deleteAt (_objects find _vehicle); + }; + + if (count _objects > 0) then + { + private _count = 0; + + for "_count" from _count to (count _objects - 1) do + { + _vehicle = (_objects select _count); + + if ( (alive _vehicle) && { (count (crew _vehicle) == 0) } && { ( { (_vehicle isKindOf _x) } count ["Car","Tank","Air","Ship","StaticWeapon"] > 0) } ) exitWith + { + private _units = (units _group); + + [_units, _leader, _vehicle] call (TCL_Get_In_F select 1); + }; + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Get In Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Get In + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_units","_leader","_vehicle"]; + + private _turrets = [_vehicle] call (TCL_Get_In_F select 2); + + private _array = []; + + {if (vehicle _x isKindOf "Man") then {_array pushBack _x} } forEach _units; + + private ["_unit","_turret"]; + + private _count = 0; + + for "_count" from _count to (count _array - 1) do + { + _unit = (_array select _count); + + if (_vehicle emptyPositions "Driver" > 0) then + { + _unit assignAsDriver _vehicle; + _unit moveInDriver _vehicle; + } + else + { + if (_vehicle emptyPositions "Commander" > 0) then + { + _unit assignAsCommander _vehicle; + _unit moveInCommander _vehicle; + } + else + { + if (count _turrets > 1) then + { + _turret = (_turrets select 0); + + _unit assignAsTurret [_vehicle, _turret]; + _unit moveInTurret [_vehicle, _turret]; + + _turrets deleteAt (_turrets find _turret); + } + else + { + if (_vehicle emptyPositions "Gunner" > 0) then + { + _unit assignAsGunner _vehicle; + _unit moveInGunner _vehicle; + } + else + { + if (_vehicle emptyPositions "Cargo" > 0) then + { + _unit assignAsCargo _vehicle; + _unit moveInCargo _vehicle; + } + else + { + private _type = (_leader getVariable "TCL_Get_In"); + + if (_type) then + { + [_leader, _vehicle] call (TCL_Get_In_F select 0); + }; + }; + }; + }; + }; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Get In Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Get In + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_vehicle"]; + + private _array = []; + + private _turrets = (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "turrets"); + + if (isClass _turrets) then + { + if (count _turrets > 0) then + { + private ["_index","_turret"]; + + private _count = 0; + + for "_count" from _count to (count _turrets - 1) do + { + _index = _count; + + _array pushBack [_index]; + + _turret = (_turrets select _count); + + if (count (_turret >> "turrets") > 0) then + { + _array = [_array, _index, _turret] call (TCL_Get_In_F select 3); + }; + }; + }; + }; + + _array + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Get In Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Get In + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_array","_index","_turret"]; + + private _turrets = (_turret >> "turrets"); + + private _count = 0; + + for "_count" from _count to (count _turrets - 1) do + { + _array pushBack [_index, _count]; + }; + + _array + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Header_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Header_F.sqf new file mode 100644 index 0000000..26eda3d --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Header_F.sqf @@ -0,0 +1,68 @@ +TCL_Header_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Header Function #0 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + { + + format ["Tactical Combat Link
Debug ( %1 )
+
A.I. ( %2 ) + ---------------------------------------------
", + + (_this select 0), (_this select 1) ]; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Header Function #1 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + { + + format ["Tactical Combat Link
%1 ( %2 )
", + + (_this select 0), (_this select 1) ]; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Header Function #2 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + { + + format ["
Player ( Units ) + ---------------------------------------------
%1", + + (_this select 0) ]; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Header Function #3 + // //////////////////////////////////////////////////////////////////////////// + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {private ["_array","_return"]; + + _array = []; + + _return = [ (_this select 0), (_this select 1), "", "ff0000", "( Initialize )"] call (TCL_Debug_F select 3); + + _array set [count _array, _return]; + + _return = [ (_this select 0), (_this select 2), "", "ff0000", "( Delay )"] call (TCL_Debug_F select 3); + + _array set [count _array, _return]; + + format ["
Initialize ( System ) + ---------------------------------------------
%1 %2", + + (_array select 0), (_array select 1) ]; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Marker_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Marker_F.sqf new file mode 100644 index 0000000..8415fe3 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Marker_F.sqf @@ -0,0 +1,861 @@ +TCL_Marker_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Marker Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Marker + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_type"]; + + if (_type isEqualType "") then + { + if (TCL_Debug select 1) then + { + _this call (TCL_Marker_F select 1); + }; + } + else + { + if (TCL_Debug select 2) then + { + _this spawn (TCL_Marker_F select 2); + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Marker Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Marker + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_type","_object","_group","_logic"]; + + if (True) then + { + if (_type isEqualTo "TCL_Logic") exitWith + { + private _logic = _object; + + private _marker = [ [_type, _logic], (getPos _logic), "Icon", [1,1], "selector_selectedMission", "colorRed"] call TCL_Create_Marker_F; + }; + + if (_type isEqualTo "TCL_KnowsAbout") exitWith + { + private _marker = format ["%1%2", "TCL_Logic", _logic]; + + private _position = (getPos _logic); + + _position set [1, (_position select 1) + 30]; + + _marker setMarkerPos _position; + + if (alive _object) then + { + private _value = (_group knowsAbout vehicle _object); + + [_marker, _value] spawn + { + params ["_marker","_value"]; + + if (_value > 0) then + { + _value = (_value * 3); + + while { (_value > 0) } do + { + _marker setMarkerDir (markerDir _marker) + 30; + + // _marker setMarkerSize [_value, _value]; + + _value = _value - 1; + + sleep 1; + }; + }; + }; + }; + }; + + if (_type isEqualTo "TCL_Spot") exitWith + { + private _enemy = _object; + + private _marker = format ["%1%2", "TCL_Logic", _logic]; + + private _time = (_logic getVariable "TCL_Time"); + + _time = (_time - time); + + private "_string"; + + private _color = "colorGreen"; + + private _knowsAbout = (_group knowsAbout vehicle _enemy); + + private _groups = (_logic getVariable "TCL_Reinforcement"); + + private _bool = [_enemy, _groups] call TCL_Knowledge_F; + + if (_bool) then + { + _color = "colorRed"; + + _string = format ["%1 > %2 > %3 > %4 %5 > %6", group _enemy, _group, _group knowsAbout vehicle _enemy, round (leader _group distance _enemy), _groups, round _time]; + } + else + { + if (alive _enemy) then + { + _color = "colorGreen"; + + _string = format ["%1 > %2 > %3 > %4", "Unknown", _group, _groups, round _time]; + } + else + { + _color = "colorWhite"; + + _string = format ["%1 > %2 > %3 > %4", "Killed", _group, _groups, round _time]; + }; + }; + + _marker setMarkerColor _color; + + _marker setMarkerText _string; + }; + + if (_type isEqualTo "TCL_Enemy") exitWith + { + private _enemy = _object; + + private _marker = [ [_type, _group], (getPos _logic), "ELLIPSE", [100,100], "FDiagonal", "colorRed"] call TCL_Create_Marker_F; + + if (_marker isEqualTo "") exitWith {}; + + private _position = (getPos _logic); + + private _array = (_logic getVariable "TCL_Reinforcement"); + + private _index = (_array find _group); + + _index = _index + 1; + + private _value = (30 * _index); + + _position set [1, (_position select 1) - _value]; + + private _leader = (leader _group); + + private _text = [ [_type, (name _leader) ], _position, "Icon", [1,1], "mil_dot", "colorRed"] call TCL_Create_Marker_F; + + _text setMarkerText format ["%1 > %2 > %3 > %4", _group, _enemy, (_group knowsAbout vehicle _enemy), round (_leader distance _enemy) ]; + + private "_string"; + + private _color = "colorGreen"; + + private _knowsAbout = (_group knowsAbout vehicle _enemy); + + private _groups = (_logic getVariable "TCL_Reinforcement"); + + private _bool = [_enemy, _groups] call TCL_Knowledge_F; + + if (_bool) then + { + _object = "Unknown"; + + if (_knowsAbout > 0) then + { + _object = _enemy; + + _color = "colorRed"; + }; + + _string = format ["%1 > %2 > %3 > %4", _group, _object, (_group knowsAbout vehicle _enemy), round (_leader distance _enemy) ]; + } + else + { + if (alive _enemy) then + { + _color = "colorGreen"; + + _string = format ["%1 > %2 > %3 > %4", _group, "Unknown", (_group knowsAbout vehicle _enemy), round (_leader distance _enemy) ]; + } + else + { + _color = "colorWhite"; + + _string = format ["%1 > %2 > %3 > %4", _group, "Killed", (_group knowsAbout vehicle _enemy), round (_leader distance _enemy) ]; + }; + }; + + _text setMarkerColor _color; + + _text setMarkerText _string; + + _marker setMarkerColor _color; + + if (_knowsAbout < 1) then + { + _knowsAbout = 1; + }; + + [_marker, _text, _knowsAbout] spawn + { + params ["_marker","_text","_knowsAbout"]; + + private _size = 70; + + _size = (_size * _knowsAbout); + + while { (_size > 0) } do + { + _marker setMarkerSize [_size, _size]; + + _marker setMarkerDir (markerDir _marker) + _size; + + _size = _size - 10; + + sleep 0.1; + }; + + deleteMarker _text; + + deleteMarker _marker; + }; + }; + + if (_type isEqualTo "TCL_Position") exitWith + { + private _group = _object; + + if (count _this == 3) then + { + private _position = _this select 2; + + private _enemy = (_group getVariable "TCL_Enemy"); + + // private _enemy = (leader _group findNearestEnemy leader _group); + + private _marker = [ [_type, _group], _position, "Icon", [1,1], "mil_dot", "colorWhite"] call TCL_Create_Marker_F; + + if (_marker isEqualTo "") then + { + _marker = format ["%1%2", _type, _group]; + + _marker setMarkerPos _position; + }; + + _marker setMarkerText format ["%1 %2 %3", _group, (_group knowsAbout vehicle _enemy), round (leader _group distance _position) ]; + } + else + { + private _marker = format ["%1%2", _type, _group]; + + deleteMarker _marker; + }; + }; + + if (_type isEqualTo "TCL_Remount") exitWith + { + private _group = _object; + + if (count _this == 2) then + { + private _marker = format ["%1%2", "TCL_Position", _group]; + + private _position = (_group getVariable "TCL_Position"); + + _marker setMarkerPos _position; + + private _ai = (_group getVariable "TCL_AI"); + + _marker setMarkerText format ["%1 %2", _group, _ai]; + } + else + { + private _vehicle = _this select 2; + + private _marker = [ [_type, _group, _vehicle], (getPos _vehicle), "Icon", [1,1], "mil_dot", "colorWhite"] call TCL_Create_Marker_F; + + if (_marker isEqualTo "") exitWith {}; + + private _displayName = getText (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName"); + + _marker setMarkerText format ["%1 ( %2 )", _group, _displayName]; + + [_group, _vehicle, _marker] spawn + { + params ["_group","_vehicle","_marker"]; + + while { ( (_group in (TCL_Remount select 0) ) && (units _group findIf { ( (isNull objectParent _x) && (assignedVehicle _x == _vehicle) ) } > -1) ) } do + { + sleep 1; + }; + + deleteMarker _marker; + }; + }; + }; + + if (_type isEqualTo "TCL_Marker") exitWith + { + private _group = _object; + + private _trigger = _this select 2; + + private _area = (triggerArea _trigger); + + private _shape = "ELLIPSE"; + + if (_area select 3) then + { + _shape = "RECTANGLE"; + }; + + private _position = (getPos _trigger); + + private _brush = [ [_type, _position], _position, _shape, [ (_area select 0), (_area select 1) ], "Horizontal", "colorGreen"] call TCL_Create_Marker_F; + + private _border = [ [_type, _position, _area], _position, _shape, [ (_area select 0), (_area select 1) ], "Border", "colorGreen"] call TCL_Create_Marker_F; + + _brush setMarkerDir + (_area select 2); + + _border setMarkerDir + (_area select 2); + + [_group, _trigger, _brush, _border, _area] spawn + { + params ["_group","_trigger","_brush","_border","_area"]; + + private ["_enemy","_area0","_area1"]; + + while { (units _group findIf { (alive _x) } > -1) } do + { + _brush setMarkerColor "colorGreen"; + + _enemy = (_group getVariable "TCL_Enemy"); + + // _enemy = (leader _group findNearestEnemy leader _group); + + if (alive _enemy) then + { + if (_enemy inArea _trigger) then + { + _brush setMarkerColor "colorRed"; + }; + }; + + _area0 = (_area select 0); + _area1 = (_area select 1); + + while { ( (_area0 > 0) && (_area1 > 0) ) } do + { + _brush setMarkerSize [_area0, _area1]; + + _area0 = (_area0 - 10); + _area1 = (_area1 - 10); + + sleep 0.3; + }; + }; + + deleteMarker _brush; + deleteMarker _border; + }; + }; + + if (_type isEqualTo "TCL_Delete") exitWith + { + private _logic = _object; + + private _marker = format ["%1%2", "TCL_Logic", _logic]; + + deleteMarker _marker; + }; + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Marker Function #2 + // //////////////////////////////////////////////////////////////////////////// + // Marker + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit"]; + + private _type = nil; + + private _side = (side _unit); + + if (TCL_Debug select 3) then {_type = _unit} else {if (_unit == leader _unit) then {_type = (group _unit) } }; + + if (isNil "_type") exitWith {}; + + private _marker = [ [_type, time], (getPos _unit), "Icon", [1,1], "mil_triangle", "colorYellow"] call TCL_Create_Marker_F; + + private _array = (TCL_Players select 0); + + if (_unit in _array) exitWith + { + [_unit, _marker] spawn (TCL_Marker_F select 3); + }; + + private ["_group","_color","_vehicle","_displayName","_unitType","_groupType","_array","_enemy","_string"]; + + while { (alive _unit) } do + { + if ( (visibleMap) || (TCL_Multiplayer) ) then + { + _group = (group _unit); + + if (leader _unit in _array) exitWith + { + _type = "A.I."; + + _marker setMarkerPos (getPos _unit); + + _marker setMarkerDir (getDir _unit); + + _marker setMarkerText format ["%1 ( %2 ) %3", _unit, _side, _type]; + }; + + if (_group in (TCL_Disabled select 0) ) exitWith + { + _unit = objNull; + }; + + if (TCL_Debug select 3) then + { + if (_marker isEqualTo format ["%1", _unit] ) then + { + // _unit = _unit; + } + else + { + // [_unit] spawn (TCL_Marker_F select 2); + + // player sideChat format ["TCL_Marker_F > Changed > %1", _unit]; + + // _unit = objNull; + }; + }; + + _color = "colorYellow"; + + if (True) then + { + _unitType = "I.D.L.E."; + + if (fleeing _unit) exitWith + { + _unitType = "Fleeing"; _color = "colorWhite"; + }; + + if (captive _unit) exitWith + { + _unitType = "Captive"; _color = "colorWhite"; + }; + + if (side _unit == CIVILIAN) exitWith + { + _unitType = "Civilian"; _color = "colorWhite"; + }; + + if (_group in (TCL_Artillery select 0) ) exitWith + { + _unitType = "Artillery"; _color = "colorGreen"; + }; + + if (_unit in (TCL_Heal select 0) ) exitWith + { + _unitType = "( Heal )"; _color = "colorGreen"; + }; + + if (_unit in (TCL_Rearm select 0) ) exitWith + { + _unitType = "( Rearm )"; _color = "colorGreen"; + }; + + if (_unit in (TCL_Static_Weapon select 0) ) exitWith + { + _unitType = "( Static Weapon )"; _color = "colorGreen"; + }; + + if (_unit in (TCL_House_Search select 0) ) exitWith + { + _unitType = "( House Search )"; _color = "colorGreen"; + }; + + if (_group in (TCL_Suppressed select 0) ) exitWith + { + _unitType = "( Suppressed )"; _color = "colorGreen"; + }; + + if (_unit in (TCL_Take_Cover select 0) ) exitWith + { + _unitType = "( Take Cover )"; _color = "colorGreen"; + + if (_unit in (TCL_Flanking select 1) ) exitWith + { + _unitType = "( Flanking )"; _color = "colorGreen"; + }; + + if (_unit in (TCL_Flanking select 2) ) exitWith + { + _unitType = "( Flanking )"; _color = "colorBlue"; + }; + }; + + if (_unit in (TCL_Regroup select 0) ) exitWith + { + _unitType = "( Regroup )"; _color = "ColorBlue"; + }; + + if (_group in (TCL_Advancing select 0) ) exitWith + { + _unitType = "Advancing"; + }; + + if (_group in (TCL_Zeus select 1) ) exitWith + { + _unitType = "Zeus"; + }; + + if (_group in (TCL_Behaviour select 0) ) exitWith + { + _unitType = "Behaviour"; + }; + + if (_group in (TCL_Waiting select 0) ) exitWith + { + _unitType = "Waiting"; + }; + + if (_group in (TCL_Sneaking select 0) ) exitWith + { + _unitType = "Sneaking"; + }; + + if (_group in (TCL_Join select 0) ) exitWith + { + _unitType = "Joined"; + }; + + if (_group in (TCL_Enhanced select 0) ) exitWith + { + _unitType = "Enhanced"; + }; + + if (_group in (TCL_Freeze select 0) ) exitWith + { + _unitType = "Freeze"; + }; + + if (_group in (TCL_Default select 0) ) exitWith + { + _unitType = "Default"; + }; + + if (_group in (TCL_Reinforcement select 1) ) exitWith + { + _unitType = "Reinforcement"; + }; + + if (_group in (TCL_Reinforcement select 0) ) exitWith + { + if (_group in (TCL_Request select 0) ) then + { + _unitType = "Request"; + } + else + { + _unitType = "Requested"; + }; + }; + + if (_unit in (TCL_Watch select 0) ) exitWith + { + _unitType = "( Watch )"; _color = "colorGreen"; + }; + + if (_group in (TCL_Garrison select 0) ) exitWith + { + _unitType = "Garrison"; + }; + }; + + if (True) then + { + _groupType = "Combat"; + + if (_group in (TCL_Location select 0) ) exitWith + { + private _string = ["Location"]; _color = "colorGreen"; + + _array = (_group getVariable "TCL_Location"); + + _array = _array - [_group]; + + if (count _array > 0) then + { + private _count = (count _array); + + _string pushBack format ["%1", _count]; + }; + + if (_group in (TCL_Hold select 0) ) then + { + _string pushBack "Hold"; + + _color = "colorGreen"; + }; + + if (_group in (TCL_Defend select 0) ) then + { + _string pushBack "Defend"; + + _color = "colorGreen"; + }; + + _groupType = _string joinString " > "; + }; + + if (_group in (TCL_Hold select 0) ) exitWith + { + _groupType = "Hold"; _color = "colorGreen"; + }; + + if (_group in (TCL_Defend select 0) ) exitWith + { + _groupType = "Defend"; _color = "colorGreen"; + }; + + if (_group in (TCL_Custom select 0) ) exitWith + { + _groupType = "Custom"; + }; + }; + + if (_unit == leader _unit) then + { + _color = "colorRed"; + }; + + _enemy = (_group getVariable "TCL_Enemy"); + + if ( (alive _enemy) && (_unit knowsAbout vehicle _enemy > 0) ) then + { + _enemy = _enemy; + } + else + { + _enemy = "Unknown"; + }; + + _markerText = _marker; + + if (isNull objectParent _unit) then + { + _displayName = ""; + } + else + { + _vehicle = (vehicle _unit); + + if (_unit == driver _vehicle) then + { + _color = "colorWhite"; + } + else + { + if (_unit == commander _vehicle) then + { + _color = "colorBlue"; + } + else + { + if (_unit == gunner _vehicle) then + { + _color = "colorGreen"; + }; + }; + }; + + _displayName = getText (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName"); + }; + + if (_markerText isEqualTo "") then + { + _marker setMarkerText _markerText; + } + else + { + if (_unit == leader _unit) then + { + _string = format ["%1 %2 %3 %4 ( %5 %6 %7 %8 ) %9 %10 %11", _unitType, _groupType, _side, _unit, (behaviour _unit), (combatMode _unit), (speedMode _unit), (formation _unit), _enemy, (assignedTarget _unit), (unitPos _unit) ]; + } + else + { + _string = format ["%1 %2 %3 %4 %5 %6", _unitType, _side, _unit, _enemy, (assignedTarget _unit), (unitPos _unit) ]; + }; + + if (currentCommand _unit isEqualTo "") then + { + _string = _string + format [" %1", _displayName]; + } + else + { + _string = _string + format [" %1 %2", (currentCommand _unit), _displayName]; + }; + + if (False) then + { + if (_unit == leader _unit) then + { + _string = format ["%1 %2 %3 %4 ( %5 %6 %7 %8 )", _unitType, _groupType, _side, _unit, (behaviour _unit), (combatMode _unit), (speedMode _unit), (formation _unit) ]; + } + else + { + _string = format ["%1 %2 %3 %4", _unitType, _side, _unit]; + }; + + _string = _string + format ["> %1", (expectedDestination _unit) ]; + + if (currentCommand _unit isEqualTo "") exitWith {}; + + _string = _string + format [" %1 > %2", (unitPos _unit), (currentCommand _unit) ]; + }; + + if (unitReady _unit) then + { + _string = _string + " > Ready"; + }; + + _marker setMarkerText _string; + }; + + _marker setMarkerDir (getDir _unit); + + if (False) then + { + + _color = "colorWhite"; + + if (side _unit == EAST) then + { + _color = "colorRed"; + } + else + { + if (side _unit == WEST) then + { + _color = "colorBlue"; + } + else + { + if (side _unit == RESISTANCE) then + { + _color = "colorGreen"; + }; + }; + }; + + if (_unit == leader _unit) then + { + _color = "colorYellow"; + }; + + }; + + _marker setMarkerColor _color; + + _marker setMarkerPos (getPos _unit); + }; + + sleep 1; + }; + + _marker setMarkerColor "colorGrey"; + + _marker setMarkerText format ["%1 %2 ( %3:%4 )", _unit, _side, floor (time / 60), round (time % 60) ]; + + if (_type isEqualType grpNull) then + { + { [_x] spawn (TCL_Marker_F select 2) } forEach units _unit; + }; + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Marker Function #3 + // //////////////////////////////////////////////////////////////////////////// + // Marker + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit","_marker"]; + + private _side = (side _unit); + + _marker setMarkerColor "colorBlue"; + + private ["_type","_vehicle","_displayName"]; + + while { (alive _unit) } do + { + if ( (visibleMap) || (TCL_Multiplayer) ) then + { + if (TCL_Debug select 3) then + { + if (_marker isEqualTo format ["%1", _unit] ) then + { + _unit = _unit; + } + else + { + // [_unit] spawn (TCL_Marker_F select 2); + + // player sideChat format ["TCL_Marker_F > Changed > %1", _unit]; + + // _unit = objNull; + }; + }; + + _type = "Switchable"; + + if (_unit in (TCL_Players select 0) ) then + { + _type = "Playable"; + }; + + if (isNull objectParent _unit) then + { + _displayName = ""; + } + else + { + _vehicle = (vehicle _unit); + + _displayName = getText (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName"); + }; + + _marker setMarkerText format ["%1 ( %2 ) %3 ( %4 ) %5", _unit, _side, _type, (behaviour _unit), _displayName]; + + _marker setMarkerDir (getDir _unit); + + _marker setMarkerPos (getPos _unit); + }; + + sleep 1; + }; + + deleteMarker _marker; + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Public_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Public_F.sqf new file mode 100644 index 0000000..6755415 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Public_F.sqf @@ -0,0 +1,55 @@ +TCL_Public_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Public Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Public + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_object"]; + + if (_object isKindOf "Man") then + { + [_object] spawn (TCL_Fire_FX_F select 0); + } + else + { + [_object] spawn (TCL_Whiz_FX_F select 2); + }; + + True + + }, + + // //////////////////////////////////////////////////////////////////////////// + // Public Function #1 + // //////////////////////////////////////////////////////////////////////////// + // Public + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_object"]; + + if (_object isEqualType grpNull) then + { + private _group = _object; + + (TCL_Zeus select 0) pushBack _group; + } + else + { + private _group = _this select 1; + + if (_group in (TCL_Zeus select 1) ) then + { + _this call (TCL_EH_Zeus_F select 2); + } + else + { + _this call (TCL_EH_Zeus_F select 1); + }; + }; + + True + + } +]; diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Skill_F.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Skill_F.sqf new file mode 100644 index 0000000..5cad91e --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL/TCL_System_F/TCL_Skill_F.sqf @@ -0,0 +1,90 @@ +TCL_Skill_F = [ + + // //////////////////////////////////////////////////////////////////////////// + // Skill Function #0 + // //////////////////////////////////////////////////////////////////////////// + // Skill + // By =\SNKMAN/= + // //////////////////////////////////////////////////////////////////////////// + {params ["_unit"]; + + if (TCL_System select 5) then + { + private _value = 1; + + private _system = (TCL_System select 6); + + _value = (_value + _system); + + private ["_type","_skill","_random"]; + + private _count = 0; + + for "_count" from _count to 8 do + { + if (True) then + { + if (_count == 0) exitWith + { + _type = "general"; + }; + + if (_count == 1) exitWith + { + _type = "courage"; + }; + + if (_count == 2) exitWith + { + _type = "spotTime"; + }; + + if (_count == 3) exitWith + { + _type = "spotDistance"; + }; + + if (_count == 4) exitWith + { + _type = "aimingSpeed"; + }; + + if (_count == 5) exitWith + { + _type = "aimingShake"; + }; + + if (_count == 6) exitWith + { + _type = "aimingAccuracy"; + }; + + if (_count == 7) exitWith + { + _type = "reloadSpeed"; + }; + + if (_count == 8) exitWith + { + _type = "commanding"; + }; + }; + + _skill = (_unit skill _type); + + // player sideChat format ["TCL_Skill_F > Skill > %1 > %2 > %3", _unit, _type, (_unit skillFinal _type) ]; + + _random = (_skill / _value); + + _skill = (_skill + _random); + + _unit setSkill [_type, _skill]; + + // player sideChat format ["TCL_Skill_F > Skill > %1 > %2 > %3", _unit, _type, (_unit skillFinal _type) ]; + }; + }; + + True + + } +]; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL_Initialize.fsm b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL_Initialize.fsm new file mode 100644 index 0000000..8d8a369 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL_Initialize.fsm @@ -0,0 +1,646 @@ +/*%FSM*/ +/*%FSM*/ +/* +item0[] = {"Initialize",0,250,-25.000000,75.000000,75.000000,125.000000,0.000000,"Initialize"}; +item1[] = {"Delay",4,218,-25.000000,175.000000,75.000000,225.000000,0.000000,"Delay"}; +item2[] = {"E_H_",2,250,-25.000000,275.000000,75.000000,325.000000,0.000000,"E.H."}; +item3[] = {"Server",4,218,125.000000,275.000000,225.000000,325.000000,2.000000,"Server"}; +item4[] = {"A_I_",2,4346,125.000000,375.000000,225.000000,425.000000,0.000000,"A.I."}; +item5[] = {"Always",8,218,125.000000,475.000000,225.000000,525.000000,0.000000,"Always"}; +item6[] = {"_",2,250,125.000000,575.000000,225.000000,625.000000,0.000000,""}; +item7[] = {"Always",8,218,125.000000,675.000000,225.000000,725.000000,0.000000,"Always"}; +item8[] = {"F_X_",2,250,-25.000000,675.000000,75.000000,725.000000,0.000000,"F.X."}; +item9[] = {"Always",8,218,-25.000000,775.000000,75.000000,825.000000,0.000000,"Always"}; +item10[] = {"End",1,250,-25.000000,875.000000,75.000000,925.000000,0.000000,"End"}; +item11[] = {"Client",4,218,-175.000000,275.000000,-75.000000,325.000000,1.000000,"Client"}; +item12[] = {"Player",2,250,-175.000000,375.000000,-75.000000,425.000000,0.000000,"Player"}; +item13[] = {"Always",8,218,-175.000000,475.000000,-75.000000,525.000000,0.000000,"Always"}; +item14[] = {"__1",2,250,-175.000000,575.000000,-75.000000,625.000000,0.000000,""}; +item15[] = {"Always",8,218,-175.000000,675.000000,-75.000000,725.000000,0.000000,"Always"}; +item16[] = {"Disabled",4,218,-25.000000,375.000000,75.000000,425.000000,0.000000,"Disabled"}; +item17[] = {"End_1",1,250,-25.000000,475.000000,75.000000,525.000000,0.000000,"End"}; +link0[] = {0,1}; +link1[] = {1,2}; +link2[] = {2,3}; +link3[] = {2,11}; +link4[] = {2,16}; +link5[] = {3,4}; +link6[] = {4,5}; +link7[] = {5,6}; +link8[] = {6,7}; +link9[] = {7,8}; +link10[] = {8,9}; +link11[] = {9,10}; +link12[] = {11,12}; +link13[] = {12,13}; +link14[] = {13,14}; +link15[] = {14,15}; +link16[] = {15,8}; +link17[] = {16,17}; +globals[] = {0.000000,0,0,0,0,640,480,1,23,6316128,1,-286.323914,359.888031,938.887573,65.232391,662,895,1}; +window[] = {2,-1,-1,-1,-1,819,100,1060,100,3,680}; +*//*%FSM*/ +class FSM +{ + fsmName = "TCL_Initialize"; + class States + { + /*%FSM*/ + class Initialize + { + name = "Initialize"; + itemno = 0; + init = /*%FSM*/"/* ////////////////////////////////////////////////////////////////////////////////" \n + "\ \ Tactical Combat Link ( F.S.M. ) Initialize" \n + " \ \------------------------------------------------------------------------------" \n + " \ \ By =\SNKMAN/=" \n + " / /-----------------------------------------------------------------------------" \n + "*/ ///////////////////////////////////////////////////////////////////////////////" \n + "" \n + "call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Extension_F.sqf"");" \n + "" \n + "call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Database\TCL_FX.sqf"");" \n + "" \n + "call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Database\TCL_Debug.sqf"");" \n + "" \n + "call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Database\TCL_System.sqf"");" \n + "" \n + "call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Database\TCL_Resource.sqf"");" \n + "" \n + "private _delay = (TCL_System select 0);" \n + "" \n + "if (TCL_Multiplayer) then" \n + "{" \n + " if (_delay == 0) then" \n + " {" \n + " _delay = 0.1;" \n + " };" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Delay + { + itemno = 1; + priority = 0.000000; + to="E_H_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"( (time >= _delay) || (TCL_Initialize) )"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class E_H_ + { + name = "E_H_"; + itemno = 2; + init = /*%FSM*/"TCL_Zeus = [ [], [] ];" \n + "" \n + "call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_EH_F\TCL_EH_Zeus_F.sqf"");" \n + "" \n + "call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_EH_F\TCL_EH_Fired_F.sqf"");" \n + "" \n + "call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_EH_F\TCL_EH_Killed_F.sqf"");" \n + "" \n + "if (TCL_Dedicated) exitWith {};" \n + "" \n + "TCL_EH_Fired = [ [] ];" \n + "" \n + "execVM (TCL_Path+""TCL\TCL_ExecVM\TCL_EH_Fired.sqf"");"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Server + { + itemno = 3; + priority = 2.000000; + to="A_I_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"( (TCL_Preprocess) && ( (TCL_Server) || (TCL_Headless) ) )"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Client + { + itemno = 11; + priority = 1.000000; + to="Player"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(TCL_Preprocess)"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Disabled + { + itemno = 16; + priority = 0.000000; + to="End_1"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class A_I_ + { + name = "A_I_"; + itemno = 4; + init = /*%FSM*/"if (TCL_System select 1) then" \n + "{" \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_System_F\TCL_Debug_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_System_F\TCL_Header_F.sqf"");" \n + " " \n + " if (TCL_Debug select 0) then" \n + " {" \n + " [""TypeX"", ""Initialize""] spawn (TCL_Debug_F select 0);" \n + " };" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Database\TCL_AI.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Database\TCL_IQ.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Database\TCL_Radio.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Database\TCL_Tweak.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Database\TCL_Feature.sqf"");" \n + " " \n + " TCL_Database = True;" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_System_F\TCL_Skill_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_System_F\TCL_Marker_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_System_F\TCL_Get_In_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Tank_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Heal_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Watch_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Smoke_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Rearm_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Flare_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Mortar_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Follow_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Feature_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Regroup_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Garrison_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Flanking_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Surrender_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Artillery_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Advancing_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Suppressed_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Take_Cover_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_House_Search_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Feature_F\TCL_Static_Weapon_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Ship_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Move_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Radio_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Stuck_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Enemy_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Logic_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Assign_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Rating_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Reveal_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Remount_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Waiting_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Vehicle_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Unassign_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Sneaking_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Behaviour_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Helicopter_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_KnowsAbout_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Reinforcement_F\TCL_Reinforcement_F.sqf"");" \n + " " \n + " TCL_Players = [ [], [], [] ];" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Initialize_F\TCL_Players_F.sqf"");" \n + " " \n + " [ (playableUnits + switchableUnits) ] call (TCL_Players_F select 0);" \n + " " \n + " TCL_Idle = [ [] ];" \n + " " \n + " TCL_Hold = [ [] ];" \n + " " \n + " TCL_Groups = [ [] ];" \n + " " \n + " TCL_Defend = [ [] ];" \n + " " \n + " TCL_Custom = [ [] ];" \n + " " \n + " TCL_Freeze = [ [] ];" \n + " " \n + " TCL_Default = [ [] ];" \n + " " \n + " TCL_Location = [ [] ];" \n + " " \n + " TCL_Disabled = [ [] ];" \n + " " \n + " TCL_Enhanced = [ [] ];" \n + " " \n + " TCL_Artillery = [ [] ];" \n + " " \n + " TCL_Initialized = [ [] ];" \n + " " \n + " TCL_Static_Weapon = [ [], [], [] ];" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Initialize_F\TCL_Units_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Initialize_F\TCL_Groups_F.sqf"");" \n + " " \n + " [allGroups] call (TCL_Groups_F select 0);" \n + " " \n + " TCL_Vehicles = [ [], [] ];" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_Initialize_F\TCL_Vehicles_F.sqf"");" \n + " " \n + " [vehicles] call (TCL_Vehicles_F select 0);" \n + " " \n + " if (TCL_System select 7) then" \n + " {" \n + " execVM (TCL_Path+""TCL\TCL_ExecVM\TCL_Spawn.sqf"");" \n + " };" \n + " " \n + " TCL_Logic = [ [] ];" \n + " " \n + " TCL_Request = [ [] ];" \n + " " \n + " TCL_Reinforcement = [ [], [], [] ];" \n + " " \n + " TCL_Red = [ [] ];" \n + " " \n + " TCL_Join = [ [] ];" \n + " " \n + " TCL_Speed = [ [] ];" \n + " " \n + " TCL_Flare = [ [] ];" \n + " " \n + " TCL_Stuck = [ [] ];" \n + " " \n + " TCL_Assign = [ [] ];" \n + " " \n + " TCL_Retreat = [ [] ];" \n + " " \n + " TCL_Regroup = [ [] ];" \n + " " \n + " TCL_Vehicle = [ [] ];" \n + " " \n + " TCL_Remount = [ [] ];" \n + " " \n + " TCL_Waiting = [ [] ];" \n + " " \n + " TCL_Sneaking = [ [] ];" \n + " " \n + " TCL_Behaviour = [ [] ];" \n + " " \n + " TCL_Helicopter = [ [] ];" \n + " " \n + " TCL_Heal = [ [], [], [] ];" \n + " " \n + " TCL_Watch = [ [] ];" \n + " " \n + " TCL_Rearm = [ [], [], [] ];" \n + " " \n + " TCL_Garrison = [ [], [], [], [] ];" \n + " " \n + " TCL_Flanking = [ [], [], [], [] ];" \n + " " \n + " TCL_Surrender = [ [] ];" \n + " " \n + " TCL_Advancing = [ [], [] ];" \n + " " \n + " TCL_Suppressed = [ [], [] ];" \n + " " \n + " TCL_Take_Cover = [ [], [] ];" \n + " " \n + " TCL_House_Search = [ [], [] ];" \n + " " \n + " execVM (TCL_Path+""TCL\TCL_ExecVM\TCL_KnowsAbout.sqf"");" \n + " " \n + " if (TCL_Debug select 4) then" \n + " {" \n + " [""TypeX"", ""Cursor""] spawn (TCL_Debug_F select 1);" \n + " };" \n + " " \n + " if (TCL_Debug select 5) then" \n + " {" \n + " [""TypeX"", ""Mission""] spawn (TCL_Debug_F select 2);" \n + " };" \n + " " \n + " execVM (TCL_Path+""TCL\TCL_ExecVM\TCL_Monitor.sqf"");" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Always + { + itemno = 5; + priority = 0.000000; + to="_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class _ + { + name = "_"; + itemno = 6; + init = /*%FSM*/"call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_System_F\TCL_Public_F.sqf"");" \n + "" \n + """TCL_Host"" addPublicVariableEventHandler { (_this select 1) call (TCL_Public_F select 1) };"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Always + { + itemno = 7; + priority = 0.000000; + to="F_X_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class F_X_ + { + name = "F_X_"; + itemno = 8; + init = /*%FSM*/"if (TCL_System select 9) then" \n + "{" \n + " if (TCL_Server) then" \n + " {" \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_AddOns\TCL_Crew_FX_F.sqf"");" \n + " };" \n + " " \n + " if (TCL_Dedicated) exitWith {};" \n + " " \n + " TCL_Sound = False;" \n + " " \n + " if (isClass (configFile >> ""CfgPatches"" >> ""TCL_Sound"") ) then" \n + " {" \n + " TCL_Sound = True;" \n + " " \n + " if (TCL_FX select 0) then" \n + " {" \n + " TCL_Whiz_FX =" \n + " [" \n + " []," \n + " " \n + " call {private ""_detector"";" \n + " " \n + " private _object = ""EmptyDetector"";" \n + " " \n + " if (TCL_Debug select 6) then" \n + " {" \n + " _object = ""Sign_Arrow_Direction_F"";" \n + " };" \n + " " \n + " private _array = [];" \n + " " \n + " private _count = 0;" \n + " " \n + " for ""_count"" from _count to 15 do" \n + " {" \n + " _detector = _object createVehicleLocal [0,0,0];" \n + " " \n + " _array pushBack _detector;" \n + " };" \n + " " \n + " _array" \n + " " \n + " }" \n + " ];" \n + " };" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_AddOns\TCL_Whiz_FX_F.sqf"");" \n + " " \n + " if (TCL_FX select 4) then" \n + " {" \n + " execVM (TCL_Path+""TCL\TCL_AddOns\TCL_Ambient\TCL_Church.sqf"");" \n + " };" \n + " " \n + " if (TCL_FX select 5) then" \n + " {" \n + " execVM (TCL_Path+""TCL\TCL_AddOns\TCL_Ambient\TCL_Lighthouse.sqf"");" \n + " };" \n + " }" \n + " else" \n + " {" \n + " {TCL_FX set [_x, False] } count [0,2,4,5];" \n + " };" \n + " " \n + " if (isClass (configFile >> ""CfgPatches"" >> ""TCL_Radio"") ) then" \n + " {" \n + " if (TCL_FX select 6) then" \n + " {" \n + " // call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_AddOns\TCL_Chatter\TCL_Chatter_F.sqf"");" \n + " " \n + " // execVM (TCL_Path+""TCL\TCL_AddOns\TCL_Chatter\TCL_Chatter.sqf"");" \n + " };" \n + " };" \n + " " \n + " if (TCL_FX select 13) then" \n + " {" \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_AddOns\TCL_Fire_FX_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_AddOns\TCL_Explosion_FX_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_AddOns\TCL_Explosion_FX\TCL_Mud_FX_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_AddOns\TCL_Explosion_FX\TCL_Dust_FX_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_AddOns\TCL_Explosion_FX\TCL_Dirt_FX_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_AddOns\TCL_Explosion_FX\TCL_Flash_FX_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_AddOns\TCL_Explosion_FX\TCL_Shard_FX_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_AddOns\TCL_Explosion_FX\TCL_Stone_FX_F.sqf"");" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_AddOns\TCL_Explosion_FX\TCL_Smoke_FX_F.sqf"");" \n + " };" \n + " " \n + " TCL_Impact_FX = [0, [] ];" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_AddOns\TCL_Impact_FX_F.sqf"");" \n + "}" \n + "else" \n + "{" \n + " _count = 0;" \n + " " \n + " {if (_x isEqualType True) then {TCL_FX set [_count, False] }; _count = _count + 1} count TCL_FX;" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Always + { + itemno = 9; + priority = 0.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class End + { + name = "End"; + itemno = 10; + init = /*%FSM*/"TCL_Preprocess = False;" \n + "" \n + "if (TCL_Dedicated) exitWith {};" \n + "" \n + "if (TCL_System select 10) then" \n + "{" \n + " TCL_Respawn = [0, name player, rank player];" \n + " " \n + " call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_EH_F\TCL_EH_Respawn_F.sqf"");" \n + " " \n + " player addEventHandler [""Killed"", {_this spawn (TCL_EH_Respawn_F select 0) } ];" \n + "};" \n + "" \n + "private _curators = allCurators;" \n + "" \n + "if (_curators isEqualTo [] ) exitWith {};" \n + "" \n + "TCL_Curator = [ [] ];" \n + "" \n + "[_curators] execVM (TCL_Path+""TCL\TCL_ExecVM\TCL_Zeus.sqf"");"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + }; + }; + /*%FSM*/ + /*%FSM*/ + class Player + { + name = "Player"; + itemno = 12; + init = /*%FSM*/""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Always + { + itemno = 13; + priority = 0.000000; + to="__1"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(alive player)"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class __1 + { + name = "__1"; + itemno = 14; + init = /*%FSM*/"call compile preprocessFileLineNumbers (TCL_Path+""TCL\TCL_System_F\TCL_Public_F.sqf"");" \n + "" \n + """TCL_Public"" addPublicVariableEventHandler { (_this select 1) call (TCL_Public_F select 0) };"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Always + { + itemno = 15; + priority = 0.000000; + to="F_X_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class End_1 + { + name = "End_1"; + itemno = 17; + init = /*%FSM*/"// player sideChat format [""TCL_Initialize.fsm > Disabled > %1"", TCL_Preprocess];"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + }; + }; + /*%FSM*/ + }; + initState="Initialize"; + finalStates[] = + { + "End", + "End_1", + }; +}; +/*%FSM*/ \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/TCL_System/TCL_Preprocess.sqf b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL_Preprocess.sqf new file mode 100644 index 0000000..85dedc2 --- /dev/null +++ b/Server/mpmissions/epoch.Bornholm/TCL_System/TCL_Preprocess.sqf @@ -0,0 +1,64 @@ +/* //////////////////////////////////////////////////////////////////////////////// +\ \ Tactical Combat Link + \ \------------------------------------------------------------------------------ + \ \ Preprocess + \ \---------------------------------------------------------------------------- + / / By =\SNKMAN/= + / /----------------------------------------------------------------------------- +*/ /////////////////////////////////////////////////////////////////////////////// + +if (is3DEN) exitWith {}; + +if (isNil "TCL_Preprocess") then +{ + TCL_Server = False; + + TCL_Database = False; + + TCL_Preprocess = True; + + TCL_Initialize = False; + + if (isServer) then + { + TCL_Server = True; + }; + + TCL_Headless = False; + + TCL_Dedicated = False; + + TCL_Multiplayer = False; + + if (isMultiplayer) then + { + TCL_Interface = False; + + TCL_Multiplayer = True; + + if (isDedicated) then + { + TCL_Dedicated = True; + }; + + if (hasInterface) then + { + TCL_Interface = True; + }; + + if ( (TCL_Server) || (TCL_Interface) ) exitWith {}; + + TCL_Headless = True; + + TCL_Dedicated = True; + }; + + TCL_FilePatching = False; + + if (isFilePatchingEnabled) then + { + TCL_FilePatching = True; + }; + + execFSM (TCL_Path+"TCL_Initialize.fsm"); +}; \ No newline at end of file diff --git a/Server/mpmissions/epoch.Bornholm/init.sqf b/Server/mpmissions/epoch.Bornholm/init.sqf index fe4d889..579b2f0 100644 --- a/Server/mpmissions/epoch.Bornholm/init.sqf +++ b/Server/mpmissions/epoch.Bornholm/init.sqf @@ -14,3 +14,7 @@ if hasInterface then //Advanced towing only tow 1 car SA_MAX_TOWED_CARGO = 1; + +//Test of AI mod +TCL_Path = "TCL_System\"; +call compile preprocessFileLineNumbers (TCL_Path+"TCL_Preprocess.sqf"); From 4aa2e8ee874c06396a3927ec8681ea4305875944 Mon Sep 17 00:00:00 2001 From: Zepheris Date: Thu, 20 Feb 2020 16:11:10 -0700 Subject: [PATCH 4/8] Changed Player variable to not subtract 1. Status bar will now show all players logged in. --- .../addons/status_bar/adminBar.sqf | 78 ++++++++-------- .../addons/status_bar/adminBar_WS.sqf | 84 ++++++++--------- .../addons/status_bar/playerBar.sqf | 90 +++++++++---------- 3 files changed, 126 insertions(+), 126 deletions(-) diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar.sqf b/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar.sqf index a190f8d..1b75ae4 100644 --- a/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar.sqf +++ b/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar.sqf @@ -22,22 +22,22 @@ disableSerialization; _colour10 = parseText "#CC3300"; _colour0 = parseText "#CC0000"; _colourDead = parseText "#000000"; - - - while {true} do + + + while {true} do { sleep 1; - + //moved the creation of the status bar inside the loop and create it if it is null, - //this is to handle instance where the status bar is disappearing + //this is to handle instance where the status bar is disappearing if(isNull ((uiNamespace getVariable "statusBar")displayCtrl 55555)) then { diag_log "statusbar is null create"; disableSerialization; _rscLayer = "statusBar" call BIS_fnc_rscLayer; _rscLayer cutRsc["statusBar","PLAIN"]; - }; - + }; + //initialize variables and set values _unit = _this select 0; _damage = round ((1 - (damage player)) * 100); @@ -52,13 +52,13 @@ disableSerialization; _pos = getPosATL player; //switch to this below if you want to have world space coords displayed instead of gridref _dir = getDir (vehicle player); _grid = mapGridPosition player; - _xx = (format[_grid]) select [0,3]; - _yy = (format[_grid]) select [3,3]; + _xx = (format[_grid]) select [0,3]; + _yy = (format[_grid]) select [3,3]; _time = (round(240-(serverTime)/60)); //edit the '240' value (60*4=240) to change the countdown timer if your server restarts are shorter or longer than 4 hour intervals _hours = (floor(_time/60)); _minutes = (_time - (_hours * 60)); - _players = (count playableUnits -1); - + _players = (count playableUnits); + switch(_minutes) do { case 9: {_minutes = "09"}; case 8: {_minutes = "08"}; @@ -71,11 +71,11 @@ disableSerialization; case 1: {_minutes = "01"}; case 0: {_minutes = "00"}; }; - + //Colour coding //Damage _colourDamage = _colourDefault; - + switch true do { case(_damage >= 100) : {_colourDamage = _colour100;}; case((_damage >= 90) && (_damage < 100)) : {_colourDamage = _colour90;}; @@ -90,8 +90,8 @@ disableSerialization; case((_damage >= 1) && (_damage < 10)) : {_colourDamage = _colour0;}; case(_damage < 1) : {_colourDamage = _colourDead;}; }; - - + + //Hunger _colourHunger = _colourDefault; switch true do { @@ -108,9 +108,9 @@ disableSerialization; case((_hunger >= 1) && (_hunger < 10)) : {_colourHunger = _colour0;}; case(_hunger < 1) : {_colourHunger = _colourDead;}; }; - + //Thirst - _colourThirst = _colourDefault; + _colourThirst = _colourDefault; switch true do{ case(_thirst >= 100) : {_colourThirst = _colour100;}; case((_thirst >= 90) && (_thirst < 100)) : {_colourThirst = _colour90;}; @@ -125,7 +125,7 @@ disableSerialization; case((_thirst >= 1) && (_thirst < 10)) : {_colourThirst = _colour0;}; case(_thirst < 1) : {_colourThirst = _colourDead;}; }; - + //Energy _colourEnergy = _colourDefault; switch true do{ @@ -142,7 +142,7 @@ disableSerialization; case((_energyPercent >= 1) && (_energyPercent < 10)) : {_colourEnergy = _colour0;}; case(_energyPercent < 1) : {_colourEnergy = _colour0;}; }; - + //Toxicity _colourToxicity = _colourDefault; switch true do{ @@ -159,45 +159,45 @@ disableSerialization; case((_toxPercent >= 1) && (_toxPercent < 10)) : {_colourToxicity = _colour90;}; case(_toxPercent < 1) : {_colourToxicity = _colour100;}; }; - + //Stamina _colourStamina = _colourDefault; - ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText + ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText format[" %2 - %3%1 - %4 - %5%1 - %6%1 - %9 - %18 - %8%1 + %3%1 + %4 + %5%1 + %6%1 + %9 + %18 + %8%1 %19:%20 FPS: %7 GRIDREF: %16", - "%", + "%", _players, _damage, - _wallet, - _hunger, - _thirst, - _serverFPS, - _energyPercent, - _stamina, + _wallet, + _hunger, + _thirst, + _serverFPS, + _energyPercent, + _stamina, _colourDefault, _colourDamage, _colourHunger, _colourThirst, _colourEnergy, _colourStamina, - format["%1/%2",_xx,_yy], + format["%1/%2",_xx,_yy], _colourToxicity, _toxPercent, _hours, _minutes - - + + ]; }; -}; \ No newline at end of file +}; diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar_WS.sqf b/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar_WS.sqf index a0858b2..a5e64a7 100644 --- a/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar_WS.sqf +++ b/Server/mpmissions/epoch.Bornholm/addons/status_bar/adminBar_WS.sqf @@ -22,24 +22,24 @@ disableSerialization; _colour10 = parseText "#CC3300"; _colour0 = parseText "#CC0000"; _colourDead = parseText "#000000"; - - - - while {true} do + + + + while {true} do { - + sleep 1; - + //moved the creation of the status bar inside the loop and create it if it is null, - //this is to handle instance where the status bar is disappearing + //this is to handle instance where the status bar is disappearing if(isNull ((uiNamespace getVariable "statusBar")displayCtrl 55555)) then { diag_log "statusbar is null create"; disableSerialization; _rscLayer = "statusBar" call BIS_fnc_rscLayer; _rscLayer cutRsc["statusBar","PLAIN"]; - }; - + }; + //initialize variables and set values _unit = _this select 0; _damage = round ((1 - (damage player)) * 100); @@ -53,13 +53,13 @@ disableSerialization; _serverFPS = if (typeName EPOCH_diag_fps == "SCALAR") then [{EPOCH_diag_fps},{"MANIPULATED"}], _pos = getPosATL player; //switch to this below if you want to have world space coords displayed instead of gridref _dir = getDir (vehicle player); - _grid = mapGridPosition player; _xx = (format[_grid]) select [0,3]; - _yy = (format[_grid]) select [3,3]; + _grid = mapGridPosition player; _xx = (format[_grid]) select [0,3]; + _yy = (format[_grid]) select [3,3]; _time = (round(240-(serverTime)/60)); //edit the '240' value (60*4=240) to change the countdown timer if your server restarts are shorter or longer than 4 hour intervals _hours = (floor(_time/60)); _minutes = (_time - (_hours * 60)); - _players = (count playableunits -1); - + _players = (count playableunits); + switch(_minutes) do { case 9: {_minutes = "09"}; case 8: {_minutes = "08"}; @@ -72,11 +72,11 @@ disableSerialization; case 1: {_minutes = "01"}; case 0: {_minutes = "00"}; }; - + //Colour coding //Damage _colourDamage = _colourDefault; - + switch true do { case(_damage >= 100) : {_colourDamage = _colour100;}; case((_damage >= 90) && (_damage < 100)) : {_colourDamage = _colour90;}; @@ -91,8 +91,8 @@ disableSerialization; case((_damage >= 1) && (_damage < 10)) : {_colourDamage = _colour0;}; case(_damage < 1) : {_colourDamage = _colourDead;}; }; - - + + //Hunger _colourHunger = _colourDefault; switch true do { @@ -109,9 +109,9 @@ disableSerialization; case((_hunger >= 1) && (_hunger < 10)) : {_colourHunger = _colour0;}; case(_hunger < 1) : {_colourHunger = _colourDead;}; }; - + //Thirst - _colourThirst = _colourDefault; + _colourThirst = _colourDefault; switch true do{ case(_thirst >= 100) : {_colourThirst = _colour100;}; case((_thirst >= 90) && (_thirst < 100)) : {_colourThirst = _colour90;}; @@ -126,7 +126,7 @@ disableSerialization; case((_thirst >= 1) && (_thirst < 10)) : {_colourThirst = _colour0;}; case(_thirst < 1) : {_colourThirst = _colourDead;}; }; - + //Energy _colourEnergy = _colourDefault; switch true do{ @@ -143,7 +143,7 @@ disableSerialization; case((_energyPercent >= 1) && (_energyPercent < 10)) : {_colourEnergy = _colour0;}; case(_energyPercent < 1) : {_colourEnergy = _colour0;}; }; - + //Toxicity _colourToxicity = _colourDefault; switch true do{ @@ -160,44 +160,44 @@ disableSerialization; case((_toxPercent >= 1) && (_toxPercent < 10)) : {_colourToxicity = _colour90;}; case(_toxPercent < 1) : {_colourToxicity = _colour100;}; }; - + //Stamina _colourStamina = _colourDefault; - - //display the information - ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText + + //display the information + ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText format[" %2 - %3%1 - %4 - %5%1 - %6%1 - %9 - %19 - %8%1 + %3%1 + %4 + %5%1 + %6%1 + %9 + %19 + %8%1 FPS: %7 POS: %16 DIR: %17", - "%", + "%", _players, _damage, - _wallet, - _hunger, - _thirst, - _serverFPS, - _energyPercent, - _stamina, + _wallet, + _hunger, + _thirst, + _serverFPS, + _energyPercent, + _stamina, _colourDefault, _colourDamage, _colourHunger, _colourThirst, _colourEnergy, _colourStamina, - _pos, + _pos, _dir, _colourToxicity, _toxPercent ]; - + }; -}; \ No newline at end of file +}; diff --git a/Server/mpmissions/epoch.Bornholm/addons/status_bar/playerBar.sqf b/Server/mpmissions/epoch.Bornholm/addons/status_bar/playerBar.sqf index 3334646..6d5c159 100644 --- a/Server/mpmissions/epoch.Bornholm/addons/status_bar/playerBar.sqf +++ b/Server/mpmissions/epoch.Bornholm/addons/status_bar/playerBar.sqf @@ -22,22 +22,22 @@ disableSerialization; _colour10 = parseText "#CC3300"; _colour0 = parseText "#CC0000"; _colourDead = parseText "#000000"; - - - while {true} do + + + while {true} do { sleep 1; - + //moved the creation of the status bar inside the loop and create it if it is null, - //this is to handle instance where the status bar is disappearing + //this is to handle instance where the status bar is disappearing if(isNull ((uiNamespace getVariable "statusBar")displayCtrl 55555)) then { diag_log "statusbar is null create"; disableSerialization; _rscLayer = "statusBar" call BIS_fnc_rscLayer; _rscLayer cutRsc["statusBar","PLAIN"]; - }; - + }; + //initialize variables and set values _unit = _this select 0; _damage = round ((1 - (damage player)) * 100); @@ -50,15 +50,15 @@ disableSerialization; _energy = round(EPOCH_playerEnergy); _energyPercent = floor((_energy / 2500 ) * 100); _fps = format["%1", diag_fps]; - _grid = mapGridPosition player; - _xx = (format[_grid]) select [0,3]; - _yy = (format[_grid]) select [3,3]; + _grid = mapGridPosition player; + _xx = (format[_grid]) select [0,3]; + _yy = (format[_grid]) select [3,3]; _time = (round(240-(serverTime)/60)); //edit the '240' value (60*4=240) to change the countdown timer if your server restarts are shorter or longer than 4 hour intervals _hours = (floor(_time/60)); _minutes = (_time - (_hours * 60)); - _players = (count playableUnits -1); - - + _players = (count playableUnits); + + switch(_minutes) do { case 9: {_minutes = "09"}; case 8: {_minutes = "08"}; @@ -71,12 +71,12 @@ disableSerialization; case 1: {_minutes = "01"}; case 0: {_minutes = "00"}; }; - - + + //Colour coding //Damage _colourDamage = _colourDefault; - + switch true do { case(_damage >= 100) : {_colourDamage = _colour100;}; case((_damage >= 90) && (_damage < 100)) : {_colourDamage = _colour90;}; @@ -91,7 +91,7 @@ disableSerialization; case((_damage >= 1) && (_damage < 10)) : {_colourDamage = _colour0;}; case(_damage < 1) : {_colourDamage = _colourDead;}; }; - + //Hunger _colourHunger = _colourDefault; switch true do { @@ -108,11 +108,11 @@ disableSerialization; case((_hunger >= 1) && (_hunger < 10)) : {_colourHunger = _colour0;}; case(_hunger < 1) : {_colourHunger = _colourDead;}; }; - + //Thirst - _colourThirst = _colourDefault; + _colourThirst = _colourDefault; switch true do{ - + case(_thirst >= 100) : {_colourThirst = _colour100;}; case((_thirst >= 90) && (_thirst < 100)) : {_colourThirst = _colour90;}; case((_thirst >= 80) && (_thirst < 90)) : {_colourThirst = _colour80;}; @@ -126,11 +126,11 @@ disableSerialization; case((_thirst >= 1) && (_thirst < 10)) : {_colourThirst = _colour0;}; case(_thirst < 1) : {_colourThirst = _colourDead;}; }; - + //Energy _colourEnergy = _colourDefault; switch true do{ - + case(_energyPercent >= 100) : {_colourEnergy = _colour100;}; case((_energyPercent >= 90) && (_energyPercent < 100)) : {_colourEnergy = _colour90;}; case((_energyPercent >= 80) && (_energyPercent < 90)) : {_colourEnergy = _colour80;}; @@ -144,7 +144,7 @@ disableSerialization; case((_energyPercent >= 1) && (_energyPercent < 10)) : {_colourEnergy = _colour0;}; case(_energyPercent < 1) : {_colourEnergy = _colour0;}; }; - + //Toxicity _colourToxicity = _colourDefault; switch true do{ @@ -161,32 +161,32 @@ disableSerialization; case((_toxPercent >= 1) && (_toxPercent < 10)) : {_colourToxicity = _colour90;}; case(_toxPercent < 1) : {_colourToxicity = _colour100;}; }; - + //Stamina _colourStamina = _colourDefault; - - //display the information - ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText + + //display the information + ((uiNamespace getVariable "statusBar")displayCtrl 55555)ctrlSetStructuredText parseText format[" %2 - %3%1 - %4 - %5%1 - %6%1 + %3%1 + %4 + %5%1 + %6%1 %9 %20 - %8%1 + %8%1 FPS: %7 GRIDREF: %16 %17:%18", - "%", + "%", _players, _damage, - _wallet, - _hunger, - _thirst, - round diag_fps, - _energyPercent, + _wallet, + _hunger, + _thirst, + round diag_fps, + _energyPercent, _stamina, _colourDefault, _colourDamage, @@ -199,11 +199,11 @@ disableSerialization; _minutes, _colourToxicity, _toxPercent - + ]; - - - - - }; -}; \ No newline at end of file + + + + + }; +}; From da8bb5c4ba6969e120915f5568536494fb0762ee Mon Sep 17 00:00:00 2001 From: Zepheris Date: Fri, 21 Feb 2020 08:33:59 -0700 Subject: [PATCH 5/8] Disabled Flip Vehicle function. Its causing more harm than helping. Removed spawn message for spawning bike and mozzie. Epoch has a message stating its a temp vehicle. --- Server/mpmissions/epoch.Bornholm/init.sqf | 4 ++-- Server/mpmissions/epoch.Bornholm/scripts/ud/spawn_bike.sqf | 2 +- Server/mpmissions/epoch.Bornholm/scripts/ud/spawn_mozzie.sqf | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Server/mpmissions/epoch.Bornholm/init.sqf b/Server/mpmissions/epoch.Bornholm/init.sqf index 579b2f0..91b1e1e 100644 --- a/Server/mpmissions/epoch.Bornholm/init.sqf +++ b/Server/mpmissions/epoch.Bornholm/init.sqf @@ -7,7 +7,7 @@ if hasInterface then { [] ExecVM "addons\Status_Bar\init_statusBar.sqf"; [] ExecVM "VEMFr_client\sqf\initClient.sqf"; // Client-side part of VEMFr - FlipVic = compileFinal preProcessFileLineNumbers "scripts\flip.sqf"; + //FlipVic = compileFinal preProcessFileLineNumbers "scripts\flip.sqf"; execVM "scripts\playermarker.sqf"; execVM "addons\service_point\service_point.sqf"; }; @@ -17,4 +17,4 @@ SA_MAX_TOWED_CARGO = 1; //Test of AI mod TCL_Path = "TCL_System\"; -call compile preprocessFileLineNumbers (TCL_Path+"TCL_Preprocess.sqf"); +call compile preprocessFileLineNumbers (TCL_Path+"TCL_Preprocess.sqf"); diff --git a/Server/mpmissions/epoch.Bornholm/scripts/ud/spawn_bike.sqf b/Server/mpmissions/epoch.Bornholm/scripts/ud/spawn_bike.sqf index 32b58c5..8beed88 100644 --- a/Server/mpmissions/epoch.Bornholm/scripts/ud/spawn_bike.sqf +++ b/Server/mpmissions/epoch.Bornholm/scripts/ud/spawn_bike.sqf @@ -7,4 +7,4 @@ SPAZ = [player, _spawnPos, _spawnDir]; sleep 3; publicVariableServer "SPAZ"; sleep 1; -['You spawned a bike!. Gone at restart!',0,0.7,2,0] spawn bis_fnc_dynamictext; \ No newline at end of file +//['You spawned a bike!. Gone at restart!',0,0.7,2,0] spawn bis_fnc_dynamictext; diff --git a/Server/mpmissions/epoch.Bornholm/scripts/ud/spawn_mozzie.sqf b/Server/mpmissions/epoch.Bornholm/scripts/ud/spawn_mozzie.sqf index 4770b85..745676e 100644 --- a/Server/mpmissions/epoch.Bornholm/scripts/ud/spawn_mozzie.sqf +++ b/Server/mpmissions/epoch.Bornholm/scripts/ud/spawn_mozzie.sqf @@ -7,4 +7,4 @@ UDMOZZIE = [player, _spawnPos, _spawnDir]; sleep 3; publicVariableServer "UDMOZZIE"; sleep 1; -['You spawned a Mozzie. Gone at restart!',0,0.7,2,0] spawn bis_fnc_dynamictext; +//['You spawned a Mozzie. Gone at restart!',0,0.7,2,0] spawn bis_fnc_dynamictext; From 9eca0c64ab8a891f56df60e65482d4139462b573 Mon Sep 17 00:00:00 2001 From: Zepheris Date: Fri, 21 Feb 2020 19:12:48 -0700 Subject: [PATCH 6/8] Forgot to remove the Flip Vehicle option in the menu --- .../epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Server/mpmissions/epoch.Bornholm/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp b/Server/mpmissions/epoch.Bornholm/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp index 46ee7de..9eb1645 100644 --- a/Server/mpmissions/epoch.Bornholm/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp +++ b/Server/mpmissions/epoch.Bornholm/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp @@ -14,6 +14,7 @@ */ //added by Zepheris +/* class flip_vic { condition = "dyna_isVehicle && !dyna_locked"; @@ -21,6 +22,7 @@ class flip_vic icon = "x\addons\a3_epoch_code\Data\UI\buttons\build_upgrade.paa"; tooltip = "Flip Vehicle"; }; +*/ //end added by Zepheris class build_upgrade From bbc6017c149eb9a24d4b6cf471da23da819bfd53 Mon Sep 17 00:00:00 2001 From: Zepheris Date: Fri, 21 Feb 2020 23:17:37 -0700 Subject: [PATCH 7/8] Completed Revive script! --- .../compile/epoch_player/EPOCH_server_revivePlayer.sqf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Server/@epochhive/addons/epoch_server/compile/epoch_player/EPOCH_server_revivePlayer.sqf b/Server/@epochhive/addons/epoch_server/compile/epoch_player/EPOCH_server_revivePlayer.sqf index 6bdc712..37f2a27 100644 --- a/Server/@epochhive/addons/epoch_server/compile/epoch_player/EPOCH_server_revivePlayer.sqf +++ b/Server/@epochhive/addons/epoch_server/compile/epoch_player/EPOCH_server_revivePlayer.sqf @@ -116,7 +116,8 @@ if (!local _player) then { _newPlyr setVariable ["SETUP", true]; _newPlyr setVariable ["PUID", _playerUID]; _newPlyr setVariable ["GROUP", _playerGroup]; - _newPlyr setVariable ["REVIVE", false]; + //Zepheris - Comment Revive variable + //_newPlyr setVariable ["REVIVE", false]; _newPlyr setVariable ["SERVER_VARS",_player getVariable ["SERVER_VARS",[]]]; _newPlyr setVariable ["EPOCH_playerPlayTime",_player getvariable ["EPOCH_playerPlayTime",0],true]; @@ -165,7 +166,7 @@ if (!local _player) then { // send stat to reviver [_reviver, "Revives", 1, true] call EPOCH_server_updatePlayerStats; - + // send karma stat to reviver _kIndex = EPOCH_communityStats find "Karma"; _reviverCStats = _reviver getVariable["COMMUNITY_STATS", EPOCH_defaultStatVars]; From 7ace3a162a8ddbad4564e9565e516f82a8f62351 Mon Sep 17 00:00:00 2001 From: Zepheris Date: Sat, 22 Feb 2020 02:12:58 -0700 Subject: [PATCH 8/8] Trying to prevent items from despawning --- .../mpmissions/epoch.Bornholm/epoch_config/sandbox_config.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Server/mpmissions/epoch.Bornholm/epoch_config/sandbox_config.hpp b/Server/mpmissions/epoch.Bornholm/epoch_config/sandbox_config.hpp index d0c02e0..2313c58 100644 --- a/Server/mpmissions/epoch.Bornholm/epoch_config/sandbox_config.hpp +++ b/Server/mpmissions/epoch.Bornholm/epoch_config/sandbox_config.hpp @@ -40,12 +40,12 @@ forceRotorLibSimulation = 1; saving = 0; corpseManagerMode = 0; -corpseLimit = 10; +corpseLimit = 1000; corpseRemovalMinTime = 1200; corpseRemovalMaxTime = 3600; wreckManagerMode = 0; -wreckLimit = 2; +wreckLimit = 200; wreckRemovalMinTime = 60; wreckRemovalMaxTime = 360;