May Contain Errors
This commit is contained in:
Defent 2015-08-25 17:55:45 +02:00
parent f27aed6c88
commit eea84a5f8b
19 changed files with 943 additions and 0 deletions

49
README.md Normal file
View File

@ -0,0 +1,49 @@
DMS - File rev 0.48 - Date: 2014 - 12 - 27
===
Defents mission system
Stuff is not always working as it should. This works but you will need to have some knowledge on how to
execute files serverside in Arma 3.
Contains two MAAIN twst missions. No array for side missions at the moment. Will be added later.
Missions should spawn AI. To keep ai staying, unquote the last part. Should keep them active and up for 4 hours.
WHAT DOES THIS NOT HAVE AND WHATS IN DEVELOPMENT:
- Ai spawning only when player is x distance to mission.
- Attach Ai to player instead of server side.
If you believe that the files I use and scripts I have resemble yours, please do tell me at
admin@numenadayz.com and I will correct it. Or PM me on the epoch forums.
We do not want to steal code now do we ;)
HOW TO INSTALL
===
Make custom pbo
Call my file DMS_INIT.sqf
Eeh.. put files in root folder.
What to modify?
===
Change mission timer in selectMission.sqf
_minTime = 1*1; //1 sec
_maxTime = 2*2; //4 sec
Open your init.sqf or add an init.sqf to your Exile.Altis.PBO file. and add:
"GlobalHint" addPublicVariableEventHandler {
hint parseText format["%1", (_this select 1) select 1];
};

24
crates/DMS_CreateBox.sqf Normal file
View File

@ -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];
};

60
missions/MM1.sqf Normal file
View File

@ -0,0 +1,60 @@
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];
_misText = "<t size='1.75' align='center' color='#27612F'>Main Mission 1.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission now starting! Check your map!</t>";
GlobalHint = [0,_misText];
publicVariable "GlobalHint";
// Spawn Marker
[_pos,_missname] execVM "mission\scripts\DMS_CreateMarker.sqf";
// 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;
*/
_missEnd = "<t size='1.75' align='center' color='#27612F'>Main Mission 1.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission has ended, good job!</t>";
GlobalHint = [0,_missEnd];
publicVariable "GlobalHint";
// Run Cleanup
["Ended","Clean"] call DMS_CleanUp;
sleep 150;
[] execVM "mission\scripts\DMS_selectMission.sqf";

65
missions/MM10.sqf Normal file
View File

@ -0,0 +1,65 @@
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];
_misText = "<t size='1.75' align='center' color='#27612F'>Main Mission 10.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission now starting! Check your map!</t>";
GlobalHint = [0,_misText];
publicVariable "GlobalHint";
// Spawn Marker
[_pos,_missname] execVM "mission\scripts\DMS_CreateMarker.sqf";
// 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};
_missEnd = "<t size='1.75' align='center' color='#27612F'>Main Mission 1.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission has ended, good job!</t>";
GlobalHint = [0,_missEnd];
publicVariable "GlobalHint";
// Run Cleanup
["Ended","Clean"] call DMS_CleanUp;
sleep 150;
[] execVM "mission\scripts\DMS_selectMission.sqf";

62
missions/MM2.sqf Normal file
View File

@ -0,0 +1,62 @@
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];
_misText = "<t size='1.75' align='center' color='#27612F'>Main Mission 2.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission now starting! Check your map!</t>";
GlobalHint = [0,_misText];
publicVariable "GlobalHint";
// Spawn Marker
[_pos,_missname] execVM "mission\scripts\DMS_CreateMarker.sqf";
// 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};
_missEnd = "<t size='1.75' align='center' color='#27612F'>Main Mission 1.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission has ended, good job!</t>";
GlobalHint = [0,_missEnd];
publicVariable "GlobalHint";
// Run Cleanup
["Ended","Clean"] call DMS_CleanUp;
sleep 150;
[] execVM "mission\scripts\DMS_selectMission.sqf";

63
missions/MM3.sqf Normal file
View File

@ -0,0 +1,63 @@
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];
_misText = "<t size='1.75' align='center' color='#27612F'>Main Mission 3.<br/>
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission now starting! Check your map!</t>";
GlobalHint = [0,_misText];
publicVariable "GlobalHint";
// Spawn Marker
[_pos,_missname] execVM "mission\scripts\DMS_CreateMarker.sqf";
// 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};
_missEnd = "<t size='1.75' align='center' color='#27612F'>Main Mission 3.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission has ended, good job!</t>";
GlobalHint = [0,_missEnd];
publicVariable "GlobalHint";
// Run Cleanup
["Ended","Clean"] call DMS_CleanUp;
sleep 150;
[] execVM "mission\scripts\DMS_selectMission.sqf";

63
missions/MM4.sqf Normal file
View File

@ -0,0 +1,63 @@
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];
_misText = "<t size='1.75' align='center' shadow='2' color='#27612F'>Main Mission 4.</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission now starting! Check your map!</t>";
GlobalHint = [0,_misText];
publicVariable "GlobalHint";
// Spawn Marker
[_pos,_missname] execVM "mission\scripts\DMS_CreateMarker.sqf";
// 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};
_missEnd = "<t size='1.75' align='center' color='#27612F'>Main Mission 1.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission has ended, good job!</t>";
GlobalHint = [0,_missEnd];
publicVariable "GlobalHint";
// Run Cleanup
["Ended","Clean"] call DMS_CleanUp;
sleep 150;
[] execVM "mission\scripts\DMS_selectMission.sqf";

64
missions/MM5.sqf Normal file
View File

@ -0,0 +1,64 @@
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];
_misText = "<t size='1.75' align='center' color='#27612F'>Main Mission 5.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission now starting! Check your map!</t>";
GlobalHint = [0,_misText];
publicVariable "GlobalHint";
// Spawn Marker
[_pos,_missname] execVM "mission\scripts\DMS_CreateMarker.sqf";
// 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};
_missEnd = "<t size='1.75' align='center' color='#27612F'>Main Mission 1.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission has ended, good job!</t>";
GlobalHint = [0,_missEnd];
publicVariable "GlobalHint";
// Run Cleanup
["Ended","Clean"] call DMS_CleanUp;
sleep 150;
[] execVM "mission\scripts\DMS_selectMission.sqf";

64
missions/MM6.sqf Normal file
View File

@ -0,0 +1,64 @@
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];
_misText = "<t size='1.75' align='center' color='#27612F'>Main Mission 10.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission now starting! Check your map!</t>";
GlobalHint = [0,_misText];
publicVariable "GlobalHint";
// Spawn Marker
[_pos,_missname] execVM "mission\scripts\DMS_CreateMarker.sqf";
// 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};
_missEnd = "<t size='1.75' align='center' color='#27612F'>Main Mission 1.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission has ended, good job!</t>";
GlobalHint = [0,_missEnd];
publicVariable "GlobalHint";
// Run Cleanup
["Ended","Clean"] call DMS_CleanUp;
sleep 150;
[] execVM "mission\scripts\DMS_selectMission.sqf";

64
missions/MM7.sqf Normal file
View File

@ -0,0 +1,64 @@
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];
_misText = "<t size='1.75' align='center' color='#27612F'>Main Mission 7.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission now starting! Check your map!</t>";
GlobalHint = [0,_misText];
publicVariable "GlobalHint";
// Spawn Marker
[_pos,_missname] execVM "mission\scripts\DMS_CreateMarker.sqf";
// 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};
_missEnd = "<t size='1.75' align='center' color='#27612F'>Main Mission 1.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission has ended, good job!</t>";
GlobalHint = [0,_missEnd];
publicVariable "GlobalHint";
// Run Cleanup
["Ended","Clean"] call DMS_CleanUp;
sleep 150;
[] execVM "mission\scripts\DMS_selectMission.sqf";

64
missions/MM8.sqf Normal file
View File

@ -0,0 +1,64 @@
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];
_misText = "<t size='1.75' align='center' color='#27612F'>Main Mission 8.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission now starting! Check your map!</t>";
GlobalHint = [0,_misText];
publicVariable "GlobalHint";
// Spawn Marker
[_pos,_missname] execVM "mission\scripts\DMS_CreateMarker.sqf";
// 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};
_missEnd = "<t size='1.75' align='center' color='#27612F'>Main Mission 1.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission has ended, good job!</t>";
GlobalHint = [0,_missEnd];
publicVariable "GlobalHint";
// Run Cleanup
["Ended","Clean"] call DMS_CleanUp;
sleep 150;
[] execVM "mission\scripts\DMS_selectMission.sqf";

61
missions/MM9.sqf Normal file
View File

@ -0,0 +1,61 @@
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];
_misText = "<t size='1.75' align='center' color='#27612F'>Main Mission 9.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission now starting! Check your map!</t>";
GlobalHint = [0,_misText];
publicVariable "GlobalHint";
// Spawn Marker
[_pos,_missname] execVM "mission\scripts\DMS_CreateMarker.sqf";
// 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};
_missEnd = "<t size='1.75' align='center' color='#27612F'>Main Mission 1.
</t>
<br/>
<t align='center' color='#FF0000'>------------------------------</t>
<br/>
<t size='1.25' color='#FFFFFF'> Mission has ended, good job!</t>";
GlobalHint = [0,_missEnd];
publicVariable "GlobalHint";
// Run Cleanup
["Ended","Clean"] call DMS_CleanUp;
sleep 150;
[] execVM "mission\scripts\DMS_selectMission.sqf";

14
scripts/DMS_Config.sqf Normal file
View File

@ -0,0 +1,14 @@
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;
};

View File

@ -0,0 +1,14 @@
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;

31
scripts/DMS_cleanup.sqf Normal file
View File

@ -0,0 +1,31 @@
fnc_DMS_cleanUp = {
private ["_marker","_boxes","_miscThings"];
_marker = _this select 0;
_objects = _this select 1;
if (_marker == "Ended") then {
deleteMarker "DMS_MainMarker";
deleteMarker "DMS_MainDot";
};
if (_objects = "Clean") then {
_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!"];
};

View File

@ -0,0 +1,32 @@
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
};
};

View File

@ -0,0 +1,23 @@
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;
[] execVM format ["mission\missions\%1.sqf",_missVar];
//DMS_MissionRunning = 1;

98
scripts/DMS_spawnAI.sqf Normal file
View File

@ -0,0 +1,98 @@
DMS_spawnAI = {
private ["_group", "_pos","_soldier","_skill","_units"];
_pos = _this select 0;
_units = _this select 1;
_skill = _this select 2;
_group = createGroup RESISTANCE;
_group setBehaviour "COMBAT";
_group setCombatMode "RED";
_group allowFleeing 0;
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];
};
};
};
};

28
scripts/init.sqf Normal file
View File

@ -0,0 +1,28 @@
// Loads compiles
// Made by Defent for Defents Mission System
// And for Numenadayz.com
if(isServer) then {
// compilation list
DMS_findSafePos = compile preprocessFileLineNumbers "mission\scripts\DMS_findSafePos.sqf";
DMS_createBox = compile preprocessFileLineNumbers "mission\crates\DMS_CreateBox.sqf";
DMS_CreateMarker = compile preprocessFileLineNumbers "mission\scripts\DMS_CreateMarker.sqf";
DMS_spawnAI = compile preprocessFileLineNumbers "mission\scripts\DMS_spawnAI.sqf";
DMS_selectMission = compile preprocessFileLineNumbers "mission\scripts\DMS_selectMission.sqf";
DMS_CleanUp = compile preprocessFileLineNumbers "mission\scripts\DMS_CleanUp.sqf";
// not fully loaded yet
DMS_Loaded = false;
execVM "mission\scripts\DMS_Config.sqf";
waitUntil {DMS_Loaded};
execVM "mission\scripts\DMS_selectMission.sqf";
diag_log "DMS :: Functions loaded - starting the rest of the script.";
};