diff --git a/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_findWorld.sqf b/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_findWorld.sqf index 791ea27..6fe8332 100644 --- a/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_findWorld.sqf +++ b/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_findWorld.sqf @@ -17,7 +17,7 @@ if (_modType isEqualTo "Epoch") then { switch (_blck_WorldName) do {// These may need some adjustment - including a test for shore or water should help as well to avoid missions spawning on water. case "altis":{ - diag_log "Altis-specific settings for Epoch loaded"; + diag_log "[blckeagls] Altis-specific settings for Epoch loaded"; blck_mapCenter = [6322,7801,0]; blck_mapRange = 21000; if (blck_blacklistSpawns) then { @@ -31,7 +31,7 @@ if (_modType isEqualTo "Epoch") then }; }; // Add Central, East and West respawns/traders case "stratis":{ - diag_log "Stratis-specific settings loaded"; + diag_log "[blckeagls] Stratis-specific settings loaded"; blck_mapCenter = [6322,7801,0]; blck_mapRange = 4500; if (blck_blacklistSpawns) then { @@ -40,7 +40,7 @@ if (_modType isEqualTo "Epoch") then }; }; // Add Central, East and West respawns/traders case "chernarus":{ - diag_log "Chernarus-specific settings loaded"; + diag_log "[blckeagls] Chernarus-specific settings loaded"; blck_mapCenter = [7100, 7750, 0]; //centerPosition = {7100, 7750, 300}; blck_mapRange = 5300; if (blck_blacklistSpawns) then { @@ -55,7 +55,7 @@ if (_modType isEqualTo "Epoch") then blck_mapRange = 14400; if (blck_blacklistSpawns) then { blck_locationBlackList = blck_locationBlackList + [[[10058.346680,9015.847656,117.542267],800],[[13812.688477, 6877.921387,80.874428],800],[[13812.661133, 6877.968262,80.876938],800]]; - diag_log "Spawn black list locations added for Bornholm"; + diag_log "[blckeagls] Spawn black list locations added for Bornholm"; }; }; case "esseker":{ @@ -64,7 +64,7 @@ if (_modType isEqualTo "Epoch") then blck_mapRange = 5300; if (blck_blacklistSpawns) then { blck_locationBlackList = blck_locationBlackList + [ [[5073.31, 8903.09, 0],800],[[4407.77, 6054.78, 0],800],[[8692.93, 3854.72, 0],800]]; // { } - diag_log "Spawn black list locations added for Esseker"; + diag_log "[blckeagls] Spawn black list locations added for Esseker"; }; }; case "taviana":{blck_mapCenter = [10370, 11510, 0];blck_mapRange = 14400;}; @@ -74,7 +74,7 @@ if (_modType isEqualTo "Epoch") then blck_mapCenter = [20480,20480, 150];blck_mapRange = 40960; if (blck_blacklistSpawns) then { blck_locationBlackList = blck_locationBlackList + [ [[24398.3, 13971.6,0],800],[[34751.5, 13431.9,0],800],[[19032.7, 33974.6, 0],800],[[4056.35, 19435.9, 0],800] ]; - diag_log "Spawn black list locations added for Australia"; + diag_log "[blckeagls] Spawn black list locations added for Australia"; }; }; case "panthera2":{blck_mapCenter = [4400, 4400, 0];blck_mapRange = 4400;}; @@ -99,7 +99,7 @@ if (_modType isEqualTo "Exile") then blck_mapCenter = [6322,7801,0]; blck_mapRange = 21000; if (blck_blacklistSpawns) then { - diag_log "Spawn black list locations added for Altis"; + diag_log "[blckeagls] Spawn black list locations added for Altis"; blck_locationBlackList = blck_locationBlackList + [ [[14939,15083,0],1000], // trader [[23600, 18000,0],1000], // trader diff --git a/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf b/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf index 0093b41..ffb85f5 100644 --- a/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf +++ b/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf @@ -26,8 +26,8 @@ while {true} do }; }forEach blck_oldMissionObjects; [] call GMS_fnc_cleanupDeadAI; - //[] call blck_fnc_timeAcceleration; - //if (blck_useHC) then {[] call blck_fnc_monitorHC;}; + [] call blck_fnc_timeAcceleration; + if (blck_useHC) then {[] call blck_fnc_monitorHC;}; /* { if (_x select 6 > 0) then // The mission is not running, check the time left till it is spawned diff --git a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processAIKill.sqf b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processAIKill.sqf index 6dea167..aa31f2d 100644 --- a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processAIKill.sqf +++ b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processAIKill.sqf @@ -31,12 +31,7 @@ if ((diag_tickTime - _lastkill) < 240) then }; if (_isLegal) then {[_unit,_killer,_kills] call blck_fnc_rewardKiller;}; _weapon = currentWeapon _killer; -if (_kills > 1) then -{ - _killstreakMsg = format[" %1X KILLSTREAK",_kills]; -}else{ - _killstreakMsg = ""; -}; +_killstreakMsg = format[" %1X KILLSTREAK",_kills]; if (blck_useKilledAIName) then { _message = format["[blck] %2: killed by %1 from %3m",name _killer,name _unit,round(_unit distance _killer)]; diff --git a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_spawnUnit.sqf b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_spawnUnit.sqf index 61628ae..007ebf3 100644 --- a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_spawnUnit.sqf +++ b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_spawnUnit.sqf @@ -1,9 +1,11 @@ /* - Code by blckeagls + Original Code by blckeagls Modified by Ghostrider - Logic for adding AI Ammo, GL Shells and Attachments addapted from that by Vampire. + Logic for adding AI Ammo, GL Shells and Attachments addapted from that by Buttface (A3XAI). + Infinite Ammo fix by Narines. Code to delete dead AI bodies moved to AIKilled.sqf Everything having to do with spawning and configuring an AI should happen here + Last Modified 11/12/16 */ //Defines private variables so they don't interfere with other scripts @@ -90,8 +92,11 @@ _weap = selectRandom _weaponList; _ai1 addWeaponGlobal _weap; _ammoChoices = getArray (configFile >> "CfgWeapons" >> _weap >> "magazines"); -//_muzzles = = getArray (configFile >> "CfgWeapons" >> _weap >> "muzzles"); +//_muzzles = getArray (configFile >> "CfgWeapons" >> _weap >> "muzzles"); _optics = getArray (configfile >> "CfgWeapons" >> _weap >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems"); +_pointers = getArray (configFile >> "CfgWeapons" >> _weap >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems"); +_muzzles = getArray (configFile >> "CfgWeapons" >> _weap >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "compatibleItems"); +_underbarrel = getArray (configFile >> "CfgWeapons" >> _weap >> "WeaponSlotsInfo" >> "UnderBarrelSlot" >> "compatibleItems"); _legalOptics = []; { if !(_x in blck_blacklistedOptics) then {_legalOptics pushback _x}; @@ -102,16 +107,14 @@ for "_i" from 2 to (floor(random 3)) do { _ai1 addMagazine _ammo; }; //if (random 1 < 0.3) then {_unit addPrimaryWeaponItem (selectRandom _muzzles)}; -if (random 1 < 0.3) then { - _ai1 addPrimaryWeaponItem (selectRandom _legalOptics); -}; -if (random 1 < 0.3) then { - _ai1 addPrimaryWeaponItem (selectRandom blck_bipods); -}; -// If the weapon has a GL, add some rounds for it: based on Vampires code +_ai1 addPrimaryWeaponItem (selectRandom _legalOptics); +_ai1 addPrimaryWeaponItem (selectRandom _pointers); +_ai1 addPrimaryWeaponItem (selectRandom _muzzles); +_ai1 addPrimaryWeaponItem (selectRandom _underbarrel); if ((count(getArray (configFile >> "cfgWeapons" >> _weap >> "muzzles"))) > 1) then { _ai1 addMagazine "1Rnd_HE_Grenade_shell"; }; + _weap = selectRandom blck_Pistols; //diag_log format["[spawnUnit.sqf] _weap os %1",_weap]; _ai1 addWeaponGlobal _weap; diff --git a/@epochhive/addons/custom_server/Compiles/blck_functions.sqf b/@epochhive/addons/custom_server/Compiles/blck_functions.sqf index 429e8eb..3eaca0e 100644 --- a/@epochhive/addons/custom_server/Compiles/blck_functions.sqf +++ b/@epochhive/addons/custom_server/Compiles/blck_functions.sqf @@ -2,7 +2,7 @@ AI Mission for Epoch Mod for Arma 3 By Ghostrider Functions and global variables used by the mission system. - Last modified 11/10/16 + Last modified 11/12/16 */ blck_functionsCompiled = false; @@ -14,11 +14,10 @@ blck_fnc_findPositionsAlongARadius = compileFinal preprocessFileLineNumbers "\ blck_fnc_giveTakeCrypto = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_giveTakeCrypto.sqf"; blck_fnc_monitorHC = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_monitorHC.sqf"; blck_fnc_timeAcceleration = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\TimeAccel\GMS_fnc_Time.sqf"; - +blck_getModType = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_getModType.sqf"; // Test if Epoch or Exile is loaded // Player-related functions blck_fnc_rewardKiller = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_rewardKiller.sqf"; blck_fnc_MessagePlayers = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_AIM.sqf"; // Send messages to players regarding Missions -blck_getModType = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_getModType.sqf"; // Send messages to players regarding Missions // Mission-related functions blck_fnc_missionTimer = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_missionTimer.sqf"; diff --git a/@epochhive/addons/custom_server/MapAddons/MapAddons_init.sqf b/@epochhive/addons/custom_server/MapAddons/MapAddons_init.sqf new file mode 100644 index 0000000..4307d9b --- /dev/null +++ b/@epochhive/addons/custom_server/MapAddons/MapAddons_init.sqf @@ -0,0 +1,64 @@ +/* + Run scripts exported from M3EDEN Editor plug in for Arma 3 or other map addons. + Add addons to the arrays for Epoch or Exile as appropriate. + Arrays should contain ["mapname", "name of folder within mapaddons","name of file to execute"] + by Ghostrider-DbD- + for DBD Clan + 11/12/16 +*/ +if (!isServer) exitWith{}; +_addonsPath = "\q\addons\custom_server\MapAddons\mapcontent\"; +_addonsEpoch = [ + //["mapName","subfolder","filename.sqf"] + // when "subfolder" equals "" then the spawner will look for the file in the mapcontent directory + // See the examples below for an idea as to how to set these arrays up. + /* + ["Altis","Altis","trader_ATMs.sqf"], + ["Altis","Altis","DBD_EPOCH_Altis_Dump_SH.FINAL.sqf"], + ["Altis","Altis","altis_epoch_beach_SH-DBD_final.sqf"], + ["Tanoa","Tanoa","tanoaatmmil.sqf"] + */ +]; + +_addonsExile = [ + /* + ["Altis","Altis","altis_epoch_beach_SH-DBD_final.sqf"], + ["Altis","Altis","DBD_EPOCH_Altis_Dump_SH.FINAL.sqf"], + ["Altis","Altis","packStronghold-1.sqf"], + ["Altis","Altis","packStrongholdMolos.sqf"], + ["Namalsk","Namalsk","namalsklockers.sqf"] + */ +]; + + +_fnc_runIt = +{ + params["_addons"]; + if (blck_debugON) then {diag_log format["[blckeagls] MapAddons:: addons list is %1",_addons];}; + _worldName = toLower (worldName); + { + if (toLower format["%1",_x select 0] isEqualTo _worldName) then + { + _path = ""; + if ( (_x select 1) isEqualTo "") then + { + _path = _addonsPath; + } else { + _path = format["%1%2%3",_addonsPath,_x select 1,"\"]; + }; + if (blck_debugON) then {diag_log format["[blckeagls] MapAddons::-->> Running the following script: %1%2",_path,_x select 2];}; + [] execVM format["%1%2",_path,_x select 2]; + }; + }forEach _addons; +}; +_modType = call blck_getModType; +if (_modType isEqualTo "Epoch") then +{ + diag_log "[blckeagls] Running Map Addons for Epoch"; + [_addonsEpoch] call _fnc_runIt; +}; +if (_modType isEqualTo "Exile") then +{ + diag_log "[blckeagls] Running Map Addons for Epoch"; + [_addonsExile] call _fnc_runIt; +}; \ No newline at end of file diff --git a/@epochhive/addons/custom_server/changeLog.sqf b/@epochhive/addons/custom_server/changeLog.sqf index 395c5dd..ad32a90 100644 --- a/@epochhive/addons/custom_server/changeLog.sqf +++ b/@epochhive/addons/custom_server/changeLog.sqf @@ -4,6 +4,10 @@ Loosely based on the AI mission system by blckeagls ver 2.0.2 Contributions by Narines: bug fixes, testing, 'fired' event handler Ideas or code from that by Vampire and KiloSwiss have been used for certain functions. +11/12/16 Version 6.43 Build 11 +Enhancements to code to equip weapons; pointrs, silencers and bipods are now attached. +Added a little function to spawn static map addons such as AI strongholds, bridges, traders and such. + 11/11/16 Version 6.42 build 10 Redid the code that spawns the objects at missions to work properly with the new formats generated by M3Arma EDEN Editor whilc being backwards compatible with older formats used in the existing missions. Added code to add scopes and other attachments to AI weapons. diff --git a/@epochhive/addons/custom_server/init/blck_init.sqf b/@epochhive/addons/custom_server/init/blck_init.sqf index c9591bb..5dfb608 100644 --- a/@epochhive/addons/custom_server/init/blck_init.sqf +++ b/@epochhive/addons/custom_server/init/blck_init.sqf @@ -1,32 +1,34 @@ /* AI Mission for Epoch and Exile Mods to Arma 3 -by Ghostrider-DbD- -Credits to Vampire, Narines, KiloSwiss, blckeagls, theFUCHS, lazylink, Mark311 who wrote mission systems upon which this one is based and who's code is used with modification in some parts of this addon. -Thanks to cyncrwler for testing and bug fixes. +Credist to blckeagls who wrote the initial mission script for A3 Epoch +To Narines for debugging that original version +To cynwncler for many helpful comments along the way +And mostly importantly, +To Vampire, KiloSwiss, blckeagls, theFUCHS, lazylink, Mark311 and Buttface (Face) who wrote the pionering mission and roaming AI systems upon which this one is based and who's code is used with modification in some parts of this addon. */ -private ["_version","_versionDate"]; -_blck_version = "6.42 Build 10"; -_blck_versionDate = "11-11-16 11:00 AM"; - private["_blck_loadingStartTime"]; _blck_loadingStartTime = diag_tickTime; +#include "\q\addons\custom_server\init\build.sqf"; +diag_log format["[blckeagls] Loading version %1 Build %2",_blck_versionDate,_blck_version]; call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\blck_variables.sqf"; waitUntil {(isNil "blck_variablesLoaded") isEqualTo false;}; waitUntil{blck_variablesLoaded}; blck_variablesLoaded = nil; -//sleep 1; +if !(blck_debugON) then {uiSleep 60;}; // compile functions call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\blck_functions.sqf"; waitUntil {(isNil "blck_functionsCompiled") isEqualTo false;}; waitUntil{blck_functionsCompiled}; blck_functionsCompiled = nil; +diag_log format["[blckeagls] debug mode settings:blck_debugON = %1",blck_debugON]; + private["_modType"]; _modType = [] call blck_getModType; -diag_log format["[blckeagls] Loading version %1 Build %2 for mod = %3",_blck_versionDate,_blck_version,_modType]; -// this will be a feature of an upcoming release -//call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\MapAddons\MapAddons_init.sqf"; + +// spawn map addons to give the server time to position them before spawning in crates etc. +call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\MapAddons\MapAddons_init.sqf"; if (_modType isEqualTo "Epoch") then { @@ -54,14 +56,15 @@ blck_worldSet = nil; // set up the lists of available missions for each mission category diag_log "[blckeagls] Loading Mission Lists"; #include "\q\addons\custom_server\Missions\GMS_missionLists.sqf"; -diag_log format["[blckeagls] Loaded in %1 seconds",diag_tickTime - _blck_loadingStartTime]; + +// Load any user-defined specifications or overrides +call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Configs\blck_custom_config.sqf"; + +diag_log format["[blckeagls] version %1 Build %2 for mod = %3 Loaded in %4 seconds",_blck_versionDate,_blck_version,_modType,diag_tickTime - _blck_loadingStartTime]; //,blck_modType]; diag_log format["blckeagls] waiting for players to join ---- >>>>"]; waitUntil{{isPlayer _x}count playableUnits > 0}; diag_log "[blckeagls] Player Connected, loading mission system"; -// Load any user-defined specifications or overrides -_scriptDone = execVM "\q\addons\custom_server\Configs\blck_custom_config.sqf"; -waitUntil{scriptDone _scriptDone}; //Start the mission timers if (blck_enableOrangeMissions == 1) then @@ -80,7 +83,12 @@ if (blck_enableBlueMissions == 1) then { [_missionListBlue,_pathBlue,"BlueMarker","blue",blck_TMin_Blue,blck_TMax_Blue] spawn blck_fnc_missionTimer;//Starts minor mission system (Blue Map Markers) }; +// start the main thread for the mission system which monitors missions running and stuff to be cleaned up +[] execVM "\q\addons\custom_server\Compiles\Functions\GMS_fnc_mainThread.sqf"; [] execVM "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_vehicleMonitorLoop.sqf"; + +// start a little loop that sends clients the current serverFPS +[] execVM "\q\addons\custom_server\Compiles\Functions\broadcastServerFPS.sqf"; diag_log "[blckeagls] >>--- Completed initialization"; blck_Initialized = true; diff --git a/@epochhive/addons/custom_server/init/build.sqf b/@epochhive/addons/custom_server/init/build.sqf new file mode 100644 index 0000000..deca708 --- /dev/null +++ b/@epochhive/addons/custom_server/init/build.sqf @@ -0,0 +1,3 @@ +private ["_version","_versionDate"]; +_blck_version = "6.43 Build 11"; +_blck_versionDate = "11-12-16 11:00 AM"; \ No newline at end of file