Advertisement
Guest User

Untitled

a guest
Jun 11th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 5.03 KB | None | 0 0
  1. /*
  2.     DZAI Server Initialization File
  3.    
  4.     Description: Handles startup process for DZAI. Does not contain any values intended for modification.
  5. */
  6. private ["_startTime","_directoryAsArray"];
  7.  
  8. if (!isServer || !isNil "DZAI_isActive") exitWith {};
  9. DZAI_isActive = true;
  10.  
  11. _startTime = diag_tickTime;
  12.  
  13. _directoryAsArray = toArray __FILE__;
  14. _directoryAsArray resize ((count _directoryAsArray) - 25);
  15. DZAI_directory = toString _directoryAsArray;
  16. if (isNil "_this") then {_this = []};
  17. if ((count _this) > 0) then {
  18.     //diag_log "DEBUG :: Startup parameters found!";
  19.     if ("readoverridefile" in _this) then {DZAI_overrideEnabled = true} else {DZAI_overrideEnabled = nil};
  20.     if ("enabledebugmarkers" in _this) then {DZAI_debugMarkersEnabled = true} else {DZAI_debugMarkersEnabled = nil};
  21. } else {
  22.     //diag_log "DEBUG :: Startup parameters not found!";
  23.     DZAI_overrideEnabled = nil;
  24.     DZAI_debugMarkersEnabled = nil;
  25. };
  26.  
  27. //Report DZAI version to RPT log
  28. #include "DZAI_version.hpp"
  29. diag_log format ["[DZAI] Initializing %1 version %2 using base path %3.",DZAI_TYPE,DZAI_VERSION,DZAI_directory];
  30.  
  31. //Load DZAI main configuration file
  32. call compile preprocessFileLineNumbers format ["%1\init\dzai_config.sqf",DZAI_directory];
  33.  
  34. //Load DZAI functions
  35. call compile preprocessFileLineNumbers format ["%1\init\dzai_functions.sqf",DZAI_directory];
  36.  
  37. //Set side relations
  38. createCenter east;
  39. east setFriend [west, 0];        
  40. west setFriend [east, 0];
  41.  
  42. //Detect DayZ mod variant and version being used.
  43. if (isNil "DZAI_modName") then {DZAI_modName = ""};
  44. if (isNil "DZAI_modVersion") then {DZAI_modVersion = toLower (getText (configFile >> "CfgMods" >> "DayZ" >> "version"))};
  45. if (DZAI_modName == "") then {
  46.     private["_modVariant"];
  47.     _modVariant = toLower (getText (configFile >> "CfgMods" >> "DayZ" >> "dir"));
  48.     if (DZAI_debugLevel > 0) then {diag_log format ["DZAI Debug: Detected mod variant %1.",_modVariant];};
  49.     DZAI_modName = call {
  50.         if (_modVariant == "@dayz_epoch") exitWith {"epoch"};
  51.         if (_modVariant in ["dayzoverwatch","@dayzoverwatch"]) exitWith {"overwatch"};
  52.         if (_modVariant == "@dayzhuntinggrounds") exitWith {"huntinggrounds"};
  53.         if (_modVariant == "@dayzunleashed") exitWith {"unleashed"};
  54.         if ((_modVariant == "dayzlingor") && {(toLower (getText (configFile >> "CfgMods" >> "DayZ" >> "action"))) == "http://www.skaronator.com"}) exitWith {"lingorskaro"};
  55.         ""
  56.     };
  57. };
  58.  
  59. //Create reference marker to act as boundary for spawning AI air/land vehicles. These values will be later modified on a per-map basis.
  60. if (isNil "DZAI_maxHeliPatrols") then {DZAI_maxHeliPatrols = 0};
  61. if (isNil "DZAI_maxLandPatrols") then {DZAI_maxLandPatrols = 0};
  62. if ((DZAI_maxHeliPatrols > 0) or {(DZAI_maxLandPatrols > 0)}) then {
  63.     DZAI_centerMarker = createMarker ["DZAI_centerMarker", (getMarkerPos 'center')];
  64.     DZAI_centerMarker setMarkerShape "ELLIPSE";
  65.     DZAI_centerMarker setMarkerType "Empty";
  66.     DZAI_centerMarker setMarkerBrush "Solid";
  67.     DZAI_centerMarker setMarkerSize [7000, 7000];
  68.     DZAI_centerMarker setMarkerAlpha 0;
  69. };
  70.  
  71. private["_worldname"];
  72. _worldname=toLower format ["%1",worldName];
  73.  
  74. //Load map-specific configuration file. Config files contain trigger/marker information, addition and removal of items/skins, and/or other variable customizations.
  75. //Classname files will overwrite basic settings specified in base_classnames.sqf
  76. if (_worldname in [
  77.     "chernarus","utes","zargabad","fallujah","takistan","tavi","lingor","namalsk","mbg_celle2","oring","panthera2","isladuala","sara","smd_sahrani_a2","trinity","napf","caribou","cmr_ovaron","sauerland","fdf_isle1_a","caribou"]) then {
  78.     call compile preprocessFileLineNumbers format ["%1\init\world_classname_configs\%2_classnames.sqf",DZAI_directory,_worldname];
  79.     [] execVM format ["%1\init\world_spawn_configs\world_%2.sqf",DZAI_directory,_worldname];
  80. } else {
  81.     "DZAI_centerMarker" setMarkerSize [7000, 7000];
  82.     if (DZAI_modName == "epoch") then {
  83.         call compile preprocessFileLineNumbers format ["%1\init\world_classname_configs\epoch\dayz_epoch.sqf",DZAI_directory];
  84.     };
  85.     if (DZAI_staticAI) then {[] execVM format ["%1\scripts\setup_autoStaticSpawns.sqf",DZAI_directory];};
  86. };
  87.  
  88. //Continue loading required DZAI script files
  89. [] execVM format ['%1\scripts\DZAI_startup.sqf',DZAI_directory];
  90.  
  91. //Report DZAI startup settings to RPT log
  92. diag_log format ["[DZAI] DZAI settings: Debug Level: %1. DebugMarkers: %2. WorldName: %3. ModName: %4 (Ver: %5). DZAI_dynamicWeaponList: %6. VerifyTables: %7.",DZAI_debugLevel,((!isNil "DZAI_debugMarkersEnabled") && {DZAI_debugMarkersEnabled}),_worldname,DZAI_modName,DZAI_modVersion,DZAI_dynamicWeaponList,DZAI_verifyTables];
  93. diag_log format ["[DZAI] AI spawn settings: Static: %1. Dynamic: %2. Air: %3. Land: %4.",DZAI_staticAI,DZAI_dynAISpawns,(DZAI_maxHeliPatrols>0),(DZAI_maxLandPatrols>0)];
  94. diag_log format ["[DZAI] AI settings: DZAI_findKiller: %1. DZAI_useHealthSystem: %2. DZAI_weaponNoise: %3. DZAI_zombieEnemy: %4.",DZAI_findKiller,DZAI_useHealthSystem,DZAI_weaponNoise,DZAI_zombieEnemy];
  95. diag_log format ["[DZAI] DZAI loading completed in %1 seconds.",(diag_tickTime - _startTime)];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement