From 033b6cfe4a8560646b2abcfffea2851b90128b9f Mon Sep 17 00:00:00 2001 From: Ghostrider-DbD- Date: Wed, 7 Jun 2017 22:08:57 -0400 Subject: [PATCH 1/3] Added Simulation Manager. By default this uses the new dynamic sumulation manager. Comment out #define useDynamicSimulation to use a scripted simulaton manager. --- .../Functions/GMS_fnc_addItemToCrate.sqf | 63 +++++++++++++ .../GMS_fnc_loadLootItemsFromArray.sqf | 57 +++++++++++ .../Compiles/Functions/GMS_fnc_mainThread.sqf | 9 +- .../Groups/GMS_fnc_missionGroupMonitor.sqf | 37 ++++++++ .../Groups/GMS_fnc_setupWaypoints.sqf | 5 +- .../Compiles/Groups/GMS_fnc_spawnGroup.sqf | 8 +- .../Compiles/Missions/GMS_fnc_fillBoxes.sqf | 9 -- .../Compiles/Units/GMS_EH_AIHit.sqf | 2 +- .../Compiles/Units/GMS_fnc_processAIKill.sqf | 27 +++--- .../Units/GMS_fnc_processIlleagalAIKills.sqf | 6 +- .../Compiles/Units/GMS_fnc_rewardKiller.sqf | 87 ++++++++++++----- .../Compiles/Units/GMS_fnc_spawnUnit.sqf | 8 +- .../custom_server/Compiles/blck_functions.sqf | 4 +- .../custom_server/Compiles/blck_variables.sqf | 6 +- .../custom_server/Configs/blck_defines.hpp | 12 ++- .../custom_server/GMS_fnc_setupWaypoints.sqf | 94 +++++++++++++++++++ @epochhive/addons/custom_server/changeLog.sqf | 5 + .../addons/custom_server/init/build.sqf | 4 +- changeLog.sqf | 20 ++-- 19 files changed, 375 insertions(+), 88 deletions(-) create mode 100644 @epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_addItemToCrate.sqf create mode 100644 @epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_loadLootItemsFromArray.sqf create mode 100644 @epochhive/addons/custom_server/GMS_fnc_setupWaypoints.sqf diff --git a/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_addItemToCrate.sqf b/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_addItemToCrate.sqf new file mode 100644 index 0000000..dd1bb1d --- /dev/null +++ b/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_addItemToCrate.sqf @@ -0,0 +1,63 @@ +/* + [_item,_crate] call blck_addItemToCrate; + where + _crate is a container such as ammo box or vehicle + _item is a string or array. + If _item is a string then add 1 of that item to the container. + If _item is an array with 2 elements ["itemName",3] then assume that the first element is a string and is the name of the item, and the second is the number to add. + if _item is an array with 3 elements ["itemName",2,6] assume that the first element is the item name (string), the second the min # to add and the third the max # to add. + by Ghostrider-DbD- + 11/14/16 + + -------------------------- + License + -------------------------- + All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License. + + http://creativecommons.org/licenses/by-nc-sa/4.0/ +*/ +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; + + + params["_itemInfo","_crate",["_addAmmo",0]]; + private["_isRifle","_isMagazine","_isBackpack"]; + _isWeapon = false; + _isMagazine = false; + _isBackpack = false; + _quant = 0; + #ifdef blck_debugMode + diag_log format["blck_addItemToCrate:: -- >> itemInfo = %1 | _crate %2 | _addAmmo %3",_itemInfo, _crate, _addAmmo]; + #endif + if (typeName _itemInfo isEqualTo "STRING") then {_item = _itemInfo; _quant = 1}; // case where only the item descriptor was provided + if (typeName _itemInfo isEqualTo "ARRAY") then { + + if (count _itemInfo isEqualTo 2) then {_item = _itemInfo select 0; _quant = _itemInfo select 1;}; // case where item descriptor and quantity were provided + if (count _itemInfo isEqualto 3) then { + _item = _itemInfo select 0; + _quant = (_itemInfo select 1) + round(random((_itemInfo select 2) - (_itemInfo select 1))); + }; // case where item descriptor, min number and max number were provided. + }; + if (((typeName _item) isEqualTo "STRING") && (_item != "")) then + { + if (isClass(configFile >> "CfgWeapons" >> _item)) then { + _crate addWeaponCargoGlobal [_item,_quant]; + _isWeapon = true; + _count = 0; + if (typeName _addAmmo isEqualTo "SCALAR") then + { + _count = _addAmmo; + }; + if (typeName _addAmmo isEqualto "ARRAY") then + { + _count = (_addAmmo select 0) + (round(random((_addAmmo select 1) - (_addAmmo select 0)))); + }; + _ammo = getArray (configFile >> "CfgWeapons" >> _item >> "magazines"); + for "_i" from 1 to _count do + { + _crate addMagazineCargoGlobal [selectRandom _ammo,1]; + }; + }; + if (_item isKindOf ["Bag_Base", configFile >> "CfgVehicles"]) then {_crate addBackpackCargoGlobal [_item,_quant]; _isBackpack = true;}; + if (isClass(configFile >> "CfgMagazines" >> _item)) then {_crate addMagazineCargoGlobal [_item,_quant]; _isMagazine = true;}; + if (!_isWeapon && !_isMagazine && _isBackpack && isClass(configFile >> "CfgVehicles" >> _item)) then {_crate addItemCargoGlobal [_item,_quant]}; + }; diff --git a/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_loadLootItemsFromArray.sqf b/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_loadLootItemsFromArray.sqf new file mode 100644 index 0000000..1e8a2d2 --- /dev/null +++ b/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_loadLootItemsFromArray.sqf @@ -0,0 +1,57 @@ +/* + Depends on blck_fnc_addItemToCrate + + call as: + + [_item,_crate] call blck_fnc_loadLootFromItemsArray; + + where + _crate is a container such as ammo box or vehicle + _loadout is an array containing either 2 or 3 elements. The first array is always an array of items to add. Items can be formated as ["item1","item1"], as [["item1",3],["item2",2]] or as [["item1",2,4],["item2",3,5]]. + See GMS_fnc_addItemToCrate for information about the acceptable formates for the items "item1" ... "itemN". + + The second and optional third element in the array specify the number of times the script will randomly select an item from the array of items and load it into the crate. + For example: + case 1: [["item1",...,"itemN"],6]; The script will randomly select from the array of item names 6 times and call the loot loader each time. + case 2: [["item1",...,"itemN"],6, 9]; As above except that an item will be selected a minimum of 6 and maximum of 9 times. + + by Ghostrider-DbD- + 6/7/17 + + -------------------------- + License + -------------------------- + All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License. + + http://creativecommons.org/licenses/by-nc-sa/4.0/ +*/ +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; + + + params["_loadout","_crate",["_addAmmo",0]]; + #ifdef blck_debugMode + diag_log format["blck_fnc_loadLootFromItemsArray:: _this %1",_this]; + diag_log format["blck_fnc_loadLootFromItemsArray:: _crate %1 | _addAmmo %2 | _loadout %3",_crate,_addAmmo,_loadout]; + #endif + if ((_loadout select 0) isEqualTo []) exitWith {}; + { + private["_tries","_q","_item"]; + _tries = 0; + #ifdef blck_debugMode + diag_log format["blck_fnc_loadLootFromItemsArray:: -- >> now loading for %1",_x]; + #endif + _q = _x select 1; // this can be a number or array. + if ( (typeName _q) isEqualTo "ARRAY") then // Assume the array contains a min/max number to add + { + if ((count _q) isEqualTo 2) then {_tries = (_q select 0) + round(random(((_q select 1) - (_q select 0))));} else {_tries = 0;}; + }; + if ((typeName _q) isEqualTo "SCALAR") then + { + _tries = _q; + }; + for "_i" from 1 to _tries do + { + _item = selectRandom (_x select 0); + [_item,_crate,_addAmmo] call blck_fnc_addItemToCrate; + }; + }forEach _loadout; 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 9c73abe..0dd64a9 100644 --- a/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf +++ b/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf @@ -33,15 +33,18 @@ while {true} do #ifdef DBDserver [] call blck_fnc_broadcastServerFPS; #endif - _timer1sec - diag_tickTime; + _timer1sec = diag_tickTime; + }; + if (diag_tickTime - _timer5sec > 5) then + { + _timer5sec = diag_tickTime; + [] call blck_fnc_missionGroupMonitor; }; - if (diag_tickTime - _timer20sec > 20) then { [] call blck_fnc_cleanupAliveAI; [] call blck_fnc_cleanupObjects; [] call blck_fnc_cleanupDeadAI; - [] call blck_fnc_missionGroupMonitor; _timer20sec = diag_tickTime; //diag_log format["_mainThread::-->> diag_tickTime = %1",diag_tickTime]; }; diff --git a/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_missionGroupMonitor.sqf b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_missionGroupMonitor.sqf index c86be8f..5afd5b1 100644 --- a/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_missionGroupMonitor.sqf +++ b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_missionGroupMonitor.sqf @@ -155,6 +155,39 @@ _fn_monitorGroupWaypoints = { } forEach blck_monitoredMissionAIGroups; }; +_fn_simulationMonitor = { + _modType = call blck_fnc_getModType; + if (_modType isEqualTo "Exile") then + { + _playerType = ["Exile_Unit_Player"]; + }else{ + _playerType = ["Epoch_Male_F","Epoch_Female_F"]; + }; + { + // player nearEntities [["Car", "Motorcycle", "Tank"], 50]; + _players = (leader _x) nearEntities [_playerType, 1800]; + if (count _players > 0) then + { + // Be sure simulation is on for all units in the group + if !(_x getVariable["blck_simulationStatus",false]) then + { + _x setVariable["blck_simulationStatus",true]; + { + _x enableSimulationGlobal true; + }forEach (units _x); + }; + }else{ + // Be sure simulation is off for all units in the group. + if !(_x getVariable["blck_simulationStatus",true]) then + { + _x setVariable["blck_simulationStatus",false]; + { + _x enableSimulationGlobal false; + }forEach (units _x); + }; + }; + } forEach blck_monitoredMissionAIGroups; +}; //////// // Start of main function //////// @@ -164,3 +197,7 @@ if (blck_debugLevel > 2) then {diag_log format["_fnc_missionGroupMonitor: execut [] call _fn_removeEmptyOrNullGroups; uiSleep 0.1; [] call _fn_monitorGroupWaypoints; + +#ifndef useDynamicSimulation +[] call _fn_simulationMonitor; +#endif \ No newline at end of file diff --git a/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_setupWaypoints.sqf b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_setupWaypoints.sqf index b646aa2..d1cc454 100644 --- a/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_setupWaypoints.sqf +++ b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_setupWaypoints.sqf @@ -3,7 +3,7 @@ for DBD Clan By Ghostrider-DBD- Copyright 2016 - Last modified 4/29/17 + Last modified 6/1/17 -------------------------- License @@ -43,6 +43,7 @@ if (_soldierType isEqualTo "emplaced") then }; if !(_soldierType isEqualTo "emplaced") then { + _arc = 360/5; _group setcombatmode "YELLOW"; _group setBehaviour "COMBAT"; _group setVariable["patrolCenter",_pos]; @@ -56,7 +57,7 @@ if !(_soldierType isEqualTo "emplaced") then _group setVariable["wpArc",_arc]; _group setVariable["soldierType",_soldierType]; _dir = 0; - _arc = 360/5; + _wpradius = 30; _dis = (_minDis) + random( (_maxDis) - (_minDis) ); _newPos = _pos getPos[_dis,_dir]; diff --git a/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf index d475164..091daaf 100644 --- a/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf +++ b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf @@ -37,7 +37,7 @@ if (blck_debugLevel > 1) then #endif _groupSpawned = createGroup blck_AI_Side; -_groupSpawned setVariable["groupVehicle",objNull]; + #ifdef blck_debugMode if (blck_debugLevel > 1) then { @@ -49,6 +49,12 @@ if !(isNull _groupSpawned) then #ifdef blck_debugMode if (blck_debugLevel > 1) then {diag_log format["_fnc_spawnGroup:: -- >> Group created = %1",_groupSpawned]}; #endif + _groupSpawned setVariable["groupVehicle",objNull]; + + #ifdef useDynamicSimulation + _groupSpawned enableDynamicSimulation true; + #endif + _groupSpawned setcombatmode "RED"; _groupSpawned setBehaviour "COMBAT"; _groupSpawned allowfleeing 0; diff --git a/@epochhive/addons/custom_server/Compiles/Missions/GMS_fnc_fillBoxes.sqf b/@epochhive/addons/custom_server/Compiles/Missions/GMS_fnc_fillBoxes.sqf index a4d0939..d9df832 100644 --- a/@epochhive/addons/custom_server/Compiles/Missions/GMS_fnc_fillBoxes.sqf +++ b/@epochhive/addons/custom_server/Compiles/Missions/GMS_fnc_fillBoxes.sqf @@ -19,15 +19,6 @@ params["_crate","_boxLoot","_itemCnts"]; _itemCnts params["_wepCnt","_magCnt","_opticsCnt","_materialsCnt","_itemCnt","_bkcPckCnt"]; - /* - _wepCnt // number of types of weapons to load - _magCnt // Number of types of additional, optional magazines to add (this includes building supplies) - _opticsCnt // number of types of optics to be added - _materialsCnt // Number of cinder, motar etc to be added - _itemCnt // number of items (first aid packs, multigun bits) to load - _bkcPckCnt // Number of backpacks to add - */ - if (_wepCnt > 0) then { diff --git a/@epochhive/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf b/@epochhive/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf index 3060932..4f6f927 100644 --- a/@epochhive/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf +++ b/@epochhive/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf @@ -19,7 +19,7 @@ _unit = _this select 0 select 0; _instigator = _this select 0 select 3; #ifdef blck_debugMode -if (blck_debugLevel ? 1) then +if (blck_debugLevel > 1) then { diag_log format["EH_AIHit:: _units = %1 and _instigator = %2 units damage is %3",_unit,_instigator, damage _unit]; }; 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 0febd8b..914561d 100644 --- a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processAIKill.sqf +++ b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processAIKill.sqf @@ -1,6 +1,6 @@ /* Handle AI Deaths - Last Modified 3/23/17 + Last Modified 5/31/17 By Ghostrider-DBD- Copyright 2016 -------------------------- @@ -17,29 +17,28 @@ params["_unit","_killer","_isLegal"]; _unit setVariable ["blck_cleanupAt", (diag_tickTime) + blck_bodyCleanUpTimer, true]; -/* -if (vehicle _unit != _unit) then { - if (count crew (vehicle _unit) isEqualTo 0) then - { - [vehicle _unit] call blck_fnc_releaseVehicleToPlayers; - }; -};*/ - blck_deadAI pushback _unit; _group = group _unit; [_unit] joinSilent grpNull; -if (count(units _group) < 1) then {deleteGroup _group;}; +if (count(units _group) < 1) then { + #ifdef useDynamicSimulation + _group enableDynamicSimulation false; + #endif + deleteGroup _group; +}; if (blck_launcherCleanup) then {[_unit] spawn blck_fnc_removeLaunchers;}; if (blck_removeNVG) then {[_unit] spawn blck_fnc_removeNVG;}; if !(isPlayer _killer) exitWith {}; //[_unit,_killer] call blck_fnc_alertNearbyUnits; [_unit,_killer] call blck_fnc_alertNearbyLeader; _group = group _unit; -//_group setBehavior "COMBAT"; _wp = [_group, currentWaypoint _group]; _wp setWaypointBehaviour "COMBAT"; _group setCombatMode "RED"; _wp setWaypointCombatMode "RED"; +{ + _unit removeAllEventHandlers _x; +}forEach ["Killed","Fired","HandleDamage","HandleHeal","FiredNear","Hit"]; _isLegal = [_unit,_killer] call blck_fnc_processIlleagalAIKills; @@ -70,8 +69,6 @@ if (blck_useKillMessages) then //diag_log format["[blck] unit killed message is %1",_message,""]; [["aikilled",_message,"victory"],playableUnits] call blck_fnc_messageplayers; }; -[_unit,_killer,_kills] call blck_fnc_rewardKiller; -{ - _unit removeAllEventHandlers _x; -}forEach ["Killed","Fired","HandleDamage","HandleHeal","FiredNear","Hit"] +[_unit,_killer] call blck_fnc_rewardKiller; + diff --git a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf index e8fcf9f..6a2ab40 100644 --- a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf +++ b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf @@ -1,6 +1,6 @@ /* by Ghostrider - 4-12-17 + 6-1-17 -------------------------- License -------------------------- @@ -12,13 +12,13 @@ private["_missionType","_wasRunover","_launcher","_legal"]; params["_unit","_killer"]; -//diag_log format["##-processIlleagalAIKills.sqf-## processing illeagal kills for unit %1",_unit]; +diag_log format["##-processIlleagalAIKills.sqf-## processing illeagal kills for unit %1",_unit]; _launcher = _unit getVariable ["Launcher",""]; _legal = true; _fn_targetVehicle = { // force AI to fire on the vehicle with launchers if equiped params["_unit","_vk"]; - private + private["_unit"]; { if ( ( (getPos _vk) distance2d (getPos _x) ) < 500 ) then { diff --git a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_rewardKiller.sqf b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_rewardKiller.sqf index 2d53cdc..fbd8aa0 100644 --- a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_rewardKiller.sqf +++ b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_rewardKiller.sqf @@ -3,7 +3,7 @@ calculate a reward player for AI Kills in crypto. Code fragment adapted from VEMF call as [_unit,_killer] call blck_fnc_rewardKiller; - Last modified 1/22/17 + Last modified 6/3/17 -------------------------- License -------------------------- @@ -13,14 +13,15 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -params["_unit","_killer","_kills"]; +params["_unit","_killer"]; //diag_log format["rewardKiller:: _unit = %1 and _killer %2",_unit,_killer]; private["_modType","_reward","_maxReward","_dist","_killstreakReward","_distanceBonus","_newKillerScore","_newKillerFrags","_money"]; _modType = call blck_fnc_getModType; -//diag_log format["[blckeagles] rewardKiller:: - _modType = %1",_modType]; - +diag_log format["[blckeagles] rewardKiller:: - _modType = %1",_modType]; +if (_modType isEqualTo "Epoch") exitWith {}; // Have players pull crypto from AI bodies now that this feature is available. +/* if (_modType isEqualTo "Epoch") then { //diag_log "calculating reward for Epoch"; @@ -53,33 +54,67 @@ if (_modType isEqualTo "Epoch") then }; }; }; +*/ +/* +_player setVariable ["ExileHunger", _data select 4]; +_player setVariable ["ExileThirst", _data select 5]; +_player setVariable ["ExileAlcohol", _data select 6]; +_player setVariable ["ExileTemperature", _data select 44]; +_player setVariable ["ExileWetness", _data select 45]; +*/ if (_modType isEqualTo "Exile") then { private["_distanceBonus","_overallRespectChange","_newKillerScore","_newKillerFrags","_maxReward","_money","_message"]; - _distanceBonus = floor((_unit distance _killer)/100); - - _overallRespectChange = 50 + _distanceBonus; - _newKillerScore = _killer getVariable ["ExileScore", 0]; - _newKillerScore = _newKillerScore + (_overallRespectChange/2); - _killer setVariable ["ExileScore", _newKillerScore]; - format["setAccountScore:%1:%2", _newKillerScore,getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget; - _newKillerFrags = _killer getVariable ["ExileKills", 0]; - _newKillerFrags = _newKillerFrags + 1; - _killer setVariable ["ExileKills", _newKillerFrags]; - format["addAccountKill:%1", getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget; - if (blck_addAIMoney) then + /* + // Temporary fix for the Loss of Respect Bug. + diag_log format["GMS_fnc_rewardKiller.sqf:: _killer name = %2 | ExileScore = %1 | Kills %3",_killer getVariable [ "ExileScore", 0 ], name _killer, _killer getVariable["ExileKills",0]]; + diag_log format["GMS_fnc_rewardKiller.sqf:: _killer = %1 | vehicle _killer = %2 | objectParent _killer %3",_killer, vehicle _killer, objectParent _killer]; + diag_log format["GMS_fnc_rewardKiller.sqf:: _killer is gunner = %1 | killer is driver = %2",_killer isEqualTo gunner objectParent _killer,_killer isEqualTo driver objectParent _killer]; + diag_log format["GMS_fnc_rewardKiller.sqf:: _killer ExileOwnerUID = %1 ",_killer getVariable["ExileOwnerUID",0]]; // ExileOwnerUID + diag_log format["GMS_fnc_rewardKiller.sqf:: _killer ExileHunger = %1 ",_killer getVariable["ExileHunger",0]]; // ExileOwnerUID + diag_log format["GMS_fnc_rewardKiller.sqf:: _killer ExileThirst = %1 ",_killer getVariable["ExileThirst",0]]; // ExileOwnerUID + diag_log format["GMS_fnc_rewardKiller.sqf:: _killer ExileAlcohol = %1 ",_killer getVariable["ExileAlcohol",0]]; // ExileOwnerUID + diag_log format["GMS_fnc_rewardKiller.sqf:: _killer ExileWetness = %1 ",_killer getVariable["ExileWetness",0]]; // ExileOwnerUID + */ + if ( (isPlayer _killer) && (_killer getVariable["ExileHunger",0] > 0) && (_killer getVariable["ExileThirst",0] > 0) ) then { - _money = _killer getVariable ["ExileMoney", 0]; - _money = _money + (_overallRespectChange/2) + (_kills * 2); - _killer setVariable ["ExileMoney", _money]; - format["setAccountMoney:%1:%2", _money, (getPlayerUID _killer)] call ExileServer_system_database_query_fireAndForget; - }; - //_message = ["showFragRequest",_overallRespectChange]; - _killer call ExileServer_object_player_sendStatsUpdate; - if (blck_useKillScoreMessage) then - { - [["showScore",[50,_distanceBonus,_kills]], [_killer]] call blck_fnc_messageplayers; + _distanceBonus = floor((_unit distance _killer)/100); + _killstreakBonus = 3 * (_killer getVariable["blck_kills",0]); + _respectGained = 25 + _distanceBonus + _killstreakBonus; + _score = _killer getVariable ["ExileScore", 0]; + diag_log format["GMS_fnc_rewardKiller.sqf:: ExileScore = %1",_killer getVariable ["ExileScore", 0]]; + _score = _score + (_respectGained); + diag_log format["GMS_fnc_rewardKiller.sqf:: _new = %1",_score]; + _killer setVariable ["ExileScore", _score]; + format["setAccountScore:%1:%2", _score,getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget; + _newKillerFrags = _killer getVariable ["ExileKills", 0]; + _newKillerFrags = _newKillerFrags + 1; + _killer setVariable ["ExileKills", _newKillerFrags]; + format["addAccountKill:%1", getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget; + //_message = ["showFragRequest",_respectGained]; + _killer call ExileServer_object_player_sendStatsUpdate; + if (blck_useKillScoreMessage) then + { + [["showScore",[_respectGained,_distanceBonus,_kills]], [_killer]] call blck_fnc_messageplayers; + }; }; }; + +/* + if (_overallRespectChange > 0) then { + _score = _killer getVariable ["ExileScore", 0]; + _score = _score + _overallRespectChange; + _killer setVariable ["ExileScore", _score]; + format["setAccountScore:%1:%2", _score,_killerPlayerUID] call ExileServer_system_database_query_fireAndForget; + [_killer, "showFragRequest", [_killerRespectPoints]] call A3XAI_sendExileMessage; + }; + + //["systemChatRequest", [_killMessage]] call ExileServer_system_network_send_broadcast; //To-do: Non-global version + _newKillerFrags = _killer getVariable ["ExileKills", 0]; + _killer setVariable ["ExileKills", _newKillerFrags + 1]; + format["addAccountKill:%1", _killerPlayerUID] call ExileServer_system_database_query_fireAndForget; + + _killer call ExileServer_object_player_sendStatsUpdate; +}; 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 68a0cd4..46ee104 100644 --- a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_spawnUnit.sqf +++ b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_spawnUnit.sqf @@ -46,10 +46,10 @@ if (_modType isEqualTo "Exile") then "i_g_soldier_unarmed_f" createUnit [_pos, _aiGroup, "_ai1 = this", blck_baseSkill, "COLONEL"]; switch(_skillLevel) do { - case "blue":{_ai1 setVariable["ExileMoney",floor(random(blck_maxMoneyBlue)),true];}; - case "red":{_ai1 setVariable["ExileMoney",floor(random(blck_maxMoneyRed)),true];}; - case "green":{_ai1 setVariable["ExileMoney",floor(random(blck_maxMoneyGreen)),true];}; - case "orange":{_ai1 setVariable["ExileMoney",floor(random(blck_maxMoneyOrange)),true];}; + case "blue":{_ai1 setVariable["ExileMoney",2 + floor(random(blck_maxMoneyBlue)),true];}; + case "red":{_ai1 setVariable["ExileMoney",4 + floor(random(blck_maxMoneyRed)),true];}; + case "green":{_ai1 setVariable["ExileMoney",6 + floor(random(blck_maxMoneyGreen)),true];}; + case "orange":{_ai1 setVariable["ExileMoney",8 + floor(random(blck_maxMoneyOrange)),true];}; }; }; [_ai1] call blck_fnc_removeGear; diff --git a/@epochhive/addons/custom_server/Compiles/blck_functions.sqf b/@epochhive/addons/custom_server/Compiles/blck_functions.sqf index 3b1755c..1a58c92 100644 --- a/@epochhive/addons/custom_server/Compiles/blck_functions.sqf +++ b/@epochhive/addons/custom_server/Compiles/blck_functions.sqf @@ -30,6 +30,8 @@ blck_fnc_playerInRange = compileFinal preprocessFileLineNumbers "\q\addons\cust blck_fnc_playerInRangeArray = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_playerInRangeArray.sqf"; // GMS_fnc_playerInRangeArray blck_fnc_mainThread = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_mainThread.sqf"; blck_fnc_allPlayers = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_allPlayers.sqf"; +blck_fnc_addItemToCrate = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_addItemToCrate.sqf"; +blck_fnc_loadLootItemsFromArray = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_loadLootItemsFromArray.sqf"; #ifdef DBDserver blck_fnc_broadcastServerFPS = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_broadcastServerFPS.sqf"; @@ -57,8 +59,6 @@ blck_fnc_spawnMissionVehiclePatrols = compileFinal preprocessFileLineNumbers "\q blck_fnc_spawnEmplacedWeaponArray = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnEmplacedWeaponArray.sqf"; blck_fnc_spawnMissionAI = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnMissionAI.sqf"; blck_fnc_spawnMissionLootVehicles = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnMissionLootVehicles.sqf"; -blck_fnc_addItemToCrate = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_addItemToCrate.sqf"; -blck_fnc_loadLootItemsFromArray = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc__loadLootItemsFromArray.sqf"; blck_fnc_fillBoxes = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_fillBoxes.sqf"; // Adds items to an object according to passed parameters. See the script for details. blck_fnc_smokeAtCrates = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_smokeAtCrates.sqf"; // Spawns a wreck and adds smoke to it blck_fnc_spawnMines = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnMines.sqf"; // Deploys mines at random locations around the mission center diff --git a/@epochhive/addons/custom_server/Compiles/blck_variables.sqf b/@epochhive/addons/custom_server/Compiles/blck_variables.sqf index ffc71da..8dfbf12 100644 --- a/@epochhive/addons/custom_server/Compiles/blck_variables.sqf +++ b/@epochhive/addons/custom_server/Compiles/blck_variables.sqf @@ -31,8 +31,10 @@ blck_pendingMissions = []; blck_missionsRunning = 0; blck_activeMissions = []; blck_deadAI = []; - - +#ifdef useDynamicSimulation +"Group" setDynamicSimulationDistance 1800; +enableDynamicSimulationSystem true; +#endif // Arrays for use during cleanup of alive AI at some time after the end of a mission DBD_HeliCrashSites = []; diff --git a/@epochhive/addons/custom_server/Configs/blck_defines.hpp b/@epochhive/addons/custom_server/Configs/blck_defines.hpp index 5010d25..abdfc8d 100644 --- a/@epochhive/addons/custom_server/Configs/blck_defines.hpp +++ b/@epochhive/addons/custom_server/Configs/blck_defines.hpp @@ -2,7 +2,7 @@ for DBD Clan By Ghostrider-DBD- Copyright 2016 - Last Modified 3-21-17 + Last Modified 6/7/17 -------------------------- License @@ -12,9 +12,11 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ -#define modUsed true -//#define DBDserver 1 +#define modUsed +#define DBDserver #define wpModeMove -#define useAPEX 1 +#define useAPEX +#define useDynamicSimulation //#define blck_debugMode -//#define blck_debugMode3 \ No newline at end of file +//#define blck_debugMode3 +//#define blck_milServer \ No newline at end of file diff --git a/@epochhive/addons/custom_server/GMS_fnc_setupWaypoints.sqf b/@epochhive/addons/custom_server/GMS_fnc_setupWaypoints.sqf new file mode 100644 index 0000000..d1cc454 --- /dev/null +++ b/@epochhive/addons/custom_server/GMS_fnc_setupWaypoints.sqf @@ -0,0 +1,94 @@ +// Sets up waypoints for a specified group. +/* + for DBD Clan + By Ghostrider-DBD- + Copyright 2016 + Last modified 6/1/17 + + -------------------------- + License + -------------------------- + All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License. + + http://creativecommons.org/licenses/by-nc-sa/4.0/ +*/ +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; +#ifdef blck_debugMode +diag_log "_fnc_setupWaypoints: blck_debugMode enabled"; +#endif + +private["_dir","_arc","_noWp","_newpos","_wpradius","_wp"]; +params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_wpPatrolMode","SAD"],["_soldierType","null"] ]; +_wp = [_group, 0]; +#ifdef blck_debugMode +diag_log format["_fnc_setupWaypoints (4/29/17): configuring waypoints for group %1: _mode = %2 | _wpPatrolMode = %3 _soldierType = %4",_group, _mode, _wpPatrolMode,_soldierType]; +#endif +if (_soldierType isEqualTo "emplaced") then +{ + _wp setWaypointType "SENTRY"; + _wp setWPPos (getPos leader _group); + _wp setWaypointCompletionRadius 100; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointCombatMode "RED"; + _wp setWaypointTimeout [1,1.1,1.2]; + //_wp setWaypointTimeout [0.1,0.1100,0.1200]; + _group setCurrentWaypoint _wp; + _group setVariable["soldierType",_soldierType]; + #ifdef blck_debugMode + _wp setWaypointStatements ["true","this call blck_fnc_emplacedWeaponWaypoint; diag_log format['====Updating timestamp for group %1 and changing its WP to an emplaced weapon Waypoint',group this];"]; + #else + _wp setWaypointStatements ["true","this call blck_fnc_emplacedWeaponWaypoint;"]; + #endif + if (blck_debugLevel > 1) then {diag_log format["_fnc_setupWaypoints: configuring weapoints for group %2 for emplaced weapon with _soldierType = %1",_soldierType,_group];}; +}; +if !(_soldierType isEqualTo "emplaced") then +{ + _arc = 360/5; + _group setcombatmode "YELLOW"; + _group setBehaviour "COMBAT"; + _group setVariable["patrolCenter",_pos]; + _group setVariable["minDis",_minDis]; + _group setVariable["maxDis",_maxDis]; + _group setVariable["timeStamp",diag_tickTime]; + _group setVariable["wpRadius",30]; + _group setVariable["wpMode",_mode]; + _group setVariable["wpPatrolMode",_wpPatrolMode]; + _group setVariable["wpDir",0]; + _group setVariable["wpArc",_arc]; + _group setVariable["soldierType",_soldierType]; + _dir = 0; + + _wpradius = 30; + _dis = (_minDis) + random( (_maxDis) - (_minDis) ); + _newPos = _pos getPos[_dis,_dir]; + _wp setWPPos [_newPos select 0, _newPos select 1]; + _wp setWaypointCompletionRadius (_group getVariable["wpRadius",30]); + _wp setWaypointType "MOVE"; + _wp setWaypointName "move"; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointCombatMode "RED"; + _wp setWaypointTimeout [1,1.1,1.2]; + _group setCurrentWaypoint _wp; + #ifdef blck_debugMode + _wp setWaypointStatements ["true","this call blck_fnc_changeToMoveWaypoint; diag_log format['====Updating timestamp for group %1 and changing its WP to a Move Waypoint',group this];"]; + #else + _wp setWaypointStatements ["true","this call blck_fnc_changeToMoveWaypoint;"]; + #endif + #ifdef blck_debugMode + if (blck_debugLevel > 1) then + { + _marker = createMarker [format["GroupMarker%1",_group],_newPos]; + _group setVariable["wpMarker",_marker]; + _marker setMarkerColor "ColorBlue"; + _marker setMarkerText format["%1 %2",(_group getVariable["soldierType","null"]),_group]; + _marker setMarkerType "mil_triangle"; + //diag_log format["_fnc_setupWaypoints: configuring weapoints for group %2 mobile patrol with _soldierType = %1",_solderType,_group]; + diag_log format["_fnc_setupWaypoints: soldier type for mobile _group %1 set to %2",_group, (_group getVariable["soldierType","null"])]; + diag_log format["_fnc_setupWaypoints: all variables for the group have been set for group %1",_group]; + diag_log format["_fnc_setupWaypoints:: -- >> wpMode %1 _dir %2 _dis 3",_group getVariable["wpMode","random"], _dir, _dis]; + diag_log format["_fnc_setupWaypoints:: -- >> group to update is %1 and new position is %2",_group, _newPos]; + diag_log format["_fnc_setupWaypoints:: -- >> Waypoint statements for group %1 have been configured as %2",_group, waypointStatements _wp]; + diag_log format["_fnc_setupWaypoints:: -- >> Waypoint marker for group %1 have been configured as %2 with text set to %3",_group, _group getVariable "wpMarker", markerText (_group getVariable "wpMarker")]; + }; + #endif +}; diff --git a/@epochhive/addons/custom_server/changeLog.sqf b/@epochhive/addons/custom_server/changeLog.sqf index 4e061c2..d0c32a3 100644 --- a/@epochhive/addons/custom_server/changeLog.sqf +++ b/@epochhive/addons/custom_server/changeLog.sqf @@ -4,6 +4,11 @@ Loosely based on the AI mission system by blckeagls ver 2.0.2 Contributions by Narines: bug fixes, testing, infinite ammo fix. Ideas or code from that by Vampire and KiloSwiss have been used for certain functions. +6/1/17 Version 6.59 Build 59 +[changed] Players are no longer given crypto for each AI kill. Crypto added to AI Bodies was increased. +[fixed] error in GMS_fnc_setupWaypoints wherein _arc was not defined early enough in the script. +[fixed] Exile Respect Loss bug (temporary fix only). + 5/21/17 Version 6.58 build 58 [Fixed] typos for blck_epochValuables. [Fixed] All loot was removed from AI vehicles at the time a mission was completed. diff --git a/@epochhive/addons/custom_server/init/build.sqf b/@epochhive/addons/custom_server/init/build.sqf index 1c52a49..7a555d3 100644 --- a/@epochhive/addons/custom_server/init/build.sqf +++ b/@epochhive/addons/custom_server/init/build.sqf @@ -1,3 +1,3 @@ private ["_version","_versionDate"]; -_blck_version = "6.58 Build 58"; -_blck_versionDate = "4-30-17 8:00 PM"; +_blck_version = "6.59 Build 62"; +_blck_versionDate = "6-7-17 9:00 PM"; diff --git a/changeLog.sqf b/changeLog.sqf index 6c37419..d0c32a3 100644 --- a/changeLog.sqf +++ b/changeLog.sqf @@ -4,30 +4,24 @@ Loosely based on the AI mission system by blckeagls ver 2.0.2 Contributions by Narines: bug fixes, testing, infinite ammo fix. Ideas or code from that by Vampire and KiloSwiss have been used for certain functions. +6/1/17 Version 6.59 Build 59 +[changed] Players are no longer given crypto for each AI kill. Crypto added to AI Bodies was increased. +[fixed] error in GMS_fnc_setupWaypoints wherein _arc was not defined early enough in the script. +[fixed] Exile Respect Loss bug (temporary fix only). + 5/21/17 Version 6.58 build 58 [Fixed] typos for blck_epochValuables. [Fixed] All loot was removed from AI vehicles at the time a mission was completed. [Fixed] When mission completion criteria included killing all AI, missions could be completed with alive AI in vehicles. -4/29/17 Version 6.58 Build 57 +4/6/17 Version 6.58 Build 54 [Added] A FAQ presenting an overview of the mission system and addons. -[Added] Optional helicopter patrols that drop paratroops. These can be configured using variables in blck_configs.sqf: - - For example, settings for the blue difficulty for missions are shown below. - - blck_chanceParaBlue = 0.1; // [0 - 1] set to 0 to deactivate and 1 to always have paratroops spawn over the center of the mission. - blck_noParaBlue = 3; // [1-N] - -[Changed] A new method for dynamically setting waypoints was added and waypoints are now scanned to detect and correct the case that AI get 'stuck', meaning the waypoint is never completed. -[Changes] AI behaviors should be more agressive. -[Changed] License information added to all files. -[Added] Preprocessor definitions included in all files. +[Changed] Helicopter crew waypoint system reverted to that from Build 46. [Fixed] Mission timouts would prevent new missions from spawning after a while. [Fixed] blck_timeAcceleration now determines if time acceleration is activated. [Fixed] Missions did not complete correctly under certain circumstances. [Fixed] Mission vehicles were not properly deleted, unlocked or otherwise handled at misison end or when AI crew were killed. [Fixed] Throws errors when evaluating errors related to certain disallowed types of kills. -[Fixed] Static loot crate spawner spawned empty crates under some circumstances. Known errors: throws errors with certain loot crate setups (Exile) 3/23/17 Verision 6.58 build 48 From 05548035eeaabec90615e3abb3c7244665a6f0f8 Mon Sep 17 00:00:00 2001 From: Ghostrider-DbD- Date: Sat, 10 Jun 2017 12:07:01 -0400 Subject: [PATCH 2/3] removed some unecessary loging --- .../Compiles/Units/GMS_fnc_cleanupAliveAI.sqf | 10 +++++----- .../Units/GMS_fnc_processIlleagalAIKills.sqf | 2 +- .../Compiles/Units/GMS_fnc_rewardKiller.sqf | 6 +++--- MPMissions/Exile.Altis/debug/blckClient.sqf | 16 +++++++++------- MPMissions/Exile.Altis/debug/deleteMarker.sqf | 4 +++- .../Exile.Altis/debug/missionCompleteMarker.sqf | 3 ++- MPMissions/Exile.Altis/debug/spawnMarker.sqf | 14 +++++++------- MPMissions/epoch.Altis/debug/blckClient.sqf | 6 ++++-- MPMissions/epoch.Altis/debug/deleteMarker.sqf | 4 +++- .../epoch.Altis/debug/missionCompleteMarker.sqf | 3 ++- MPMissions/epoch.Altis/debug/spawnMarker.sqf | 16 ++++++---------- 11 files changed, 45 insertions(+), 39 deletions(-) diff --git a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_cleanupAliveAI.sqf b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_cleanupAliveAI.sqf index 0390861..b904443 100644 --- a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_cleanupAliveAI.sqf +++ b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_cleanupAliveAI.sqf @@ -41,16 +41,16 @@ for "_i" from 1 to (count blck_liveMissionAI) do //diag_log format["_fnc_cleanupAliveAI:: (34) evaluating with delete time = %2 and diag_tickTime %1", diag_tickTime, _units select 1]; if (diag_tickTime > (_units select 1) ) then { - diag_log format["_fnc_cleanupAliveAI:: cleaning up AI group %1",_units]; + //diag_log format["_fnc_cleanupAliveAI:: cleaning up AI group %1",_units]; { - diag_log format["_fnc_cleanupAliveAI:: deleting unit %1",_x]; - diag_log format["_fnc_cleanupAliveAI:: vehicle _x = %1",vehicle _x]; - diag_log format["_fnc_cleanupAliveAI:: objectParent _x = %1",objectParent _x]; + //diag_log format["_fnc_cleanupAliveAI:: deleting unit %1",_x]; + //diag_log format["_fnc_cleanupAliveAI:: vehicle _x = %1",vehicle _x]; + //diag_log format["_fnc_cleanupAliveAI:: objectParent _x = %1",objectParent _x]; if ((alive _x) && !(isNull objectParent _x)) then // mark the vehicle for deletion { - diag_log format["_fnc_cleanupAliveAI: deleteing objectParent %1 [%3] for unit %2",objectParent _x, _x, typeName (objectParent _x), typeOf (objectParent _x)]; + //diag_log format["_fnc_cleanupAliveAI: deleteing objectParent %1 [%3] for unit %2",objectParent _x, _x, typeName (objectParent _x), typeOf (objectParent _x)]; [objectParent _x] call blck_fn_deleteAIvehicle; }; [_x] call blck_fnc_deleteAI; diff --git a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf index 6a2ab40..33d8566 100644 --- a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf +++ b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf @@ -12,7 +12,7 @@ private["_missionType","_wasRunover","_launcher","_legal"]; params["_unit","_killer"]; -diag_log format["##-processIlleagalAIKills.sqf-## processing illeagal kills for unit %1",_unit]; +//diag_log format["##-processIlleagalAIKills.sqf-## processing illeagal kills for unit %1",_unit]; _launcher = _unit getVariable ["Launcher",""]; _legal = true; diff --git a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_rewardKiller.sqf b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_rewardKiller.sqf index fbd8aa0..b40d9a7 100644 --- a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_rewardKiller.sqf +++ b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_rewardKiller.sqf @@ -19,7 +19,7 @@ params["_unit","_killer"]; private["_modType","_reward","_maxReward","_dist","_killstreakReward","_distanceBonus","_newKillerScore","_newKillerFrags","_money"]; _modType = call blck_fnc_getModType; -diag_log format["[blckeagles] rewardKiller:: - _modType = %1",_modType]; +//diag_log format["[blckeagles] rewardKiller:: - _modType = %1",_modType]; if (_modType isEqualTo "Epoch") exitWith {}; // Have players pull crypto from AI bodies now that this feature is available. /* if (_modType isEqualTo "Epoch") then @@ -83,9 +83,9 @@ if (_modType isEqualTo "Exile") then _killstreakBonus = 3 * (_killer getVariable["blck_kills",0]); _respectGained = 25 + _distanceBonus + _killstreakBonus; _score = _killer getVariable ["ExileScore", 0]; - diag_log format["GMS_fnc_rewardKiller.sqf:: ExileScore = %1",_killer getVariable ["ExileScore", 0]]; + //diag_log format["GMS_fnc_rewardKiller.sqf:: ExileScore = %1",_killer getVariable ["ExileScore", 0]]; _score = _score + (_respectGained); - diag_log format["GMS_fnc_rewardKiller.sqf:: _new = %1",_score]; + //diag_log format["GMS_fnc_rewardKiller.sqf:: _new = %1",_score]; _killer setVariable ["ExileScore", _score]; format["setAccountScore:%1:%2", _score,getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget; _newKillerFrags = _killer getVariable ["ExileKills", 0]; diff --git a/MPMissions/Exile.Altis/debug/blckClient.sqf b/MPMissions/Exile.Altis/debug/blckClient.sqf index 99211f1..9ef231a 100644 --- a/MPMissions/Exile.Altis/debug/blckClient.sqf +++ b/MPMissions/Exile.Altis/debug/blckClient.sqf @@ -3,7 +3,9 @@ // Last Updated 1/11/17 // by Ghostrider-DbD- ////////////////////////////////////////// - +blck_fnc_spawnMarker = compileFinal preprocessfilelinenumbers "debug\spawnMarker.sqf"; +blck_fnc_deleteMarker = compileFinal preprocessfilelinenumbers "debug\deleteMarker.sqf"; +blck_fnc_missionCompleteMarker = compileFinal preprocessfilelinenumbers "debug\missionCompleteMarker.sqf"; if !(isServer) then { //diag_log "[blckeagls] initializing client variables"; @@ -119,25 +121,25 @@ if !(isServer) then fn_handleMessage = { //private["_event","_msg","_mission"]; - diag_log format["blck_Message ====] Paremeters = _this = %1",_this]; + //diag_log format["blck_Message ====] Paremeters = _this = %1",_this]; params["_event","_message",["_mission",""]]; - diag_log format["blck_Message ====] Paremeters _event %1 _message %2 paramter #3 %3",_event,_message,_mission]; - diag_log format["blck_Message ====] _message isEqualTo %1",_message]; + //diag_log format["blck_Message ====] Paremeters _event %1 _message %2 paramter #3 %3",_event,_message,_mission]; + //diag_log format["blck_Message ====] _message isEqualTo %1",_message]; switch (_event) do { case "start": { playSound "UAV_05"; - diag_log "switch start"; + //diag_log "switch start"; //_mission = _this select 1 select 2; [_event,_message,_mission] spawn fn_missionNotification; }; case "end": { playSound "UAV_03"; - diag_log "switch end"; + //diag_log "switch end"; //_mission = _this select 1 select 2; [_event,_message,_mission] spawn fn_missionNotification; }; @@ -153,7 +155,7 @@ if !(isServer) then case "reinforcements": { if ( (player distance _mission) < 1000) then {playsound "AddItemOK"; ["Alert",_message] call fn_dynamicNotification;}; - diag_log "---->>>> Reinforcements Spotted"; + //diag_log "---->>>> Reinforcements Spotted"; }; case "IED": { diff --git a/MPMissions/Exile.Altis/debug/deleteMarker.sqf b/MPMissions/Exile.Altis/debug/deleteMarker.sqf index 68f214e..99458cb 100644 --- a/MPMissions/Exile.Altis/debug/deleteMarker.sqf +++ b/MPMissions/Exile.Altis/debug/deleteMarker.sqf @@ -5,8 +5,10 @@ ////////////////////////////////////////// // delete a marker +//diag_log format["blck_fnc_deleteMarker:: _this = %1",_this]; private["_markerName"]; _markerName = _this select 0; -deleteMarker _markerName; +//deleteMarker _markerName; _markerName = "label" + _markerName; deleteMarker _markerName; +//diag_log format["deleteMarker complete script for _this = %1",_this]; diff --git a/MPMissions/Exile.Altis/debug/missionCompleteMarker.sqf b/MPMissions/Exile.Altis/debug/missionCompleteMarker.sqf index 35ebc0b..ea8eee7 100644 --- a/MPMissions/Exile.Altis/debug/missionCompleteMarker.sqf +++ b/MPMissions/Exile.Altis/debug/missionCompleteMarker.sqf @@ -7,7 +7,7 @@ // this will not show to JIP players private["_location","_MainMarker","_name"]; - +//diag_log format["blck_fnc_missionCompleteMarker:: _this = %1",_this]; _location = _this select 0; _name = str(random(1000000)) + "MarkerCleared"; _MainMarker = createMarker [_name, _location]; @@ -16,3 +16,4 @@ _MainMarker setMarkerType "n_hq"; _MainMarker setMarkerText "Mission Cleared"; uiSleep 300; deleteMarker _MainMarker; +//diag_log format["missionCompleteMarker complete script for _this = %1",_this]; diff --git a/MPMissions/Exile.Altis/debug/spawnMarker.sqf b/MPMissions/Exile.Altis/debug/spawnMarker.sqf index ac830f1..32ad44a 100644 --- a/MPMissions/Exile.Altis/debug/spawnMarker.sqf +++ b/MPMissions/Exile.Altis/debug/spawnMarker.sqf @@ -64,7 +64,7 @@ _blck_fn_configureRoundMarker = { _blck_fn_configureIconMarker = { private["_MainMarker"]; params["_name","_pos",["_color","ColorBlack"],["_text",""],["_icon","mil_triangle"]]; - if (blck_debugLevel > 2) then {diag_log format["_blck_fn_configureIconMarker: _name=%1; _pos=%2; _color=%3; _text=%4",_name,_pos,_color,_text];}; + //diag_log format["_blck_fn_configureIconMarker: _name=%1; _pos=%2; _color=%3; _text=%4",_name,_pos,_color,_text]; _name = "label" + _name; _MainMarker = createMarker [_name, _pos]; @@ -74,15 +74,14 @@ _blck_fn_configureIconMarker = { _MainMarker setMarkerText _text; }; +//diag_log format["spawnMarker:: -- >> _this = %1",_this]; // _this = [[""BlueMarker"",[12524.1,18204.7,0],""Bandit Patrol"",""center"",""ColorBlue"",[""ELIPSE"",[175,175]]],""ColorBlue"",""BlueMarker""]" params["_mArray"]; + _mArray params["_missionType","_markerPos","_markerLabel","_markerLabelType","_markerColor","_markerType"]; _markerType params["_mShape","_mSize","_mBrush"]; +//diag_log format["spawnMarker.sqf:: -- >> _missionType %1 | _markerPos %2 | _markerLabel %3 | _markerLabelType %4 | _markerColor %5 | _markerType %6",_missionType,_markerPos,_markerLabel,_markerLabelType,_markerColor,_markerType]; -//if (isServer && (blck_debugLevel > 0)) then -//{ - if (blck_debugLevel > 1) then {diag_log format["spawnMarker.sqf:: -- >> _missionType %1 | _markerPos %2 | _markerLabel %3 | _markerLabelType %4 | _markerColor %5 | _markerType %6",_missionType,_markerPos,_markerLabel,_markerLabelType,_markerColor,_markerType];}; -//}; if ((_markerType select 0) in ["ELIPSE","RECTANGLE"]) then // not an Icon .... { switch (_missionType) do { @@ -91,9 +90,10 @@ if ((_markerType select 0) in ["ELIPSE","RECTANGLE"]) then // not an Icon .... default {[_missionType,_markerPos,_markerColor,_markerLabel, _mSize,_markerLabelType,_mShape,_mBrush] call _blck_fn_configureRoundMarker;}; }; }; -if !((_markerType select 0) in ["ELIPSE","RECTANGLE"]) then { // Deal with case of an icon +if !((_markerType select 0) in ["ELIPSE","RECTANGLE"]) then +{ // Deal with case of an icon // params["_name","_pos",["_color","ColorBlack"],["_text",""],["_icon","mil_triangle"]]; [_missionType,_markerPos, _markerColor,_markerLabel,_markerType select 0] call _blck_fn_configureIconMarker; }; - +//diag_log format["spawnMarker complete script for _this = %1",_this]; diff --git a/MPMissions/epoch.Altis/debug/blckClient.sqf b/MPMissions/epoch.Altis/debug/blckClient.sqf index f469b4d..9ef231a 100644 --- a/MPMissions/epoch.Altis/debug/blckClient.sqf +++ b/MPMissions/epoch.Altis/debug/blckClient.sqf @@ -3,7 +3,9 @@ // Last Updated 1/11/17 // by Ghostrider-DbD- ////////////////////////////////////////// - +blck_fnc_spawnMarker = compileFinal preprocessfilelinenumbers "debug\spawnMarker.sqf"; +blck_fnc_deleteMarker = compileFinal preprocessfilelinenumbers "debug\deleteMarker.sqf"; +blck_fnc_missionCompleteMarker = compileFinal preprocessfilelinenumbers "debug\missionCompleteMarker.sqf"; if !(isServer) then { //diag_log "[blckeagls] initializing client variables"; @@ -171,7 +173,7 @@ if !(isServer) then }; diag_log "blck client loaded ver 1/11/17 2.0 8 PM"; - //diag_log "[blckeagls] starting client loop"; + diag_log "[blckeagls] starting client loop"; while {true} do { diff --git a/MPMissions/epoch.Altis/debug/deleteMarker.sqf b/MPMissions/epoch.Altis/debug/deleteMarker.sqf index 68f214e..99458cb 100644 --- a/MPMissions/epoch.Altis/debug/deleteMarker.sqf +++ b/MPMissions/epoch.Altis/debug/deleteMarker.sqf @@ -5,8 +5,10 @@ ////////////////////////////////////////// // delete a marker +//diag_log format["blck_fnc_deleteMarker:: _this = %1",_this]; private["_markerName"]; _markerName = _this select 0; -deleteMarker _markerName; +//deleteMarker _markerName; _markerName = "label" + _markerName; deleteMarker _markerName; +//diag_log format["deleteMarker complete script for _this = %1",_this]; diff --git a/MPMissions/epoch.Altis/debug/missionCompleteMarker.sqf b/MPMissions/epoch.Altis/debug/missionCompleteMarker.sqf index 35ebc0b..ea8eee7 100644 --- a/MPMissions/epoch.Altis/debug/missionCompleteMarker.sqf +++ b/MPMissions/epoch.Altis/debug/missionCompleteMarker.sqf @@ -7,7 +7,7 @@ // this will not show to JIP players private["_location","_MainMarker","_name"]; - +//diag_log format["blck_fnc_missionCompleteMarker:: _this = %1",_this]; _location = _this select 0; _name = str(random(1000000)) + "MarkerCleared"; _MainMarker = createMarker [_name, _location]; @@ -16,3 +16,4 @@ _MainMarker setMarkerType "n_hq"; _MainMarker setMarkerText "Mission Cleared"; uiSleep 300; deleteMarker _MainMarker; +//diag_log format["missionCompleteMarker complete script for _this = %1",_this]; diff --git a/MPMissions/epoch.Altis/debug/spawnMarker.sqf b/MPMissions/epoch.Altis/debug/spawnMarker.sqf index b6c698b..32ad44a 100644 --- a/MPMissions/epoch.Altis/debug/spawnMarker.sqf +++ b/MPMissions/epoch.Altis/debug/spawnMarker.sqf @@ -74,19 +74,14 @@ _blck_fn_configureIconMarker = { _MainMarker setMarkerText _text; }; -if (isServer && (blck_debugLevel isEqualTo 3)) then -{ - diag_log format["spawnMarker:: -- >> _this = %1",_this]; -}; +//diag_log format["spawnMarker:: -- >> _this = %1",_this]; // _this = [[""BlueMarker"",[12524.1,18204.7,0],""Bandit Patrol"",""center"",""ColorBlue"",[""ELIPSE"",[175,175]]],""ColorBlue"",""BlueMarker""]" params["_mArray"]; + _mArray params["_missionType","_markerPos","_markerLabel","_markerLabelType","_markerColor","_markerType"]; _markerType params["_mShape","_mSize","_mBrush"]; +//diag_log format["spawnMarker.sqf:: -- >> _missionType %1 | _markerPos %2 | _markerLabel %3 | _markerLabelType %4 | _markerColor %5 | _markerType %6",_missionType,_markerPos,_markerLabel,_markerLabelType,_markerColor,_markerType]; -if (isServer && (blck_debugLevel isEqualTo 3)) then -{ - diag_log format["spawnMarker.sqf:: -- >> _missionType %1 | _markerPos %2 | _markerLabel %3 | _markerLabelType %4 | _markerColor %5 | _markerType %6",_missionType,_markerPos,_markerLabel,_markerLabelType,_markerColor,_markerType]; -}; if ((_markerType select 0) in ["ELIPSE","RECTANGLE"]) then // not an Icon .... { switch (_missionType) do { @@ -95,9 +90,10 @@ if ((_markerType select 0) in ["ELIPSE","RECTANGLE"]) then // not an Icon .... default {[_missionType,_markerPos,_markerColor,_markerLabel, _mSize,_markerLabelType,_mShape,_mBrush] call _blck_fn_configureRoundMarker;}; }; }; -if !((_markerType select 0) in ["ELIPSE","RECTANGLE"]) then { // Deal with case of an icon +if !((_markerType select 0) in ["ELIPSE","RECTANGLE"]) then +{ // Deal with case of an icon // params["_name","_pos",["_color","ColorBlack"],["_text",""],["_icon","mil_triangle"]]; [_missionType,_markerPos, _markerColor,_markerLabel,_markerType select 0] call _blck_fn_configureIconMarker; }; - +//diag_log format["spawnMarker complete script for _this = %1",_this]; From b7ac9e6277b97144374942d0253aade2a0bcd488 Mon Sep 17 00:00:00 2001 From: Ghostrider-DbD- Date: Sat, 10 Jun 2017 12:08:52 -0400 Subject: [PATCH 3/3] commented out DBD-specific defines --- @epochhive/addons/custom_server/Configs/blck_defines.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/@epochhive/addons/custom_server/Configs/blck_defines.hpp b/@epochhive/addons/custom_server/Configs/blck_defines.hpp index abdfc8d..5435060 100644 --- a/@epochhive/addons/custom_server/Configs/blck_defines.hpp +++ b/@epochhive/addons/custom_server/Configs/blck_defines.hpp @@ -13,7 +13,7 @@ */ #define modUsed -#define DBDserver +//#define DBDserver #define wpModeMove #define useAPEX #define useDynamicSimulation