From 7366d4df4ecb4fb96aa95245205b273b9176d512 Mon Sep 17 00:00:00 2001 From: Defent Date: Wed, 26 Aug 2015 15:12:14 +0200 Subject: [PATCH] Fucking github messing with my shit --- $PBOPREFIX$ | 1 + $PREFIX$ | 1 + DMS_init.sqf | 3 + PboPrefix.txt | 1 + config.cpp | 19 ++++++ crates/DMS_CreateBox.sqf | 24 ++++++++ fn_start_DMS.sqf | 2 + missions/MM1.sqf | 47 +++++++++++++++ missions/MM10.sqf | 50 ++++++++++++++++ missions/MM2.sqf | 47 +++++++++++++++ missions/MM3.sqf | 48 +++++++++++++++ missions/MM4.sqf | 49 ++++++++++++++++ missions/MM5.sqf | 49 ++++++++++++++++ missions/MM6.sqf | 49 ++++++++++++++++ missions/MM7.sqf | 49 ++++++++++++++++ missions/MM8.sqf | 49 ++++++++++++++++ missions/MM9.sqf | 47 +++++++++++++++ scripts/DMS_Config.sqf | 16 +++++ scripts/DMS_CreateMarker.sqf | 16 +++++ scripts/DMS_cleanup.sqf | 20 +++++++ scripts/DMS_findSafePos.sqf | 33 +++++++++++ scripts/DMS_selectMission.sqf | 25 ++++++++ scripts/DMS_spawnAI.sqf | 107 ++++++++++++++++++++++++++++++++++ 23 files changed, 752 insertions(+) create mode 100644 $PBOPREFIX$ create mode 100644 $PREFIX$ create mode 100644 PboPrefix.txt create mode 100644 config.cpp create mode 100644 crates/DMS_CreateBox.sqf create mode 100644 fn_start_DMS.sqf create mode 100644 missions/MM1.sqf create mode 100644 missions/MM10.sqf create mode 100644 missions/MM2.sqf create mode 100644 missions/MM3.sqf create mode 100644 missions/MM4.sqf create mode 100644 missions/MM5.sqf create mode 100644 missions/MM6.sqf create mode 100644 missions/MM7.sqf create mode 100644 missions/MM8.sqf create mode 100644 missions/MM9.sqf create mode 100644 scripts/DMS_Config.sqf create mode 100644 scripts/DMS_CreateMarker.sqf create mode 100644 scripts/DMS_cleanup.sqf create mode 100644 scripts/DMS_findSafePos.sqf create mode 100644 scripts/DMS_selectMission.sqf create mode 100644 scripts/DMS_spawnAI.sqf diff --git a/$PBOPREFIX$ b/$PBOPREFIX$ new file mode 100644 index 0000000..493cf09 --- /dev/null +++ b/$PBOPREFIX$ @@ -0,0 +1 @@ +x\addons\DMS \ No newline at end of file diff --git a/$PREFIX$ b/$PREFIX$ new file mode 100644 index 0000000..493cf09 --- /dev/null +++ b/$PREFIX$ @@ -0,0 +1 @@ +x\addons\DMS \ No newline at end of file diff --git a/DMS_init.sqf b/DMS_init.sqf index d35dfce..1bf7c24 100644 --- a/DMS_init.sqf +++ b/DMS_init.sqf @@ -25,10 +25,13 @@ if(isServer) then { call DMS_selectMission; + + //[] call compile preprocessFileLineNumbers "\x\addons\dms\scripts\DMS_selectMission.sqf"; //[] execVM "\x\addons\dms\scripts\DMS_selectMission.sqf"; call DMS_selectMission; diag_log "DMS :: Functions loaded - starting the rest of the script."; + }; diff --git a/PboPrefix.txt b/PboPrefix.txt new file mode 100644 index 0000000..5dba6ae --- /dev/null +++ b/PboPrefix.txt @@ -0,0 +1 @@ +x\addons\dms \ No newline at end of file diff --git a/config.cpp b/config.cpp new file mode 100644 index 0000000..c3e1e8b --- /dev/null +++ b/config.cpp @@ -0,0 +1,19 @@ +class CfgPatches { + class A3_dms { + units[] = {}; + weapons[] = {}; + a3_DMS_version = 1.0; + requiredVersion = 1.36; + requiredAddons[] = {}; + }; +}; +class CfgFunctions { + class dms { + class main { + file = "\x\addons\dms"; + class start_dms { + postInit = 1; + }; + }; + }; +}; \ No newline at end of file diff --git a/crates/DMS_CreateBox.sqf b/crates/DMS_CreateBox.sqf new file mode 100644 index 0000000..d75d33b --- /dev/null +++ b/crates/DMS_CreateBox.sqf @@ -0,0 +1,24 @@ +// The content of the boxes. +DMS_Box1 = { +private["_crate"]; + _crate = _this select 0; + clearWeaponCargoGlobal _crate; + clearMagazineCargoGlobal _crate; + clearItemCargoGlobal _crate; + _crate addMagazineCargoGlobal ["Exile_Item_WoodWallKit",6]; + _crate addMagazineCargoGlobal ["Exile_Item_WoodWallHalfKit",2]; + _crate addMagazineCargoGlobal ["Exile_Item_DoorwayKit",1]; + _crate addMagazineCargoGlobal ["Exile_Item_PlasticBottleFreshWater",5]; + _crate addMagazineCargoGlobal ["Exile_Melee_Axe",2]; + _crate addMagazineCargoGlobal ["Exile_Item_BBQ_Sandwich",2]; + _crate addMagazineCargoGlobal ["Exile_Item_Beer",3]; + _crate addMagazineCargoGlobal ["Exile_Item_CamoTentKit",3]; + _crate addMagazineCargoGlobal ["Exile_Item_CampFireKit",5]; + _crate addMagazineCargoGlobal ["Exile_Item_InstaDoc",5]; + _crate addMagazineCargoGlobal ["Exile_Item__JunkMetal",2]; + _crate addMagazineCargoGlobal ["Exile_Item_SafeKit",1]; + _crate addMagazineCargoGlobal ["Exile_Item_MetalBoard",2]; + _crate addMagazineCargoGlobal ["Exile_Item_DuctTape",2]; + _crate addMagazineCargoGlobal ["Exile_Item_ExtensionCord",2]; + _crate addMagazineCargoGlobal ["Exile_Item_PortableGeneratorkit",1]; +}; diff --git a/fn_start_DMS.sqf b/fn_start_DMS.sqf new file mode 100644 index 0000000..aeaa845 --- /dev/null +++ b/fn_start_DMS.sqf @@ -0,0 +1,2 @@ +[] execVM "\x\addons\dms\dms_init.sqf"; +diag_log format ["DMS :: Loading Defents Mission System"]; diff --git a/missions/MM1.sqf b/missions/MM1.sqf new file mode 100644 index 0000000..63c7be7 --- /dev/null +++ b/missions/MM1.sqf @@ -0,0 +1,47 @@ +private ["_crate","_pos","_missname","_aiAmmount","_misText","_missEnd","_group"]; + + +// associate pos with find safe pos fnc +_pos = call DMS_findSafePos; + + + +_missname = "Main Mission 1"; +diag_log format["DMS :: Main Mission 1 started at [%1]",_pos]; + + +["standardHintRequest",["Mission starting! Check your map"]] call ExileServer_system_network_send_broadcast; + + +// Spawn Marker +[_pos,_missname] call DMS_CreateMarker; + +// Spawn Box +_crate = createVehicle ["Box_NATO_AmmoOrd_F",[(_pos select 0) - 10, _pos select 1,0],[], 0, "CAN_COLLIDE"]; +[_crate] call DMS_Box1; +sleep 2; +//_crate = [_pos,40,4,2,2] execVM "mission\crates\MM_Box1.sqf"; + +// spawn AI +//[(_pos),(5),(4)] call DMS_SpawnAI; +[(_pos),(5),(4)] call DMS_DMS_SpawnAI; + +waitUntil{{isPlayer _x && _x distance _pos < 30 } count playableUnits > 0}; +/* + +[_pos] call MissionCompleted; +[_pos,] call MissionCleanup; +*/ + +["standardHintRequest",["Mission has ended, good job!"]] call ExileServer_system_network_send_broadcast; + +// Run Cleanup +["Ended","Clean"] call DMS_CleanUp; + + + + + +sleep 150; + +CALL DMS_selectMission.sqf; diff --git a/missions/MM10.sqf b/missions/MM10.sqf new file mode 100644 index 0000000..91e76f9 --- /dev/null +++ b/missions/MM10.sqf @@ -0,0 +1,50 @@ +private ["_crate","_pos","_missname","_aiAmmount","_misText","_missEnd","_group"]; + +/* +_playerClose = false; +_mainTimer = true; +//_missStartTime = floor(time); +*/ + +// associate pos with find safe pos +_pos = call DMS_findSafePos; + + +_missname = "Main Mission 10"; +diag_log format["DMS :: Main Mission 10 started at [%1]",_pos]; + +["standardHintRequest",["Mission starting! Check your map"]] call ExileServer_system_network_send_broadcast; + + +// Spawn Marker +[_pos,_missname] call DMS_CreateMarker; + +// Spawn Box +_crate = createVehicle ["Box_NATO_AmmoOrd_F",[(_pos select 0) - 10, _pos select 1,0],[], 0, "CAN_COLLIDE"]; +[_crate] call DMS_Box1; + +sleep 2; +//_crate = [_pos,40,4,2,2] execVM "mission\crates\MM_Box1.sqf"; + +// spawn AI +//[(_pos),(5),(4)] call DMS_SpawnAI; +[(_pos),(5),(4)] call DMS_SpawnAI; + + + +waitUntil{{isPlayer _x && _x distance _pos < 30 } count playableUnits > 0}; + +["standardHintRequest",["Mission has ended, good job!"]] call ExileServer_system_network_send_broadcast; + +// Run Cleanup +[] call DMS_CleanUp; + + deleteMarker "DMS_MainMarker"; + deleteMarker "DMS_MainDot"; + + + +sleep 150; + +CALL DMS_selectMission.sqf; + diff --git a/missions/MM2.sqf b/missions/MM2.sqf new file mode 100644 index 0000000..5c99653 --- /dev/null +++ b/missions/MM2.sqf @@ -0,0 +1,47 @@ +private ["_crate","_pos","_missname","_aiAmmount","_misText","_missEnd","_group"]; + +/* +_playerClose = false; +_mainTimer = true; +//_missStartTime = floor(time); +*/ + +// associate pos with find safe pos +_pos = call DMS_findSafePos; + + +_missname = "Main Mission 2"; +diag_log format["DMS :: Main Mission 2 started at [%1]",_pos]; + +["standardHintRequest",["Mission starting! Check your map"]] call ExileServer_system_network_send_broadcast; + +// Spawn Marker +[_pos,_missname] call DMS_CreateMarker; + +// Spawn Box +_crate = createVehicle ["Box_NATO_AmmoOrd_F",[(_pos select 0) - 10, _pos select 1,0],[], 0, "CAN_COLLIDE"]; +[_crate] call DMS_Box1; + +sleep 2; +//_crate = [_pos,40,4,2,2] execVM "mission\crates\MM_Box1.sqf"; + +// spawn AI +//[(_pos),(5),(4)] call DMS_SpawnAI; +[(_pos),(5),(4)] call DMS_DMS_SpawnAI; + + + +waitUntil{{isPlayer _x && _x distance _pos < 30 } count playableUnits > 0}; + +["standardHintRequest",["Mission has ended, good job!"]] call ExileServer_system_network_send_broadcast; + +// Run Cleanup +[] call DMS_CleanUp; + + + deleteMarker "DMS_MainMarker"; + deleteMarker "DMS_MainDot"; + +sleep 150; + +CALL DMS_selectMission.sqf; diff --git a/missions/MM3.sqf b/missions/MM3.sqf new file mode 100644 index 0000000..c7e5819 --- /dev/null +++ b/missions/MM3.sqf @@ -0,0 +1,48 @@ +private ["_crate","_pos","_missname","_aiAmmount","_misText","_missEnd","_group"]; + +/* +_playerClose = false; +_mainTimer = true; +//_missStartTime = floor(time); +*/ + +// associate pos with find safe pos +_pos = call DMS_findSafePos; + + +_missname = "Main Mission 3"; +diag_log format["DMS :: Main Mission 3 started at [%1]",_pos]; + +["standardHintRequest",["Mission starting! Check your map"]] call ExileServer_system_network_send_broadcast; + +// Spawn Marker +[_pos,_missname] call DMS_CreateMarker; + +// Spawn Box +_crate = createVehicle ["Box_NATO_AmmoOrd_F",[(_pos select 0) - 10, _pos select 1,0],[], 0, "CAN_COLLIDE"]; +[_crate] call DMS_Box1; +sleep 2; +//_crate = [_pos,40,4,2,2] execVM "mission\crates\MM_Box1.sqf"; + +// spawn AI +//[(_pos),(5),(4)] call DMS_SpawnAI; +[(_pos),(5),(4)] call DMS_SpawnAI; + + + +waitUntil{{isPlayer _x && _x distance _pos < 30 } count playableUnits > 0}; + +["standardHintRequest",["Mission has ended, good job!"]] call ExileServer_system_network_send_broadcast; + + +// Run Cleanup +[] call DMS_CleanUp; + + deleteMarker "DMS_MainMarker"; + deleteMarker "DMS_MainDot"; + + + +sleep 150; + +CALL DMS_selectMission.sqf; \ No newline at end of file diff --git a/missions/MM4.sqf b/missions/MM4.sqf new file mode 100644 index 0000000..3c8c7af --- /dev/null +++ b/missions/MM4.sqf @@ -0,0 +1,49 @@ +private ["_crate","_pos","_missname","_aiAmmount","_misText","_missEnd","_group"]; + +/* +_playerClose = false; +_mainTimer = true; +//_missStartTime = floor(time); +*/ + +// associate pos with find safe pos +_pos = call DMS_findSafePos; + + + _missname = "Main Mission 4"; +diag_log format["DMS :: Main Mission 4 started at [%1]",_pos]; + +["standardHintRequest",["Mission starting! Check your map"]] call ExileServer_system_network_send_broadcast; + + + +// Spawn Marker +[_pos,_missname] call DMS_CreateMarker; + +// Spawn Box +_crate = createVehicle ["Box_NATO_AmmoOrd_F",[(_pos select 0) - 10, _pos select 1,0],[], 0, "CAN_COLLIDE"]; +[_crate] call DMS_Box1; +sleep 2; +//_crate = [_pos,40,4,2,2] execVM "mission\crates\MM_Box1.sqf"; + +// spawn AI +//[(_pos),(5),(4)] call DMS_SpawnAI; +[(_pos),(5),(4)] call DMS_SpawnAI; + + + +waitUntil{{isPlayer _x && _x distance _pos < 30 } count playableUnits > 0}; + +["standardHintRequest",["Mission has ended, good job!"]] call ExileServer_system_network_send_broadcast; + +// Run Cleanup +[] call DMS_CleanUp; + + + deleteMarker "DMS_MainMarker"; + deleteMarker "DMS_MainDot"; + +sleep 150; + +CALL DMS_selectMission.sqf; + diff --git a/missions/MM5.sqf b/missions/MM5.sqf new file mode 100644 index 0000000..1136a08 --- /dev/null +++ b/missions/MM5.sqf @@ -0,0 +1,49 @@ +private ["_crate","_pos","_missname","_aiAmmount","_misText","_missEnd","_group"]; + +/* +_playerClose = false; +_mainTimer = true; +//_missStartTime = floor(time); +*/ + +// associate pos with find safe pos +_pos = call DMS_findSafePos; + +_missname = "Main Mission 5"; +diag_log format["DMS :: Main Mission 5 started at [%1]",_pos]; + +["standardHintRequest",["Mission starting! Check your map"]] call ExileServer_system_network_send_broadcast; + + +// Spawn Marker +[_pos,_missname] call DMS_CreateMarker; + +// Spawn Box +_crate = createVehicle ["Box_NATO_AmmoOrd_F",[(_pos select 0) - 10, _pos select 1,0],[], 0, "CAN_COLLIDE"]; +//[_crate] call createBox; +// [_crate, amount of weapons, amount of ammo] call createBox; +[_crate] call DMS_Box1; + +sleep 2; + + +//[_pos, amount of ai ] call DMS_SpawnAI; +[_pos,4] call DMS_SpawnAI; + + + +waitUntil{{isPlayer _x && _x distance _pos < 30 } count playableUnits > 0}; + + +["standardHintRequest",["Mission has ended, good job!"]] call ExileServer_system_network_send_broadcast; + +// Run Cleanup +[] call DMS_CleanUp; + + + deleteMarker "DMS_MainMarker"; + deleteMarker "DMS_MainDot"; + +sleep 150; + +CALL DMS_selectMission.sqf; diff --git a/missions/MM6.sqf b/missions/MM6.sqf new file mode 100644 index 0000000..1901d64 --- /dev/null +++ b/missions/MM6.sqf @@ -0,0 +1,49 @@ +private ["_crate","_pos","_missname","_aiAmmount","_misText","_missEnd","_group"]; + +/* +_playerClose = false; +_mainTimer = true; +//_missStartTime = floor(time); +*/ + +// associate pos with find safe pos +_pos = call DMS_findSafePos; + + +_missname = "Main Mission 6"; +diag_log format["DMS :: Main Mission 6 started at [%1]",_pos]; + +["standardHintRequest",["Mission starting! Check your map"]] call ExileServer_system_network_send_broadcast; + +// Spawn Marker +[_pos,_missname] call DMS_CreateMarker; + +// Spawn Box +_crate = createVehicle ["Box_NATO_AmmoOrd_F",[(_pos select 0) - 10, _pos select 1,0],[], 0, "CAN_COLLIDE"]; +[_crate] call DMS_Box1; + +sleep 2; +//_crate = [_pos,40,4,2,2] execVM "mission\crates\MM_Box1.sqf"; + +// spawn AI +//[(_pos),(5),(4)] call DMS_SpawnAI; +[(_pos),(5),(4)] call DMS_SpawnAI; + + + +waitUntil{{isPlayer _x && _x distance _pos < 30 } count playableUnits > 0}; + + +["standardHintRequest",["Mission has ended, good job!"]] call ExileServer_system_network_send_broadcast; + +// Run Cleanup +[] call DMS_CleanUp; + + deleteMarker "DMS_MainMarker"; + deleteMarker "DMS_MainDot"; + + + +sleep 150; + +CALL DMS_selectMission.sqf; diff --git a/missions/MM7.sqf b/missions/MM7.sqf new file mode 100644 index 0000000..542aec9 --- /dev/null +++ b/missions/MM7.sqf @@ -0,0 +1,49 @@ +private ["_crate","_pos","_missname","_aiAmmount","_misText","_missEnd","_group"]; + + +/* +_playerClose = false; +_mainTimer = true; +//_missStartTime = floor(time); +*/ + +// associate pos with find safe pos +_pos = call DMS_findSafePos; + + +_missname = "Main Mission 7"; +diag_log format["DMS :: Main Mission 7 started at [%1]",_pos]; + +["standardHintRequest",["Mission starting! Check your map"]] call ExileServer_system_network_send_broadcast; + +// Spawn Marker +[_pos,_missname] call DMS_CreateMarker; + +// Spawn Box +_crate = createVehicle ["Box_NATO_AmmoOrd_F",[(_pos select 0) - 10, _pos select 1,0],[], 0, "CAN_COLLIDE"]; +[_crate] call DMS_Box1; + +sleep 2; +//_crate = [_pos,40,4,2,2] execVM "mission\crates\MM_Box1.sqf"; + +// spawn AI +//[(_pos),(5),(4)] call DMS_SpawnAI; +[(_pos),(5),(4)] call DMS_SpawnAI; + + + +waitUntil{{isPlayer _x && _x distance _pos < 30 } count playableUnits > 0}; + +["standardHintRequest",["Mission has ended, good job!"]] call ExileServer_system_network_send_broadcast; + +// Run Cleanup +[] call DMS_CleanUp; + + + deleteMarker "DMS_MainMarker"; + deleteMarker "DMS_MainDot"; + +sleep 150; + +CALL DMS_selectMission.sqf; + diff --git a/missions/MM8.sqf b/missions/MM8.sqf new file mode 100644 index 0000000..294d048 --- /dev/null +++ b/missions/MM8.sqf @@ -0,0 +1,49 @@ +private ["_crate","_pos","_missname","_aiAmmount","_misText","_missEnd","_group"]; + +/* +_playerClose = false; +_mainTimer = true; +//_missStartTime = floor(time); +*/ + +// associate pos with find safe pos +_pos = call DMS_findSafePos; + + + _missname = "Main Mission 8"; +diag_log format["DMS :: Main Mission 8 started at [%1]",_pos]; + +["standardHintRequest",["Mission starting! Check your map"]] call ExileServer_system_network_send_broadcast; + + +// Spawn Marker +[_pos,_missname] call DMS_CreateMarker; + +// Spawn Box +_crate = createVehicle ["Box_NATO_AmmoOrd_F",[(_pos select 0) - 10, _pos select 1,0],[], 0, "CAN_COLLIDE"]; +[_crate] call DMS_Box1; + +sleep 2; +//_crate = [_pos,40,4,2,2] execVM "mission\crates\MM_Box1.sqf"; + +// spawn AI +//[(_pos),(5),(4)] call DMS_SpawnAI; +[(_pos),(5),(4)] call DMS_SpawnAI; + + + + +waitUntil{{isPlayer _x && _x distance _pos < 30 } count playableUnits > 0}; + +["standardHintRequest",["Mission has ended, good job!"]] call ExileServer_system_network_send_broadcast; + +// Run Cleanup +[] call DMS_CleanUp; + + deleteMarker "DMS_MainMarker"; + deleteMarker "DMS_MainDot"; + +sleep 150; + +CALL DMS_selectMission.sqf; + diff --git a/missions/MM9.sqf b/missions/MM9.sqf new file mode 100644 index 0000000..5c4eb69 --- /dev/null +++ b/missions/MM9.sqf @@ -0,0 +1,47 @@ +private ["_crate","_pos","_missname","_aiAmmount","_misText","_missEnd","_group"]; + +/* +_playerClose = false; +_mainTimer = true; +//_missStartTime = floor(time); +*/ + +// associate pos with find safe pos +_pos = call DMS_findSafePos; + + +_missname = "Main Mission 9"; +diag_log format["DMS :: Main Mission 9 started at [%1]",_pos]; + +["standardHintRequest",["Mission starting! Check your map"]] call ExileServer_system_network_send_broadcast; + +// Spawn Marker +[_pos,_missname] call DMS_CreateMarker; + +// Spawn Box +_crate = createVehicle ["Box_NATO_AmmoOrd_F",[(_pos select 0) - 10, _pos select 1,0],[], 0, "CAN_COLLIDE"]; +[_crate] call DMS_Box1; + +sleep 2; +//_crate = [_pos,40,4,2,2] execVM "mission\crates\MM_Box1.sqf"; + +// spawn AI +//[(_pos),(5),(4)] call DMS_SpawnAI; +[(_pos),(5),(4)] call DMS_SpawnAI; + + + +waitUntil{{isPlayer _x && _x distance _pos < 30 } count playableUnits > 0}; + +["standardHintRequest",["Mission has ended, good job!"]] call ExileServer_system_network_send_broadcast; + +// Run Cleanup +[] call DMS_CleanUp; + + + deleteMarker "DMS_MainMarker"; + deleteMarker "DMS_MainDot"; + +sleep 150; + +CALL DMS_selectMission.sqf; \ No newline at end of file diff --git a/scripts/DMS_Config.sqf b/scripts/DMS_Config.sqf new file mode 100644 index 0000000..7c951ab --- /dev/null +++ b/scripts/DMS_Config.sqf @@ -0,0 +1,16 @@ +DMS_Config = { + if(isServer) then { + diag_log "DMS :: Config starting to load.."; + + //Settings + DMS_UseMissions = true; + //DMS_DetectNearWater = true; + + // Timers in seconds + //DMS_MissionMin = 60; + //DMS_MissionMax = 120; + + // Finalize + DMS_Loaded = true; + }; +}; \ No newline at end of file diff --git a/scripts/DMS_CreateMarker.sqf b/scripts/DMS_CreateMarker.sqf new file mode 100644 index 0000000..6583b41 --- /dev/null +++ b/scripts/DMS_CreateMarker.sqf @@ -0,0 +1,16 @@ +DMS_CreateMarker = { + private["_mark","_name"]; + DMS_Cords = _this select 0; + DMS_MainName = _this select 1; + + _mark = createMarker ["DMS_MainMarker", DMS_Cords]; + "DMS_MainMarker" setMarkerColor "ColorRed"; + "DMS_MainMarker" setMarkerShape "ELLIPSE"; + "DMS_MainMarker" setMarkerBrush "Grid"; + "DMS_MainMarker" setMarkerSize [150,150]; + + _name = createMarker ["DMS_MainDot", DMS_Cords]; + "DMS_MainDot" setMarkerColor "ColorBlack"; + "DMS_MainDot" setMarkerType "mil_dot"; + "DMS_MainDot" setMarkerText DMS_MainName; +}; \ No newline at end of file diff --git a/scripts/DMS_cleanup.sqf b/scripts/DMS_cleanup.sqf new file mode 100644 index 0000000..292a359 --- /dev/null +++ b/scripts/DMS_cleanup.sqf @@ -0,0 +1,20 @@ +fnc_DMS_cleanUp = { + + _this enableSimulation false; + _this removeAllMPEventHandlers "mpkilled"; + _this removeAllMPEventHandlers "mphit"; + _this removeAllMPEventHandlers "mprespawn"; + _this removeAllEventHandlers "FiredNear"; + _this removeAllEventHandlers "HandleDamage"; + _this removeAllEventHandlers "Killed"; + _this removeAllEventHandlers "Fired"; + _this removeAllEventHandlers "GetOut"; + _this removeAllEventHandlers "GetIn"; + _this removeAllEventHandlers "Local"; + // clearVehicleInit _this; + deleteVehicle _this; + deleteGroup (group _this); + _this = nil; + + diag_log format ["DMS :: Markers, vehicles, AI and loot boxes and other items have been cleaned up!"]; +}; diff --git a/scripts/DMS_findSafePos.sqf b/scripts/DMS_findSafePos.sqf new file mode 100644 index 0000000..53cb250 --- /dev/null +++ b/scripts/DMS_findSafePos.sqf @@ -0,0 +1,33 @@ +DMS_findSafePos = { + if(isServer) then { + private ["_pos","_centerPos","_fetchPos"]; + + //_centerPos = [getMarkerPos "center",4000,20000,10,0,25,0]; + _centerPos = [getMarkerPos "center",2000,4000,10,0,25,0]; + + _fetchPos = false; + + _int = 1; + + + while {!_fetchPos} do { + + sleep 2; + + _pos = _centerPos call BIS_fnc_findSafePos; + _int = _int + 1; + _fetchPos = true; + + if (_fetchPos) then { + diag_log format ["DMS :: Found valid position at: (%1) in (%2) tries!",_pos,_int]; + }; + + // more if exceptions to come + + // water if exception to be added above + + }; + }; +}; + + diff --git a/scripts/DMS_selectMission.sqf b/scripts/DMS_selectMission.sqf new file mode 100644 index 0000000..8110137 --- /dev/null +++ b/scripts/DMS_selectMission.sqf @@ -0,0 +1,25 @@ + + private ["_sleepTime","_run","_countArray","_randomMiss","_missVar","_minTime","_maxTime","_missionFnc","_MainArray"]; + // First we add the array of missions + _MainArray = ["MM1","MM2","MM3","MM4","MM5","MM6","MM7","MM8","MM9","MM10"]; + //DMS_SideArray = ["SM1","SM2"]; + /* + _minTime = 1*600; //1 sec + _maxTime = 2*600; //4 sec + */ + _minTime = 1*5; //1 sec + _maxTime = 2*10; //4 sec + + + _sleepTime = (random (_maxTime - _minTime)) + _minTime; + sleep _sleepTime; + + _countArray = count _MainArray; + _slct = floor (random _countArray); + _missVar = _MainArray select _slct; + + // Help from secret skype group. + call compile preprocessfilelinenumbers format["\x\addons\DMS\missions\%1.sqf",_missVar]; + + //DMS_MissionRunning = 1; + diff --git a/scripts/DMS_spawnAI.sqf b/scripts/DMS_spawnAI.sqf new file mode 100644 index 0000000..b689fcb --- /dev/null +++ b/scripts/DMS_spawnAI.sqf @@ -0,0 +1,107 @@ +DMS_spawnAI = { + private ["_group", "_pos","_soldier","_skill","_units","_playerObject"]; + _pos = _this select 0; + _units = _this select 1; + _skill = _this select 2; + //_playerObject = (owner player); + // Needed 4 exile + _group = createGroup INDEPENDENT; + _group setBehaviour "COMBAT"; + _group setCombatMode "RED"; + _group allowFleeing 0; + + // Set AI owner to Player. + _group setGroupOwner (owner player); + // Not tested this one, may need to apply above one. + //ExileServerOwnershipSwapQueue pushBack [_group,_playerObject]; + + + for "_i" from 1 to _units do { + _soldier = _group createUnit ["i_g_soldier_unarmed_f", [_pos select 0, _pos select 1, 0], [], 1, "Form"]; + removeAllAssignedItems _soldier; + removeUniform _soldier; + removeHeadgear _soldier; + removeAllItems _soldier; + removeAllWeapons _soldier; + _soldier forceaddUniform "U_I_officerUniform"; + _soldier addVest "V_5_Epoch"; + _soldier addGoggles "G_Diving"; + for "_i" from 1 to 3 do { + _soldier addItemToVest "30Rnd_65x39_caseless_mag"; + }; + _soldier addWeapon "arifle_MXC_Holo_pointer_F"; + _soldier setRank "Private"; + { + _soldier enableAI _x; + }forEach ["TARGET","AUTOTARGET","MOVE","ANIM"]; + _soldier disableAI "FSM"; + _soldier allowDammage true; + switch (_skill) do + { + case 1: + { + _soldier setSkill ["aimingspeed", 0.05]; + _soldier setSkill ["spotdistance", 0.05]; + _soldier setSkill ["aimingaccuracy", 0.02]; + _soldier setSkill ["aimingshake", 0.02]; + _soldier setSkill ["spottime", 0.1]; + _soldier setSkill ["spotdistance", 0.3]; + _soldier setSkill ["commanding", 0.3]; + _soldier setSkill ["general", 0.2]; + }; + case 2: + { + _soldier setSkill ["spotdistance", 0.1]; + _soldier setSkill ["aimingaccuracy", 0.05]; + _soldier setSkill ["aimingshake", 0.05]; + _soldier setSkill ["spottime", 0.2]; + _soldier setSkill ["spotdistance", 0.4]; + _soldier setSkill ["commanding", 0.4]; + _soldier setSkill ["general", 0.3]; + }; + case 3: + { + _soldier setSkill ["aimingspeed", 0.15]; + _soldier setSkill ["spotdistance", 0.15]; + _soldier setSkill ["aimingaccuracy", 0.1]; + _soldier setSkill ["aimingshake", 0.1]; + _soldier setSkill ["spottime", 0.3]; + _soldier setSkill ["spotdistance", 0.5]; + _soldier setSkill ["commanding", 0.5]; + _soldier setSkill ["general", 0.6]; + }; + case 4: + { + _soldier setSkill ["aimingspeed", 0.3]; + _soldier setSkill ["spotdistance", 0.3]; + _soldier setSkill ["aimingaccuracy", 0.3]; + _soldier setSkill ["aimingshake", 0.3]; + _soldier setSkill ["spottime", 0.4]; + _soldier setSkill ["spotdistance", 0.6]; + _soldier setSkill ["commanding", 0.6]; + _soldier setSkill ["general", 0.7]; + }; + case 5: + { + + _soldier setSkill ["aimingspeed", 0.9]; + _soldier setSkill ["spotdistance", 0.9]; + _soldier setSkill ["aimingaccuracy", 0.9]; + _soldier setSkill ["aimingshake", 0.9]; + _soldier setSkill ["spottime", 0.9]; + _soldier setSkill ["spotdistance", 0.9]; + _soldier setSkill ["commanding", 0.8]; + }; + case 6: // Stupidly fucking OP. + { + _soldier setSkill ["aimingspeed", 1]; + _soldier setSkill ["spotdistance", 1]; + _soldier setSkill ["aimingaccuracy", 1]; + _soldier setSkill ["aimingshake", 1]; + _soldier setSkill ["spottime", 1]; + _soldier setSkill ["spotdistance", 1]; + _soldier setSkill ["commanding", 1]; + }; + }; + }; +};