From 6ce4e19092d7499866892b0d574de0b2ca33882b Mon Sep 17 00:00:00 2001 From: Salbei Date: Tue, 14 May 2019 00:13:26 +0200 Subject: [PATCH 1/5] Can't test --- BC_buyables/factions/usa.hpp | 27 ++++++++++++++++++---- BC_setup/cfgFunctions.hpp | 5 ++-- BC_setup/functions/server/fn_fuelDrain.sqf | 8 +++++++ 3 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 BC_setup/functions/server/fn_fuelDrain.sqf diff --git a/BC_buyables/factions/usa.hpp b/BC_buyables/factions/usa.hpp index c31b6c71..320f840a 100644 --- a/BC_buyables/factions/usa.hpp +++ b/BC_buyables/factions/usa.hpp @@ -69,7 +69,7 @@ class USA { description = "1 GPS\nNO Thermals\nNO Benches"; price = 10; stock = 2; - code = "(_this select 0) addItemCargoGlobal ['ACE_NVG_Wide',2];(_this select 0) addItemCargoGlobal ['ItemGPS',1];(_this select 0) disableTIEquipment true;"; + code = "(_this select 0) addItemCargoGlobal ['ACE_NVG_Wide',2];(_this select 0) addItemCargoGlobal ['ItemGPS',1];(_this select 0) disableTIEquipment true;BC_helos pushBack (_this select 0);"; spawnEmpty = 1; vehicleInit = "[[],[]]"; }; @@ -106,10 +106,27 @@ class USA { condition = "!BC_IS_WOODLAND"; vehicleInit = "[['rhs_desert',1],['hide_spare',0]]"; }; - - }; + class rhsusf_M978A4_usarmy_wd{ + displayName = "HEMMTT FUEL"; + description = "Fuel Truck."; + stock = 1; + spawnEmpty = 1; + wheelCargo = 3; + condition = "BC_IS_WOODLAND"; + vehicleInit = "[['rhs_woodland',1],['hide_spare',0]]"; + code = "(_this select 0) setVariable ['ace_rearm_isSupplyVehicle', false, true]; (_this select 0) setVariable ['ACE_isRepairVehicle', false, true];"; + }; + class rhsusf_M978A4_usarmy_d: rhsusf_M978A4_usarmy_wd { + condition = "!BC_IS_WOODLAND"; + vehicleInit = "[['rhs_desert',1],['hide_spare',0]]"; + }; + + + + + }; class Support { displayName = "Support"; @@ -174,7 +191,7 @@ class USA { displayName = "UH-60M"; description = "1 GPS\nFRIES equipped"; stock = 7; - code = "(_this select 0) addItemCargoGlobal ['ACE_NVG_Wide',2];(_this select 0) addItemCargoGlobal ['ItemGPS',1];[(_this select 0)] call ace_fastroping_fnc_equipFRIES;"; + code = "(_this select 0) addItemCargoGlobal ['ACE_NVG_Wide',2];(_this select 0) addItemCargoGlobal ['ItemGPS',1];[(_this select 0)] call ace_fastroping_fnc_equipFRIES;BC_helos pushBack (_this select 0);"; spawnEmpty = 1; vehicleInit = "[[],[]]"; }; @@ -212,4 +229,4 @@ class USA { spawnEmpty = 1; }; }; -}; \ No newline at end of file +}; diff --git a/BC_setup/cfgFunctions.hpp b/BC_setup/cfgFunctions.hpp index 1a93b549..58fa623a 100644 --- a/BC_setup/cfgFunctions.hpp +++ b/BC_setup/cfgFunctions.hpp @@ -13,7 +13,7 @@ class BC_setup { class isOnWater; class openSpawnDialog; class teleportPlayer; - class TFARsettings { preInit = 1; }; + class TFARsettings { preInit = 1; }; }; class server { @@ -21,11 +21,12 @@ class BC_setup { class defineWoodland { preInit = 1; }; class findRandomPos; + class fuelDrain; class getHighestRankOfSide; class getIslandCfgEntry { preInit = 1; }; class initialSpawnServer; class registerDynamicGroup; class showLeaderInformation; - class teleportAI; + class teleportAI; }; }; diff --git a/BC_setup/functions/server/fn_fuelDrain.sqf b/BC_setup/functions/server/fn_fuelDrain.sqf new file mode 100644 index 00000000..b41c6405 --- /dev/null +++ b/BC_setup/functions/server/fn_fuelDrain.sqf @@ -0,0 +1,8 @@ +[{ + { + private _fuel = fuel _x; + if (_fuel > 0 && (((getPosATL _x) select 2) > 1) && isEngineOn _x) then { + _x setFuel (_fuel -0.001); + }; + }forEach BC_helos; +},1,[]] call CBA_fnc_addPerFrameHandler; From f21e9307f9cf22f9a67225b12020ba7a0d5bf382 Mon Sep 17 00:00:00 2001 From: Salbei Date: Wed, 22 May 2019 07:55:10 +0200 Subject: [PATCH 2/5] added automatic refuel disable --- BC_setup/cfgFunctions.hpp | 3 ++- .../server/fn_removeFuelStations.sqf | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 BC_setup/functions/server/fn_removeFuelStations.sqf diff --git a/BC_setup/cfgFunctions.hpp b/BC_setup/cfgFunctions.hpp index 58fa623a..82514c0a 100644 --- a/BC_setup/cfgFunctions.hpp +++ b/BC_setup/cfgFunctions.hpp @@ -21,11 +21,12 @@ class BC_setup { class defineWoodland { preInit = 1; }; class findRandomPos; - class fuelDrain; + class fuelDrain; class getHighestRankOfSide; class getIslandCfgEntry { preInit = 1; }; class initialSpawnServer; class registerDynamicGroup; + class removeFuelStations { postInit = 1; }; class showLeaderInformation; class teleportAI; }; diff --git a/BC_setup/functions/server/fn_removeFuelStations.sqf b/BC_setup/functions/server/fn_removeFuelStations.sqf new file mode 100644 index 00000000..66e4d582 --- /dev/null +++ b/BC_setup/functions/server/fn_removeFuelStations.sqf @@ -0,0 +1,19 @@ +if !(isServer) exitWith {}; + +private _pumps = nearestObjects [ + [(worldSize/2), (worldSize/2), 0], + [ + "Land_fs_feed_F", // Gas Station Pump (Altis) + "Land_FuelStation_01_pump_F", // Tanoa + "Land_FuelStation_02_pump_F" + "Land_FuelStation_Feed_F", // Stratis/Esseker + "Land_A_FuelStation_Shed", // Esseker/Chernarus + "Land_A_FuelStation_Feed" // Chernarus + ], + worldSize, + true +]; + +{ + _x setFuelCargo 0; +}forEach _pumps; From 567033ea61e3e5312405486a9eb27570d921a17e Mon Sep 17 00:00:00 2001 From: Salbei Date: Fri, 24 May 2019 23:00:11 +0200 Subject: [PATCH 3/5] Auto stash before merge of "fuelDrainForHeli" and "origin/fuelDrainForHeli" --- BC_buyables/factions/usa.hpp | 4 ---- BC_buyables/params.hpp | 6 +++--- BC_setup/cfgFunctions.hpp | 2 +- description.ext | 22 ++++++++++------------ initserver.sqf | 2 ++ mission.sqm | 8 ++++---- 6 files changed, 20 insertions(+), 24 deletions(-) diff --git a/BC_buyables/factions/usa.hpp b/BC_buyables/factions/usa.hpp index 320f840a..42ed5b48 100644 --- a/BC_buyables/factions/usa.hpp +++ b/BC_buyables/factions/usa.hpp @@ -122,10 +122,6 @@ class USA { condition = "!BC_IS_WOODLAND"; vehicleInit = "[['rhs_desert',1],['hide_spare',0]]"; }; - - - - }; class Support { diff --git a/BC_buyables/params.hpp b/BC_buyables/params.hpp index a7f3df33..b619be04 100644 --- a/BC_buyables/params.hpp +++ b/BC_buyables/params.hpp @@ -3,7 +3,7 @@ class BUYABLES_BLUFOR title = "Blufor"; values[] = {0, 1, 2}; texts[] = {"bwGM", "USA", "USATanks"}; - default = 0; + default = 1; }; class BUYABLES_OPFOR @@ -11,5 +11,5 @@ class BUYABLES_OPFOR title = "Opfor"; values[] = {0, 1, 2}; texts[] = {"nvaGM", "Russia", "RussiaTanks"}; - default = 0; -}; \ No newline at end of file + default = 1; +}; diff --git a/BC_setup/cfgFunctions.hpp b/BC_setup/cfgFunctions.hpp index 82514c0a..cf79aed6 100644 --- a/BC_setup/cfgFunctions.hpp +++ b/BC_setup/cfgFunctions.hpp @@ -21,7 +21,7 @@ class BC_setup { class defineWoodland { preInit = 1; }; class findRandomPos; - class fuelDrain; + class fuelDrain { postInit = 1; }; class getHighestRankOfSide; class getIslandCfgEntry { preInit = 1; }; class initialSpawnServer; diff --git a/description.ext b/description.ext index eeaa17a0..72825ef3 100644 --- a/description.ext +++ b/description.ext @@ -3,7 +3,6 @@ // ISLAND CONFIGS #include "cfgIslands.hpp" - #include "node_modules\grad-fortifications\grad_fortifications.hpp" #include "node_modules\@gruppe-adler\replay\ui\defines.hpp" #include "node_modules\@gruppe-adler\replay\ui\dialog.hpp" @@ -13,10 +12,10 @@ #include "BC_buymenu\dialog\baseRsc.hpp" #include "node_modules\grad-listBuymenu\grad_listBuymenu.hpp" -class CfgFunctions { +class CfgFunctions { #include "BC_buymenu\cfgFunctions.hpp" #include "BC_loadouts\cfgFunctions.hpp" - + #include "grad_carryBoat\cfgFunctions.hpp" #include "grad_islands\cfgFunctions.hpp" #include "grad_civMarker\cfgFunctions.hpp" @@ -30,7 +29,6 @@ class CfgFunctions { #include "node_modules\grad-loadout\cfgFunctions.hpp" #include "node_modules\grad-fortifications\cfgFunctions.hpp" - }; class RscTitles { @@ -208,18 +206,18 @@ class Params default = 0; }; - class ace_map_BFT_Enabled { + class ace_map_BFT_Enabled { title = "Bluforce-Tracking active"; ACE_setting = 1; values[] = {0, 1}; texts[] = {"False", "True"}; - default = 1; + default = 1; }; - class PREPARATION_TIME { - title = "Preparation time"; - values[] = {0,60,120,180,240,300,480,600,900}; - texts[] = {"off","1min","2min","3min","4min","5min","8min","10min","15min"}; - default = 300; + class PREPARATION_TIME { + title = "Preparation time"; + values[] = {0,60,120,180,240,300,480,600,900}; + texts[] = {"off","1min","2min","3min","4min","5min","8min","10min","15min"}; + default = 300; }; }; @@ -311,7 +309,7 @@ class CfgSounds { #include "grad_carryBoat\cfgSounds.hpp" #include "BC_buymenu\cfgSounds.hpp" - + class beam { name = "beam"; diff --git a/initserver.sqf b/initserver.sqf index a2e4b493..172031e3 100644 --- a/initserver.sqf +++ b/initserver.sqf @@ -1,6 +1,8 @@ #include "\z\ace\addons\main\script_component.hpp" #include "\z\ace\addons\main\script_macros.hpp" +bc_helos = []; + call compile preprocessfile "node_modules\shk_pos\functions\shk_pos_init.sqf"; // absolute basic! [] call BC_setup_fnc_initialSpawnServer; diff --git a/mission.sqm b/mission.sqm index ef67fb3f..0199e2b4 100644 --- a/mission.sqm +++ b/mission.sqm @@ -16,10 +16,10 @@ class EditorData }; class Camera { - pos[]={1574.1765,13.194629,5206.876}; - dir[]={0.86957532,-0.47109181,-0.14889812}; - up[]={0.4644171,0.88202244,-0.07951919}; - aside[]={-0.16880248,-2.3601169e-006,-0.98577642}; + pos[]={1515.5316,138.04147,5505.4727}; + dir[]={0.83931631,-0.44936278,0.30640367}; + up[]={0.42219803,0.89328778,0.1541326}; + aside[]={0.34296319,-2.7501337e-006,-0.93948358}; }; }; binarizationWanted=0; From c3b44f7d21a0c31cb17c6b9b6af83ee451735401 Mon Sep 17 00:00:00 2001 From: Salbei Date: Fri, 24 May 2019 23:07:03 +0200 Subject: [PATCH 4/5] changed slot --- BC_buyables/factions/usa.hpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/BC_buyables/factions/usa.hpp b/BC_buyables/factions/usa.hpp index 42ed5b48..0d635018 100644 --- a/BC_buyables/factions/usa.hpp +++ b/BC_buyables/factions/usa.hpp @@ -54,6 +54,22 @@ class USA { condition = "true"; code = "[(_this select 0), [['mud','mud_olive'] select BC_IS_WOODLAND,1], ['tailgateHide',0,'tailgate_open',0,'cage_fold',0]] call BIS_fnc_initVehicle;"; vehicleInit = "[[],[]]"; + }; + + class rhsusf_M978A4_usarmy_wd{ + displayName = "HEMMTT FUEL"; + description = "Fuel Truck."; + stock = 1; + spawnEmpty = 1; + wheelCargo = 3; + condition = "BC_IS_WOODLAND"; + vehicleInit = "[['rhs_woodland',1],['hide_spare',0]]"; + code = "(_this select 0) setVariable ['ace_rearm_isSupplyVehicle', false, true]; (_this select 0) setVariable ['ACE_isRepairVehicle', false, true];"; + }; + + class rhsusf_M978A4_usarmy_d: rhsusf_M978A4_usarmy_wd { + condition = "!BC_IS_WOODLAND"; + vehicleInit = "[['rhs_desert',1],['hide_spare',0]]"; }; }; @@ -106,22 +122,6 @@ class USA { condition = "!BC_IS_WOODLAND"; vehicleInit = "[['rhs_desert',1],['hide_spare',0]]"; }; - - class rhsusf_M978A4_usarmy_wd{ - displayName = "HEMMTT FUEL"; - description = "Fuel Truck."; - stock = 1; - spawnEmpty = 1; - wheelCargo = 3; - condition = "BC_IS_WOODLAND"; - vehicleInit = "[['rhs_woodland',1],['hide_spare',0]]"; - code = "(_this select 0) setVariable ['ace_rearm_isSupplyVehicle', false, true]; (_this select 0) setVariable ['ACE_isRepairVehicle', false, true];"; - }; - - class rhsusf_M978A4_usarmy_d: rhsusf_M978A4_usarmy_wd { - condition = "!BC_IS_WOODLAND"; - vehicleInit = "[['rhs_desert',1],['hide_spare',0]]"; - }; }; class Support { From 95e11d01347ea859baa5f609ae9e888060bda4a1 Mon Sep 17 00:00:00 2001 From: nomisum Date: Sun, 26 May 2019 21:58:36 +0200 Subject: [PATCH 5/5] fixing + refactoring fueldrain --- BC_buyables/factions/usa.hpp | 4 ++-- BC_setup/cfgFunctions.hpp | 2 +- BC_setup/functions/server/fn_fuelDrain.sqf | 22 +++++++++++++------ .../server/fn_removeFuelStations.sqf | 7 +++--- initserver.sqf | 2 -- mission.sqm | 6 ++--- 6 files changed, 25 insertions(+), 18 deletions(-) diff --git a/BC_buyables/factions/usa.hpp b/BC_buyables/factions/usa.hpp index 0d635018..8d58814b 100644 --- a/BC_buyables/factions/usa.hpp +++ b/BC_buyables/factions/usa.hpp @@ -85,7 +85,7 @@ class USA { description = "1 GPS\nNO Thermals\nNO Benches"; price = 10; stock = 2; - code = "(_this select 0) addItemCargoGlobal ['ACE_NVG_Wide',2];(_this select 0) addItemCargoGlobal ['ItemGPS',1];(_this select 0) disableTIEquipment true;BC_helos pushBack (_this select 0);"; + code = "(_this select 0) addItemCargoGlobal ['ACE_NVG_Wide',2];(_this select 0) addItemCargoGlobal ['ItemGPS',1];(_this select 0) disableTIEquipment true; [(_this select 0)] call BC_setup_fnc_fuelDrain;"; spawnEmpty = 1; vehicleInit = "[[],[]]"; }; @@ -187,7 +187,7 @@ class USA { displayName = "UH-60M"; description = "1 GPS\nFRIES equipped"; stock = 7; - code = "(_this select 0) addItemCargoGlobal ['ACE_NVG_Wide',2];(_this select 0) addItemCargoGlobal ['ItemGPS',1];[(_this select 0)] call ace_fastroping_fnc_equipFRIES;BC_helos pushBack (_this select 0);"; + code = "(_this select 0) addItemCargoGlobal ['ACE_NVG_Wide',2];(_this select 0) addItemCargoGlobal ['ItemGPS',1];[(_this select 0)] call ace_fastroping_fnc_equipFRIES;[(_this select 0)] call BC_setup_fnc_fuelDrain;"; spawnEmpty = 1; vehicleInit = "[[],[]]"; }; diff --git a/BC_setup/cfgFunctions.hpp b/BC_setup/cfgFunctions.hpp index cf79aed6..8e0faf03 100644 --- a/BC_setup/cfgFunctions.hpp +++ b/BC_setup/cfgFunctions.hpp @@ -21,7 +21,7 @@ class BC_setup { class defineWoodland { preInit = 1; }; class findRandomPos; - class fuelDrain { postInit = 1; }; + class fuelDrain; class getHighestRankOfSide; class getIslandCfgEntry { preInit = 1; }; class initialSpawnServer; diff --git a/BC_setup/functions/server/fn_fuelDrain.sqf b/BC_setup/functions/server/fn_fuelDrain.sqf index b41c6405..79030a0d 100644 --- a/BC_setup/functions/server/fn_fuelDrain.sqf +++ b/BC_setup/functions/server/fn_fuelDrain.sqf @@ -1,8 +1,16 @@ +params ["_heli"]; + +diag_log format ["fuelDrain %1", _heli]; + [{ - { - private _fuel = fuel _x; - if (_fuel > 0 && (((getPosATL _x) select 2) > 1) && isEngineOn _x) then { - _x setFuel (_fuel -0.001); - }; - }forEach BC_helos; -},1,[]] call CBA_fnc_addPerFrameHandler; + params ["_args", "_handle"]; + _args params ["_heli"]; + + if (!alive _heli) exitWith { [_handle] call CBA_fnc_removePerFrameHandler; }; + + private _fuel = fuel _heli; + if (_fuel > 0 && isEngineOn _heli) then { + _heli setFuel (_fuel -0.001); + }; + +},1,[_heli]] call CBA_fnc_addPerFrameHandler; \ No newline at end of file diff --git a/BC_setup/functions/server/fn_removeFuelStations.sqf b/BC_setup/functions/server/fn_removeFuelStations.sqf index 66e4d582..b5e3e4b6 100644 --- a/BC_setup/functions/server/fn_removeFuelStations.sqf +++ b/BC_setup/functions/server/fn_removeFuelStations.sqf @@ -5,7 +5,7 @@ private _pumps = nearestObjects [ [ "Land_fs_feed_F", // Gas Station Pump (Altis) "Land_FuelStation_01_pump_F", // Tanoa - "Land_FuelStation_02_pump_F" + "Land_FuelStation_02_pump_F", "Land_FuelStation_Feed_F", // Stratis/Esseker "Land_A_FuelStation_Shed", // Esseker/Chernarus "Land_A_FuelStation_Feed" // Chernarus @@ -15,5 +15,6 @@ private _pumps = nearestObjects [ ]; { - _x setFuelCargo 0; -}forEach _pumps; + _x setFuelCargo 0; // necessary? + [_x, 0] call ace_refuel_fnc_setFuel; +}forEach _pumps; \ No newline at end of file diff --git a/initserver.sqf b/initserver.sqf index 172031e3..a2e4b493 100644 --- a/initserver.sqf +++ b/initserver.sqf @@ -1,8 +1,6 @@ #include "\z\ace\addons\main\script_component.hpp" #include "\z\ace\addons\main\script_macros.hpp" -bc_helos = []; - call compile preprocessfile "node_modules\shk_pos\functions\shk_pos_init.sqf"; // absolute basic! [] call BC_setup_fnc_initialSpawnServer; diff --git a/mission.sqm b/mission.sqm index 0199e2b4..8bebef43 100644 --- a/mission.sqm +++ b/mission.sqm @@ -17,9 +17,9 @@ class EditorData class Camera { pos[]={1515.5316,138.04147,5505.4727}; - dir[]={0.83931631,-0.44936278,0.30640367}; - up[]={0.42219803,0.89328778,0.1541326}; - aside[]={0.34296319,-2.7501337e-006,-0.93948358}; + dir[]={0.7568146,-0.56710517,0.3253994}; + up[]={0.52104467,0.82358593,0.22403164}; + aside[]={0.39503929,-1.7117709e-006,-0.91880232}; }; }; binarizationWanted=0;