From e2b933188defa4bf2baf4f46c4769a6ea91ab717 Mon Sep 17 00:00:00 2001 From: He-Man Date: Sun, 20 Jan 2019 13:20:01 +0100 Subject: [PATCH] Sherbet Fixes #1 - Increased defuse chance - More restricted run around base obj - Remove terminal after UAV mission - Looting dead UAV fixed - Exploding Vehicles fix (Arma has changed HitPointNames to LowerCase) --- Sources/epoch_code/compile/EPOCH_DefuseBomb.sqf | 2 +- .../compile/interface_event_handlers/EPOCH_KeyDown.sqf | 4 ++-- Sources/epoch_code/compile/setup/masterLoop/Event1.sqf | 4 +++- .../Configs/CfgActionMenu/CfgActionMenu_target.hpp | 2 +- Sources/epoch_config/Configs/CfgEpochClient.hpp | 4 ++-- Sources/epoch_config/Configs/CfgMissions/CfgExample.hpp | 1 + Sources/epoch_config/Configs/CfgMissions/CfgmissionUav.hpp | 7 +++++-- .../compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf | 2 +- 8 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Sources/epoch_code/compile/EPOCH_DefuseBomb.sqf b/Sources/epoch_code/compile/EPOCH_DefuseBomb.sqf index fb48c116..67b763f1 100644 --- a/Sources/epoch_code/compile/EPOCH_DefuseBomb.sqf +++ b/Sources/epoch_code/compile/EPOCH_DefuseBomb.sqf @@ -10,7 +10,7 @@ uisleep 5; if (alive player && !isnull _object) then { _reward = gettext (configfile >> "cfgammo" >> _type >> "defaultMagazine"); if !(_reward isequalto "") then { - _chance = ["CfgEpochClient", "DefuseBombChance", 0.4] call EPOCH_fnc_returnConfigEntryV2; + _chance = ["CfgEpochClient", "DefuseBombChance", 0.6] call EPOCH_fnc_returnConfigEntryV2; if (_chance >= ((random 100) / 100)) then { [_object,false,player,Epoch_personalToken] remoteexec ["EPOCH_server_DefuseBomb",2]; } diff --git a/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf b/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf index 467e59a4..fd68bc6c 100644 --- a/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf +++ b/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf @@ -190,10 +190,10 @@ if (vehicle player == player) then { }; if (_dikCode in(actionKeys "moveFastForward") || _dikCode in(actionKeys "moveForward")) then { - if ((diag_tickTime - EPOCH_lastAGTime) > 1) then { + if ((diag_tickTime - EPOCH_lastAGTime) > 0.5) then { EPOCH_lastAGTime = diag_tickTime; if !(player nearObjects["Const_All_Walls_F", 6] isEqualTo[]) then { - _currentPos = player modelToWorld[0, 1, 1]; + _currentPos = player modelToWorld[0, 1.75, 1]; if !(surfaceIsWater _currentPos) then { _currentPos = ATLtoASL _currentPos; }; diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf index f0b0312b..d96d8cc0 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf @@ -239,9 +239,11 @@ if (!isnil "EPOCH_ResetTraderMission") then { EPOCH_taskMarker = nil; }; if !(_EPOCH_TraderMissionArray isequalto []) then { - _EPOCH_TraderMissionArray params ["_mainblock"]; + _EPOCH_TraderMissionArray params ["_mainblock","","","","","_taskFailed"]; _mainblock params ["","","","","",["_missionCleanUpCall",""]]; call _missionCleanUpCall; + _taskFailed params ['','','','',["_taskFailedCall",""]]; + call _taskFailedCall; }; EPOCH_ActiveTraderMission = []; _EPOCH_TraderMissionArray = []; diff --git a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp index d836091b..b0f49b56 100644 --- a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp +++ b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp @@ -588,7 +588,7 @@ class BaseCam }; class ConnectUAV { - condition = "dyna_cursorTarget iskindof 'UAV_01_base_F' || dyna_cursorTarget iskindof 'UAV_06_base_F'"; + condition = "(dyna_cursorTarget iskindof 'UAV_01_base_F' || dyna_cursorTarget iskindof 'UAV_06_base_F') && alive dyna_cursorTarget"; action = "if ({_x in (assigneditems player)} count ['B_UavTerminal','O_UavTerminal','I_UavTerminal','C_UavTerminal'] > 0) then {dyna_cursorTarget spawn {_unit = _this;if (isnull (driver _unit)) then {_plyr = player;_grp = createGroup side _plyr;_driver = _grp createUnit[""I_UAV_AI"", position _unit, [], 0, ""CAN_COLLIDE""];_driver moveInAny _unit;uisleep 0.5;};player action [""SwitchToUAVDriver"", _unit];};}else {['You need an UAV-Terminal to connect',5] call epoch_message;};"; icon = "x\addons\a3_epoch_code\Data\UI\buttons\epoch_UAV.paa"; tooltip = "Connect to UAV"; diff --git a/Sources/epoch_config/Configs/CfgEpochClient.hpp b/Sources/epoch_config/Configs/CfgEpochClient.hpp index 76f5d81d..4210995f 100644 --- a/Sources/epoch_config/Configs/CfgEpochClient.hpp +++ b/Sources/epoch_config/Configs/CfgEpochClient.hpp @@ -66,7 +66,7 @@ class CfgEpochClient ActionBurnBarrelOffExtinguisher = "true"; // FireExtinguisher is needed to put off Burn Barrels ActionHookRope = "true"; // Rope is needed to hook vehicles (get back on release) - DefuseBombChance = 0.4; // Chance for successfully defuse a bomb -> If fail, the bomb will explode + DefuseBombChance = 0.6; // Chance for successfully defuse a bomb -> If fail, the bomb will explode DisableDoorInteractForACE = "true"; // If true, Door-Interactions from ACE-Mod will be blocked (no effect, if ACE is not running) epochMessageBackgroundCol[] = {0,0,0,0.2}; //Epoch_message background color (format: {R,G,B,A}) @@ -75,7 +75,7 @@ class CfgEpochClient EPOCH_news[] = {"Word is that Sappers have a new boss.","Dogs will often lure them monsters away.","My dog was blown up. I miss him.."}; deathMorphClass[] = {"Epoch_Sapper_F","Epoch_SapperG_F","Epoch_SapperB_F","I_UAV_01_F","Epoch_Cloak_F"}; //Random selection of these classes when player morphs after death. Currently available: Epoch_Cloak_F, Epoch_SapperB_F, Epoch_Sapper_F, I_UAV_01_F - niteLight[] = {0,1.88,22}; // 0 = disabled or 1 = enabled, Set ambient lighting at night: {Brightness of light,Height of light}. Default (Low Ambient): {1.88,22} | Twilight: {7.2,88} | Distant: {12.8,142} + niteLight[] = {1,1.88,22}; // 0 = disabled or 1 = enabled, Set ambient lighting at night: {Brightness of light,Height of light}. Default (Low Ambient): {1.88,22} | Twilight: {7.2,88} | Distant: {12.8,142} ryanZombiesEnabled = "true"; antagonistChances[] = { diff --git a/Sources/epoch_config/Configs/CfgMissions/CfgExample.hpp b/Sources/epoch_config/Configs/CfgMissions/CfgExample.hpp index de2448ef..4d517b40 100644 --- a/Sources/epoch_config/Configs/CfgMissions/CfgExample.hpp +++ b/Sources/epoch_config/Configs/CfgMissions/CfgExample.hpp @@ -59,6 +59,7 @@ class sampletask { abandonTime = 240; // Timeout for task failedCondition = "false"; // Failed Condition for Task faileddialogues[] = {"Text1","Text2"}; // Array of random dialogues when task failed + failedCall = ""; // Code to call when task failed completeCondition = "'B_UavTerminal' in assignedItems player"; // Condition to complete the task succesfully completedialogues[] = {"Text1","Text2"}; // Array of random dialogues when task completed successfully completedCALL = ""; // Code to call when task completed successfully diff --git a/Sources/epoch_config/Configs/CfgMissions/CfgmissionUav.hpp b/Sources/epoch_config/Configs/CfgMissions/CfgmissionUav.hpp index 5ac8d22b..a48e35ca 100644 --- a/Sources/epoch_config/Configs/CfgMissions/CfgmissionUav.hpp +++ b/Sources/epoch_config/Configs/CfgMissions/CfgmissionUav.hpp @@ -108,6 +108,7 @@ class doUAVSpawn{ abandonTime = 240; failedCondition = "!('B_UavTerminal' in assignedItems player) || !(alive player)"; faileddialogues[] = {"Lost it already.. Mission Over","Not a willing pilot eh ? Try again later.","Equipment Lost.. Mission Failed !"}; + failedCall = "player unassignItem 'B_UavTerminal'; player removeItem 'B_UavTerminal'"; completeCondition = "!(isNull axeUAV)"; completedialogues[] = {}; completedCALL = ""; @@ -138,6 +139,7 @@ class doUAVAttach{ abandonTime = 1200; failedCondition = "!('B_UavTerminal' in assignedItems player) || !(alive axeUAV) || !(alive player) || cameraon != axeUAV"; faileddialogues[] = {"Lost it already.. Mission Over","Not a natural pilot. Try again later.","Mission Failed !"}; + failedCall = "player unassignItem 'B_UavTerminal'; player removeItem 'B_UavTerminal'"; completeCondition = "(getPosATL axeUAV select 2) > 10"; completedialogues[] = {}; completedCALL = "if(SunOrMoon < 1)then{player action [""lightOn"", axeUAV];};"; @@ -178,6 +180,7 @@ class takeOffUAV{ abandonTime = 240; failedCondition = "!('B_UavTerminal' in assignedItems player) || !(alive axeUAV) || !(alive player) || cameraon != axeUAV"; faileddialogues[] = {"Oh dear, that didn't go well..","Try again later.","Misison Failed !"}; + failedCall = "player unassignItem 'B_UavTerminal'; player removeItem 'B_UavTerminal'"; completeCondition = "false"; completedialogues[] = {}; completedCALL = ""; @@ -197,7 +200,7 @@ class uavMission1{ markerRadius = 180; markerText = "Trader House Recon"; initcall = "_obj = selectRandom (nearestObjects [axeUAV,[""HOUSE""],2500]);EPOCH_taskMarkerPos = getPosATL _obj;"; - cleanUpCall = "[(driver axeUAV)] joinSilent grpNull; removeFromRemainsCollector [axeUAV]; deletevehicle axeUAV"; + cleanUpCall = "[(driver axeUAV)] joinSilent grpNull; removeFromRemainsCollector [axeUAV]; deletevehicle axeUAV;player unassignItem 'B_UavTerminal'; player removeItem 'B_UavTerminal'"; dialogues[] = { { "true", @@ -235,7 +238,7 @@ class uavMission2{ markerRadius = 220; markerText = "UAV Trader"; initcall = "_obj = selectRandom (Epoch_Traders select {player distance _x > 50 && alive _x && !((_x getvariable ['AI_SLOT',-1]) == -1)});EPOCH_taskMarkerPos = getPosATL _obj;"; - cleanUpCall = "[(driver axeUAV)] joinSilent grpNull; removeFromRemainsCollector [axeUAV]; deletevehicle axeUAV"; + cleanUpCall = "[(driver axeUAV)] joinSilent grpNull; removeFromRemainsCollector [axeUAV]; deletevehicle axeUAV;player unassignItem 'B_UavTerminal'; player removeItem 'B_UavTerminal'"; dialogues[] = { { "true", diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf index 516a7ae7..a111de49 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf @@ -30,7 +30,7 @@ if !(isNull _vehObj) then{ // add random damage to vehicle (avoid setting engine or fuel to 100% damage to prevent instant destruction) if (_spawnDamaged) then { { - _maxDamage = if (_x in ["HitEngine","HitFuel","HitHull"]) then {0.8} else {1}; + _maxDamage = if ((tolower _x) in ["hitengine","hitfuel","hithull","hitbody"]) then {0.8} else {1}; _vehObj setHitIndex [_forEachIndex,((random 1 max 0.1) min _maxDamage)]; } forEach ((getAllHitPointsDamage _vehObj) param [0,[]]); };