diff --git a/addons/trenches/Cfg3DEN.hpp b/addons/trenches/Cfg3DEN.hpp new file mode 100644 index 00000000000..963666e3d18 --- /dev/null +++ b/addons/trenches/Cfg3DEN.hpp @@ -0,0 +1,8 @@ +class Cfg3DEN { + class EventHandlers { + class ADDON { + onMissionPreviewEnd = QUOTE([] spawn {waitUntil {!isNil QQFUNC(initTrench3DEN)}; call FUNC(initTrench3DEN)}); // Don't ask me why but this function is nil when this event triggers + onMissionLoad = QUOTE([] spawn {waitUntil {!isNil QQFUNC(initTrench3DEN)}; call FUNC(initTrench3DEN)}); // Don't ask me why but this function is nil when this event triggers + }; + }; +}; diff --git a/addons/trenches/CfgEventHandlers.hpp b/addons/trenches/CfgEventHandlers.hpp index 5b2eb3a0533..78ba6cc9869 100644 --- a/addons/trenches/CfgEventHandlers.hpp +++ b/addons/trenches/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preStart)); @@ -30,3 +29,36 @@ class Extended_DisplayLoad_EventHandlers { ADDON = QUOTE(_this call COMPILE_FILE(XEH_missionDisplayLoad)); }; }; + +class Extended_Deleted_EventHandlers { + class ACE_envelope_small { + class ADDON { + deleted = QUOTE(if (isServer) then {_this call FUNC(deleteCamouflage)}); + }; + }; + class ACE_envelope_big: ACE_envelope_small {}; + class ACE_envelope_gigant: ACE_envelope_small {}; + class ACE_envelope_vehicle: ACE_envelope_small {}; + class ACE_envelope_short: ACE_envelope_small {}; +}; + +class Extended_Init_EventHandlers { + class ACE_envelope_small { + class ADDON { + init = QUOTE(_this call FUNC(initTrench)); + }; + }; + + class ACE_envelope_big: ACE_envelope_small {}; + class ACE_envelope_gigant: ACE_envelope_small {}; + class ACE_envelope_vehicle: ACE_envelope_small {}; + class ACE_envelope_short: ACE_envelope_small {}; +}; + +class Extended_InitPost_EventHandlers { + class ModuleCurator_F { + class ADDON { + init = QUOTE(_this call FUNC(initCurator)); + }; + }; +}; diff --git a/addons/trenches/CfgVehicles.hpp b/addons/trenches/CfgVehicles.hpp index 3b13be21a84..ed1ea08d794 100644 --- a/addons/trenches/CfgVehicles.hpp +++ b/addons/trenches/CfgVehicles.hpp @@ -1,46 +1,50 @@ class CBA_Extended_EventHandlers; -#define ACE_TRENCHES_ACTIONS class ACE_Actions { \ - class ACE_MainActions { \ - displayName = ECSTRING(interaction,MainAction); \ - selection = ""; \ - distance = 3; \ - condition = QUOTE(true); \ - class ACE_ContinueDiggingTrench { \ - displayName = CSTRING(ContinueDiggingTrench); \ - condition = QUOTE([ARR_2(_target,_player)] call FUNC(canContinueDiggingTrench)); \ - statement = QUOTE([ARR_2(_target,_player)] call FUNC(continueDiggingTrench);); \ - }; \ - class ACE_RemoveTrench { \ - displayName = CSTRING(RemoveEnvelope); \ - condition = QUOTE([ARR_2(_target,_player)] call FUNC(canRemoveTrench)); \ - statement = QUOTE([ARR_2(_target,_player)] call FUNC(removeTrench);); \ - }; \ - }; \ - } - class CfgVehicles { class Man; class CAManBase: Man { class ACE_SelfActions { class ACE_Equipment { - class GVAR(digEnvelopeSmall) { - displayName = CSTRING(DigEnvelopeSmall); - condition = QUOTE(_player call FUNC(canDigTrench)); - //wait a frame to handle "Do When releasing action menu key" option - statement = QUOTE([ARR_2({_this call FUNC(placeTrench)},[ARR_2(_this select 0,'ACE_envelope_small')])] call CBA_fnc_execNextFrame); - exceptions[] = {}; - showDisabled = 0; - //icon = QPATHTOF(UI\icon_sandbag_ca.paa); - }; - class GVAR(digEnvelopeBig) { - displayName = CSTRING(DigEnvelopeBig); - condition = QUOTE(_player call FUNC(canDigTrench)); - //wait a frame to handle "Do When releasing action menu key" option - statement = QUOTE([ARR_2({_this call FUNC(placeTrench)},[ARR_2(_this select 0,'ACE_envelope_big')])] call CBA_fnc_execNextFrame); - exceptions[] = {}; + class ACE_Trenches { + displayName = CSTRING(ActionCategory); + condition = QUOTE(_player call FUNC(canDigTrench) && GVAR(allowDigging)); + statement = ""; showDisabled = 0; - //icon = QPATHTOF(UI\icon_sandbag_ca.paa); + priority = 3; + // icon = "z\ace\addons\trenches\UI\w_entrchtool_ca.paa"; + exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"}; + class GVAR(digEnvelopeShort) { + displayName = CSTRING(DigEnvelopeShort); + condition = QUOTE(GVAR(allowDigging) && ([ARR_2(_target,_player)] call FUNC(canContinueDiggingTrench)) && GVAR(allowShortEnvelope)); + //wait a frame to handle "Do When releasing action menu key" option + statement = QUOTE([ARR_2({_this call FUNC(placeTrench)},[ARR_2(_this select 0,'ACE_envelope_short')])] call CBA_fnc_execNextFrame); + exceptions[] = {}; + showDisabled = 0; + priority = 4; + //icon = QPATHTOF(UI\icon_sandbag_ca.paa); + }; + class GVAR(digEnvelopeSmall): GVAR(digEnvelopeShort) { + displayName = CSTRING(DigEnvelopeSmall); + condition = QUOTE(GVAR(allowDigging) && ([ARR_2(_target,_player)] call FUNC(canContinueDiggingTrench)) && GVAR(allowSmallEnvelope)); + //wait a frame to handle "Do When releasing action menu key" option + statement = QUOTE([ARR_2({_this call FUNC(placeTrench)},[ARR_2(_this select 0,'ACE_envelope_small')])] call CBA_fnc_execNextFrame); + }; + class GVAR(digEnvelopeBig): GVAR(digEnvelopeShort) { + displayName = CSTRING(DigEnvelopeBig); + condition = QUOTE(GVAR(allowDigging) && ([ARR_2(_target,_player)] call FUNC(canContinueDiggingTrench)) && GVAR(allowBigEnvelope)); + //wait a frame to handle "Do When releasing action menu key" option + statement = QUOTE([ARR_2({_this call FUNC(placeTrench)},[ARR_2(_this select 0,'ACE_envelope_big')])] call CBA_fnc_execNextFrame); + }; + class GVAR(DigEnvelopeGigant): GVAR(digEnvelopeShort) { + displayName = CSTRING(DigEnvelopeGigant); + condition = QUOTE(_player call FUNC(canDigTrench) && ([ARR_2(_target,_player)] call FUNC(canContinueDiggingTrench)) && GVAR(allowGigantEnvelope)); + statement = QUOTE([ARR_2({_this call FUNC(placeTrench)},[ARR_2(_this select 0,'ACE_envelope_gigant')])] call CBA_fnc_execNextFrame); + }; + class GVAR(DigEnvelopeVehicle): GVAR(digEnvelopeShort) { + displayName = CSTRING(DigEnvelopeVehicle); + condition = QUOTE(_player call FUNC(canDigTrench) && ([ARR_2(_target,_player)] call FUNC(canContinueDiggingTrench)) && GVAR(allowVehicleEnvelope)); + statement = QUOTE([ARR_2({_this call FUNC(placeTrench)},[ARR_2(_this select 0,'ACE_envelope_vehicle')])] call CBA_fnc_execNextFrame); + }; }; }; }; @@ -51,44 +55,136 @@ class CfgVehicles { author = ECSTRING(common,ACETeam); displayName = CSTRING(EnvelopeSmallName); descriptionShort = CSTRING(EnevlopeSmallDescription); - model = QPATHTOEF(apl,ace_envelope_small4.p3d); + model = QPATHTOF(data\trench_small.p3d); scope = 2; - GVAR(diggingDuration) = 20; - GVAR(removalDuration) = 12; - GVAR(noGeoClass) = "ACE_envelope_small_NoGeo"; + scopeCurator = 2; + GVAR(diggingDuration) = QGVAR(smallEnvelopeDigTime); + GVAR(removalDuration) = QGVAR(smallEnvelopeRemovalTime); GVAR(placementData)[] = {2,3,0.35}; GVAR(grassCuttingPoints)[] = {{0,-0.5,0}}; - ACE_TRENCHES_ACTIONS; + + editorCategory = "EdCat_Things"; + editorSubcategory = "EdSubcat_Military"; + hiddenSelections[] = {"velka"}; + + class GVAR(camouflagePositions) { + center[] = {0, 1.3, 0}; + left[] = {1.3, -0.8, 0.4}; + right[] = {-1.3,-0.8,0.4}; + }; + + class ACE_Actions { + class ACE_MainActions { + displayName = ECSTRING(interaction,MainAction); + selection = ""; + distance = 3; + condition = QUOTE(true); + class GVAR(continueDigging) { + displayName = CSTRING(continueDiggingTrench); + condition = QUOTE([ARR_2(_target,_player)] call FUNC(canContinueDiggingTrench)); + statement = QUOTE([ARR_2(_target,_player)] call FUNC(continueDiggingTrench);); + priority = -1; + }; + class GVAR(helpDigging) { + displayName = CSTRING(HelpDigging); \ + condition = QUOTE([ARR_2(_target,_player)] call FUNC(canHelpDiggingTrench)); + statement = QUOTE([ARR_2(_target,_player)] call FUNC(addDigger)); + priority = -1; + }; + class GVAR(remove) { + displayName = CSTRING(removeEnvelope); + condition = QUOTE([ARR_2(_target,_player)] call FUNC(canRemoveTrench)); + statement = QUOTE([ARR_2(_target,_player)] call FUNC(removeTrench);); + priority = -1; + }; + class GVAR(placeCamouflage) { + displayName = CSTRING(placeCamouflage); + condition = QUOTE([ARR_2(_target,_player)] call FUNC(canPlaceCamouflage)); + statement = QUOTE([ARR_2(_target,_player)] call FUNC(placeCamouflage)); + priority = -1; + }; + class GVAR(removeCamouflage) { + displayName = CSTRING(removeCamouflage); + condition = QUOTE([_target] call FUNC(canRemoveCamouflage)); + statement = QUOTE([ARR_2(_target,_player)] call FUNC(removeCamouflage)); + priority = -1; + }; + }; + }; + + class Attributes { + class GVAR(camouflageAttribute) { + control = "CheckboxNumber"; + defaultValue = "0"; + displayName = CSTRING(CamouflageAttribute); + tooltip = CSTRING(CamouflageAttributeTooltip); + expression = QUOTE([ARR_2(_this,_value)] call FUNC(applyCamouflageAttribute)); + property = CAMOUFLAGE_3DEN_ATTRIBUTE; + }; + }; + class EventHandlers { class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; }; }; - class ACE_envelope_big: BagFence_base_F { - author = ECSTRING(common,ACETeam); + class ACE_envelope_big: ACE_envelope_small { displayName = CSTRING(EnvelopeBigName); descriptionShort = CSTRING(EnevlopeBigDescription); - model = QPATHTOEF(apl,ace_envelope_big4.p3d); - scope = 2; - GVAR(diggingDuration) = 25; - GVAR(removalDuration) = 15; - GVAR(noGeoClass) = "ACE_envelope_big_NoGeo"; + model = QPATHTOF(data\trench_big.p3d); + GVAR(diggingDuration) = QGVAR(bigEnvelopeDigTime); + GVAR(removalDuration) = QGVAR(bigEnvelopeRemovalTime); GVAR(placementData)[] = {6,1.1,0.20}; GVAR(grassCuttingPoints)[] = {{-1.5,-1,0},{1.5,-1,0}}; - ACE_TRENCHES_ACTIONS; - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; + + class GVAR(camouflagePositions) { + center[] = {-0.4, 0.4, 0.2}; + left[] = {-1.75, 0.2, 0.2}; + right[] = {1.75, 0.2, 0.2}; }; }; + class ACE_envelope_gigant: ACE_envelope_small { + displayName = CSTRING(EnvelopeGigantName); + descriptionShort = CSTRING(EnevlopeGigantDescription); + GVAR(diggingDuration) = QGVAR(gigantEnvelopeDigTime); + GVAR(removalDuration) = QGVAR(gigantEnvelopeRemovalTime); + GVAR(placementData)[] = {15,1.1,0.40}; + GVAR(grassCuttingPoints)[] = {{-1.5,-1,0},{1.5,-1,0}}; + model = QPATHTOF(data\trench_gigant.p3d); - class ACE_envelope_small_NoGeo: ACE_envelope_small { - scope = 1; - //@todo: replace by a no geo model - model = QPATHTOEF(apl,ace_envelope_small4_nogeo.p3d); + class GVAR(camouflagePositions) { + left1[] = {-0.5, 0.3, 0.5}; + left2[] = {-2.7, 0.3, 0.5}; + right1[] = {2.7, 0.15, 0.35}; + right2[] = {4.9, -0.5, -0.15}; + }; }; - class ACE_envelope_big_NoGeo: ACE_envelope_big { - scope = 1; - //@todo: replace by a no geo model - model = QPATHTOEF(apl,ace_envelope_big4_nogeo.p3d); + class ACE_envelope_vehicle: ACE_envelope_small { + displayName = CSTRING(EnvelopeVehicleName); + descriptionShort = CSTRING(EnevlopeVehicleDescription); + GVAR(diggingDuration) = QGVAR(vehicleEnvelopeDigTime); + GVAR(removalDuration) = QGVAR(vehicleEnvelopeRemovalTime); + GVAR(placementData)[] = {6,1.1,0.20}; + GVAR(grassCuttingPoints)[] = {{-1.5,-1,0},{1.5,-1,0}}; + model = QPATHTOF(data\trench_vehicle.p3d); + + class GVAR(camouflagePositions) {}; + class Attributes {}; + }; + + class ACE_envelope_short: ACE_envelope_small { + displayName = CSTRING(EnvelopeshortName); + descriptionShort = CSTRING(EnevlopeshortDescription); + GVAR(diggingDuration) = QGVAR(shortEnvelopeDigTime); + GVAR(removalDuration) = QGVAR(shortEnvelopeRemovalTime); + GVAR(placementData)[] = {6,1.1,0.20}; + GVAR(grassCuttingPoints)[] = {{-1.5,-1,0},{1.5,-1,0}}; + model = QPATHTOF(data\trench_short.p3d); + + class GVAR(camouflagePositions) { + right[] = {1.1,0.2,0.2}; + left[] = {-1.1,0.1,0.2}; + }; + class Attributes {}; }; class Box_NATO_Support_F; diff --git a/addons/trenches/CfgWorlds.hpp b/addons/trenches/CfgWorlds.hpp new file mode 100644 index 00000000000..7ff5e68c708 --- /dev/null +++ b/addons/trenches/CfgWorlds.hpp @@ -0,0 +1,368 @@ +class CfgWorlds { + class Default { + surfaceTextureBasePath = "a3\map_data\"; + filePrefix = "co.paa"; + }; + + //Altis + class Altis: Default { + camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Brown.p3d" /*, "A3\plants_f\Clutter\c_Thistle_Thorn_Green.p3d"*/}; + }; + + //Baranow + class Baranow { + surfaceTextureBasePath = "WW2\TerrainsIF_t\Worlds\IF_Surfaces_t\staszow\"; + filePrefix = "co.paa"; + camouflageObjects[] = {}; + class Surfaces { + class lib_sf_france_raps { + texturePath = "WW2\TerrainsIF_t\Worlds\IF_Surfaces_t\France\lib_sf_france_raps_co.paa"; + }; + }; + }; + //Baranow Winter + class BaranowWinter { + surfaceTextureBasePath = "WW2\TerrainsIF_t\Worlds\IF_SurfacesWinter_t\Baranow\"; + filePrefix = "co.paa"; + camouflageObjects[] = {}; + }; + + //Bray-Dunes + class SWU_Dunkirk_Bray_Dunes_1940: Baranow { + surfaceTextureBasePath = "WW2\TerrainsWW2_swurvin\Surfaces_t\"; + filePrefix = "_co.paa"; + camouflageObjects[] = {}; + class Surfaces { + class Default { + texturePath = "a3\map_data\gdt_beach_co.paa"; + }; + }; + }; + + // Bukovina + class Bootcamp_ACR { + surfaceTextureBasePath = "ca\Bootcamp_ACR\data\"; + filePrefix = "detail_co.paa"; + camouflageObjects[] = {"ca\plants2\clutter\c_GrassBunch.p3d"}; + }; + + // Bystrica + class Woodland_ACR { + surfaceTextureBasePath = "ca\Bohemia\data\"; + filePrefix = "detail_co.paa"; + camouflageObjects[] = {"ca\plants2\clutter\c_weed3.p3d"}; + }; + + //Chernarus + class Chernarus { + surfaceTextureBasePath = "ca\CHERNARUS\data\"; + filePrefix = "detail_co.paa"; + camouflageObjects[] = {"ca\plants2\clutter\c_weed3.p3d"}; + }; + + //Celle + class mbg_celle2: Chernarus { + camouflageObjects[] = {}; + }; + + //Chernarus Summer + class Chernarus_Summer: Chernarus { + camouflageObjects[] = {"ca\plants2\clutter\c_weed3.p3d"}; + }; + + //Chernarus Winter + class Chernarus_Winter { + surfaceTextureBasePath = "\chernarus_winter\data\"; + filePrefix = "detail_co.paa"; + camouflageObjects[] = {}; + }; + + //Colleville + class Colleville: Baranow { + surfaceTextureBasePath = "WW2\TerrainsIF_t\Worlds\IF_Surfaces_t\France\"; + filePrefix = "co.paa"; + camouflageObjects[] = {}; + }; + //Colleville Winter + class CollevilleWinter { + surfaceTextureBasePath = "WW2\TerrainsIF_t\Worlds\IF_SurfacesWinter_t\France\"; + filePrefix = "co.paa"; + camouflageObjects[] = {}; + }; + + //Desert + class Desert_E { + surfaceTextureBasePath = "ca\Desert_E\data\"; + filePrefix = "co.paa"; + camouflageObjects[] = {"ca\plants_E\Clutter\c_Brush_Hard_EP1.p3d"}; + }; + + //G.O.S Al Rayak + class pja310 { + surfaceTextureBasePath = "mak\projetA3-10\Data\"; + filePrefix = "co.paa"; + camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Green.p3d"}; + }; + + //G.O.S Leskovets + class pja314 { + surfaceTextureBasePath = "MAK\projetA3014\data\"; + filePrefix = "co.paa"; + camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Green.p3d"}; + }; + + //Ivachev + class Ivachev { + surfaceTextureBasePath = "WW2\TerrainsIF_t\Worlds\IF_Surfaces_t\staszow\"; + filePrefix = "co.paa"; + camouflageObjects[] = {}; + }; + + //Ivachev Winter + class IvachevWinter { + surfaceTextureBasePath = "WW2\TerrainsIF_t\Worlds\IF_SurfacesWinter_t\Ivachev\"; + filePrefix = "co.paa"; + camouflageObjects[] = {}; + }; + + //Panovo Winter + class PanovoWinter { + surfaceTextureBasePath = "WW2\TerrainsIF_t\Worlds\IF_SurfacesWinter_t\Panovo\"; + filePrefix = "co.paa"; + camouflageObjects[] = {}; + }; + + //Staszow Winter + class StaszowWinter { + surfaceTextureBasePath = "WW2\TerrainsIF_t\Worlds\IF_SurfacesWinter_t\Staszow\"; + filePrefix = "co.paa"; + camouflageObjects[] = {}; + }; + + // Kerama + class kerama { + surfaceTextureBasePath = "Kerama\data\"; + filePrefix = "co.paa"; + camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Green.p3d"}; + }; + + //Lythium + class lythium: Default { + surfaceTextureBasePath = "GBR\lythium\data\"; + filePrefix = "co.paa"; + camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Brown.p3d"}; + }; + + //Malden + class Malden: Altis { + camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Brown.p3d"}; + class Surfaces { + class GdtForestMalden { + texturePath = "a3\map_malden\data\gdt_forest_malden_co.paa"; + }; + }; + }; + + //Napf + class Napf { + surfaceTextureBasePath = "momo\Napf\data\"; + filePrefix = "co.paa"; + camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Green.p3d"}; + }; + + //Montherme + class SWU_Ardennes_1940: Baranow { + surfaceTextureBasePath = "WW2\TerrainsWW2_swurvin\Surfaces_t\"; + filePrefix = "_co.paa"; + camouflageObjects[] = {}; + }; + + //Montherme Winter + class SWU_Ardennes_1944_Winter { + surfaceTextureBasePath = "WW2\TerrainsWW2_swurvin\Surfaces_t\"; + filePrefix = "_co.paa"; + camouflageObjects[] = {}; + }; + + //Pella Region Greece + class SWU_Greece_Pella_Region { + surfaceTextureBasePath = "WW2\TerrainsWW2_swurvin\Surfaces_t\"; + filePrefix = "_co.paa"; + camouflageObjects[] = {}; + }; + + //Volkhov Forest + class SWU_Russia_Volkhov_Forest { + surfaceTextureBasePath = "WW2\TerrainsWW2_swurvin\Surfaces_t\"; + filePrefix = "_co.paa"; + camouflageObjects[] = {}; + }; + + //Rahmadi + class Intro: Chernarus { + camouflageObjects[] = {"ca\plants\clutter_grass_flowers.p3d"}; + }; + + //Ruha + class ruha { + surfaceTextureBasePath = "ruha\ruha\data\"; + filePrefix = "co.paa"; + }; + + //Panovo + class Panovo { + surfaceTextureBasePath = "WW2\TerrainsIF_t\Worlds\IF_Surfaces_t\staszow\"; + filePrefix = "co.paa"; + camouflageObjects[] = {}; + }; + + //Porto + class Porto { + surfaceTextureBasePath = "ca\desert2\data\"; + filePrefix = "detail_co.paa"; + camouflageObjects[] = {}; + }; + + //Prei Khmaoch Luong + class prei_khmaoch_luong { + surfaceTextureBasePath = "\blud_prei_art\data\ground\"; + filePrefix = "co.paa"; + camouflageObjects[] = {"a3\vegetation_f_exp\clutter\grass\c_Grass_Tropic.p3d"}; + }; + + //Proving Grounds + class ProvingGrounds_PMC { + surfaceTextureBasePath = "ca\provinggrounds_pmc\Data\"; + filePrefix = "co.paa"; + camouflageObjects[] = {}; + }; + + //Sahrani + class Sara { + surfaceTextureBasePath = "ca\sara\Data\"; + filePrefix = "detail_co.paa"; + camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Brown.p3d"}; + class Surfaces { + class mesto { + texturePath = "ca\sara\Data\mesto_co.paa"; + }; + }; + }; + + //Sark + class Hyde_Sark: Baranow { + surfaceTextureBasePath = "WW2\TerrainsWW2_Hyde\Surfaces_t\"; + filePrefix = "co.paa"; + camouflageObjects[] = {}; + class Surfaces { + class default { + texturePath = "WW2\TerrainsWW2_Hyde\Surfaces_t\Hyde_SA_beach_co.paa"; + }; + }; + }; + + //Shapur + class Shapur_Baf { + surfaceTextureBasePath = "ca\shapur_baf\Data\"; + filePrefix = "co.paa"; + camouflageObjects[] = {"ca\plants_E\Clutter\c_Brush_Hard_EP1.p3d"}; + }; + + //Southern Sahrani + class SaraLite { + surfaceTextureBasePath = "ca\saralite\Data\"; + filePrefix = "detail_co.paa"; + camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Brown.p3d"}; + }; + + //Staszow + class Staszow: Baranow { + surfaceTextureBasePath = "WW2\TerrainsIF_t\Worlds\IF_Surfaces_t\staszow\"; + filePrefix = "co.paa"; + camouflageObjects[] = {}; + }; + + //Stratis + class Stratis: Altis { + camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Brown.p3d"}; + }; + + //Takistan + class Takistan { + surfaceTextureBasePath = "ca\takistan\Data\"; + filePrefix = "co.paa"; + camouflageObjects[] = {}; + }; + + //Takistan Mountains + class Mountains_ACR { + surfaceTextureBasePath = "ca\afghan\Data\"; + filePrefix = "co.paa"; + camouflageObjects[] = {}; + }; + + //Tanoa + class Tanoa : Altis{ + surfaceTextureBasePath = "A3\Map_Data_Exp\"; + camouflageObjects[] = {"A3\Vegetation_F_Exp\Clutter\Grass\c_GrassBunch_HI.p3d"}; + }; + + //United Sahrani + class Sara_dbe1 : Sara { + camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Brown.p3d"}; + }; + + //Utes + class utes { + surfaceTextureBasePath = "ca\utes\Data\"; + filePrefix = ".paa"; + camouflageObjects[] = {"CUP\Terrains\cup_terrains_worlds\Clutter\c_GrassCrookedForest.p3d"}; + class Surfaces { + class Default { + texturePath = "a3\map_data\gdt_beach_co.paa"; + }; + }; + }; + + //Zargabad + class Zargabad { + surfaceTextureBasePath = "ca\zargabad\Data\"; + filePrefix = "co.paa"; + camouflageObjects[] = {"ca\plants_E\Clutter\c_Brush_Soft_EP1.p3d"}; + }; + + //Ihantala Winter + class tem_ihantalaw { + surfaceTextureBasePath = "tem\tem_ihantalaw\data\"; + filePrefix = "co.paa"; + camouflageObjects[] = {}; + }; + + //Rosche + class WL_Rosche { + surfaceTextureBasePath = "WL\WL_Rosche\data\"; + filePrefix = "_co.paa"; + camouflageObjects[] = {}; + }; + + //Abramia + class abramia { + surfaceTextureBasePath = "ibr\abramia\data\"; + filePrefix = "detail_co.paa"; + camouflageObjects[] = {}; + }; + + //Isla Duala + class isladuala3 { + surfaceTextureBasePath = "ibr\isladuala3\data\"; + filePrefix = "detail_co.paa"; + camouflageObjects[] = {}; + }; + + //Tembelan + class tembelan { + surfaceTextureBasePath = "ZI\Tembelan\data\"; + filePrefix = "_co.paa"; + camouflageObjects[] = {}; + }; +}; diff --git a/addons/trenches/XEH_PREP.hpp b/addons/trenches/XEH_PREP.hpp index 2e671acb85b..267f65cd398 100644 --- a/addons/trenches/XEH_PREP.hpp +++ b/addons/trenches/XEH_PREP.hpp @@ -1,16 +1,38 @@ - +PREP(addDigger); +PREP(applyCamouflageAttribute); +PREP(automaticFilePath); PREP(canContinueDiggingTrench); PREP(canDigTrench); +PREP(canHelpDiggingTrench); +PREP(canPlaceCamouflage); +PREP(canRemoveCamouflage); PREP(canRemoveTrench); PREP(continueDiggingTrench); +PREP(deleteCamouflage); PREP(handleInteractMenuOpened); PREP(handleKilled); PREP(handlePlayerChanged); PREP(handlePlayerInventoryChanged); PREP(handleScrollWheel); PREP(handleUnconscious); +PREP(initCurator); +PREP(initTrench); +PREP(initTrench3DEN); +PREP(placeCamouflage); PREP(placeCancel); PREP(placeConfirm); PREP(placeTrench); +PREP(progressBar); +PREP(removeCamouflage); PREP(removeTrench); PREP(setTrenchPlacement); + +if ("surfaceTexture" in (uiNamespace getVariable ["Intercept_cba_capabilities",[]])) then { + #ifdef DISABLE_COMPILE_CACHE + DFUNC(getSurfaceTexturePath) = compile preprocessFileLineNumbers QPATHTOF(functions\DOUBLES(fnc,getSurfaceTexturePathNative).sqf); + #else + [QPATHTOF(functions\DOUBLES(fnc,getSurfaceTexturePathNative).sqf), QFUNC(getSurfaceTexturePath)] call CBA_fnc_compileFunction; + #endif +} else { + PREP(getSurfaceTexturePath); +} diff --git a/addons/trenches/XEH_missionDisplayLoad.sqf b/addons/trenches/XEH_missionDisplayLoad.sqf index 2c4951ec7ac..e5fd663bac3 100644 --- a/addons/trenches/XEH_missionDisplayLoad.sqf +++ b/addons/trenches/XEH_missionDisplayLoad.sqf @@ -2,5 +2,4 @@ params ["_display"]; -_display displayAddEventHandler ["MouseZChanged", {(_this select 1) call FUNC(handleScrollWheel)}]; _display displayAddEventHandler ["MouseButtonDown", {[ACE_player, _this select 1] call FUNC(placeCancel)}]; diff --git a/addons/trenches/XEH_postInit.sqf b/addons/trenches/XEH_postInit.sqf index 1fbfa241169..1ddee60505a 100644 --- a/addons/trenches/XEH_postInit.sqf +++ b/addons/trenches/XEH_postInit.sqf @@ -7,7 +7,6 @@ if (isServer) then { if (!hasInterface) exitWith {}; -GVAR(trenchId) = 0; GVAR(trench) = objNull; GVAR(digPFH) = -1; GVAR(digDirection) = 0; @@ -23,4 +22,6 @@ GVAR(digDirection) = 0; // handle waking up dragged unit and falling unconscious while dragging ["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; +if (GVAR(enableAutomaticFilePath)) exitWith {[] call FUNC(automaticFilePath);}; + //@todo Captivity? diff --git a/addons/trenches/XEH_preInit.sqf b/addons/trenches/XEH_preInit.sqf index b47cf6628db..372af179e84 100644 --- a/addons/trenches/XEH_preInit.sqf +++ b/addons/trenches/XEH_preInit.sqf @@ -6,4 +6,23 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +[QGVAR(allowDigging), "CHECKBOX", [localize LSTRING(settingAllowDigging_displayName), localize LSTRING(settingAllowDigging_tooltip)], localize LSTRING(settingCategory), true] call CBA_Settings_fnc_init; +[QGVAR(allowCamouflage), "CHECKBOX", [localize LSTRING(settingAllowCamouflage_displayName), localize LSTRING(settingAllowCamouflage_tooltip)], localize LSTRING(settingCategory), true] call CBA_Settings_fnc_init; +[QGVAR(camouflageRequireEntrenchmentTool), "CHECKBOX", [localize LSTRING(settingCamouflageRequireEntrenchmentTool_displayName), localize LSTRING(settingCamouflageRequireEntrenchmentTool_tooltip)], localize LSTRING(settingCategory), false] call CBA_Settings_fnc_init; +[QGVAR(buildFatigueFactor), "SLIDER", [localize LSTRING(settingBuildFatigueFactor_displayName), localize LSTRING(settingBuildFatigueFactor_tooltip)], localize LSTRING(settingCategory), [0, 5, 1, 1]] call CBA_Settings_fnc_init; +[QGVAR(stopBuildingAtFatigueMax), "CHECKBOX", [localize LSTRING(stopBuildingAtFatigueMax_displayName), localize LSTRING(stopBuildingAtFatigueMax_tooltip)], localize LSTRING(settingCategory), true] call CBA_Settings_fnc_init; +[QGVAR(enableAutomaticFilePath), "CHECKBOX", [localize LSTRING(enableAutomaticFilePath_displayName), localize LSTRING(enableAutomaticFilePath_tooltip)], localize LSTRING(settingCategory), false] call CBA_Settings_fnc_init; + +[QGVAR(allowShortEnvelope), "CHECKBOX", [localize LSTRING(allowShortEnvelope_displayName), localize LSTRING(allowShortEnvelope_tooltip)], localize LSTRING(settingCategory), true] call CBA_Settings_fnc_init; +[QGVAR(allowSmallEnvelope), "CHECKBOX", [localize LSTRING(allowSmallEnvelope_displayName), localize LSTRING(allowSmallEnvelope_tooltip)], localize LSTRING(settingCategory), true] call CBA_Settings_fnc_init; +[QGVAR(allowBigEnvelope), "CHECKBOX", [localize LSTRING(allowBigEnvelope_displayName), localize LSTRING(allowBigEnvelope_tooltip)], localize LSTRING(settingCategory), true] call CBA_Settings_fnc_init; +[QGVAR(allowGigantEnvelope), "CHECKBOX", [localize LSTRING(allowGigantEnvelope_displayName), localize LSTRING(allowGigantEnvelope_tooltip)], localize LSTRING(settingCategory), true] call CBA_Settings_fnc_init; +[QGVAR(allowVehicleEnvelope), "CHECKBOX", [localize LSTRING(allowVehicleEnvelope_displayName), localize LSTRING(allowVehicleEnvelope_tooltip)], localize LSTRING(settingCategory), true] call CBA_Settings_fnc_init; + +[QGVAR(shortEnvelopeDigTime), "SLIDER", localize LSTRING(ShortEnvelopeDigTime), localize LSTRING(settingCategory), [5, 300, 20, 0]] call CBA_Settings_fnc_init; +[QGVAR(smallEnvelopeDigTime), "SLIDER", localize LSTRING(SmallEnvelopeDigTime), localize LSTRING(settingCategory), [5, 450, 30, 0]] call CBA_Settings_fnc_init; +[QGVAR(bigEnvelopeDigTime), "SLIDER", localize LSTRING(BigEnvelopeDigTime), localize LSTRING(settingCategory), [5, 600, 40, 0]] call CBA_Settings_fnc_init; +[QGVAR(gigantEnvelopeDigTime), "SLIDER", localize LSTRING(GigantEnvelopeDigTime), localize LSTRING(settingCategory), [5, 900, 90, 0]] call CBA_Settings_fnc_init; +[QGVAR(vehicleEnvelopeDigTime), "SLIDER", localize LSTRING(VehicleEnvelopeDigTime), localize LSTRING(settingCategory), [5, 1200, 120, 0]] call CBA_Settings_fnc_init; + ADDON = true; diff --git a/addons/trenches/config.cpp b/addons/trenches/config.cpp index 3f76f012ed1..614a1701011 100644 --- a/addons/trenches/config.cpp +++ b/addons/trenches/config.cpp @@ -3,17 +3,19 @@ class CfgPatches { class ADDON { name = COMPONENT_NAME; - units[] = {"ACE_envelope_small","ACE_envelope_big"}; + units[] = {"ACE_envelope_small","ACE_envelope_big","ACE_envelope_gigant","ACE_envelope_vehicle","ACE_envelope_short"}; weapons[] = {"ACE_EntrenchingTool"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_interaction"}; author = ECSTRING(common,ACETeam); - authors[] = {"Grey", "esteldunedain"}; + authors[] = {"Grey", "esteldunedain", "chris579", "Salbei"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; }; +#include "Cfg3DEN.hpp" #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" +#include "CfgWorlds.hpp" diff --git a/addons/trenches/data/model.cfg b/addons/trenches/data/model.cfg new file mode 100644 index 00000000000..470431a6c23 --- /dev/null +++ b/addons/trenches/data/model.cfg @@ -0,0 +1,40 @@ +class CfgSkeletons { + class Default { + isDiscrete = 1; + skeletonInherit = ""; + skeletonBones[] = {}; + }; +}; + +class CfgModels { + class Default { + sectionsInherit=""; + sections[] = {""}; + skeletonName = ""; + }; + class trench_short: Default { + sectionsInherit = ""; + sections[] = {"velka"}; + skeletonName = ""; + }; + class trench_small: Default { + sectionsInherit = ""; + sections[] = {"velka"}; + skeletonName = ""; + }; + class trench_big: Default { + sectionsInherit = ""; + sections[] = {"velka"}; + skeletonName = ""; + }; + class trench_gigant: Default { + sectionsInherit = ""; + sections[] = {"velka"}; + skeletonName = ""; + }; + class trench_vehicle: Default { + sectionsInherit = ""; + sections[] = {"velka"}; + skeletonName = ""; + }; +}; diff --git a/addons/trenches/data/trench_big.p3d b/addons/trenches/data/trench_big.p3d new file mode 100644 index 00000000000..c0b1703af4e Binary files /dev/null and b/addons/trenches/data/trench_big.p3d differ diff --git a/addons/trenches/data/trench_gigant.p3d b/addons/trenches/data/trench_gigant.p3d new file mode 100644 index 00000000000..e77e25518e7 Binary files /dev/null and b/addons/trenches/data/trench_gigant.p3d differ diff --git a/addons/trenches/data/trench_short.p3d b/addons/trenches/data/trench_short.p3d new file mode 100644 index 00000000000..c578fc4df70 Binary files /dev/null and b/addons/trenches/data/trench_short.p3d differ diff --git a/addons/trenches/data/trench_small.p3d b/addons/trenches/data/trench_small.p3d new file mode 100644 index 00000000000..01ba2856807 Binary files /dev/null and b/addons/trenches/data/trench_small.p3d differ diff --git a/addons/trenches/data/trench_vehicle.p3d b/addons/trenches/data/trench_vehicle.p3d new file mode 100644 index 00000000000..584f568df75 Binary files /dev/null and b/addons/trenches/data/trench_vehicle.p3d differ diff --git a/addons/trenches/functions/fnc_addDigger.sqf b/addons/trenches/functions/fnc_addDigger.sqf new file mode 100644 index 00000000000..9e64eba8af7 --- /dev/null +++ b/addons/trenches/functions/fnc_addDigger.sqf @@ -0,0 +1,73 @@ +/* + @Authors + Salbei + @Arguments + - _unit, is the unit that helps digging + - _trench, the trench that is beeing dug + @Return Value + None +*/ + +#include "script_component.hpp" + +params ["_trench", "_unit"]; + +if ((_trench getVariable [QGVAR(diggerCount), 0]) < 1) exitWith {[_trench, _unit] call FUNC(continueDiggingTrench);}; +_trench setVariable [QGVAR(diggerCount), ((_trench getVariable QGVAR(diggerCount))+1), true]; +if (_trench getVariable [QGVAR(diggerCount), 0] == 1) then {_trench setVariable [QGVAR(nextDigger), player, true]}; + +private _type = switch (_trench getVariable [QGVAR(diggingType), nil]) do { + case "UP" : {true}; + case "Down" : {false}; + default {diag_log format ["GRAD_Trenches: addDigger.sqf: No value for _type, %1!", _type];}; +}; + +private _handle = [{ + params ["_args", "_handle"]; + _args params ["_trench", "_unit", "_type"]; + + if ( + (_trench getVariable [QGVAR(nextDigger), player]) == player && + ((_trench getVariable [QGVAR(diggerCount), 1]) < 1 || + !(_trench getVariable [QGVAR(digging), false])) + ) exitWith { + [_handle] call CBA_fnc_removePerFrameHandler; + }; + + if (isNil (_trench getVariable [QGVAR(nextDigger), nil])) then { + _trench setVariable [QGVAR(nextDigger), player, true]; + }; +},0.1, [_trench, _unit, _type]] call CBA_fnc_addPerFrameHandler; + +// Create progress bar +private _fnc_onFinish = { + (_this select 0) params ["_unit", "_trench"]; + _trench setVariable [QGVAR(diggerCount), 0,true]; + + // Reset animation + [_unit, "", 1] call EFUNC(common,doAnimation); +}; + +private _fnc_onFailure = { + (_this select 0) params ["_unit", "_trench"]; + + _trench setVariable [QGVAR(diggerCount), (((_trench getVariable [QGVAR(diggerCount), 0]) -1) max 0), true]; + if ((_trench getVariable [QGVAR(nextDigger), player]) == player) then { + _trench setVariable [QGVAR(nextDigger), nil,true]; + }; + + // Reset animation + [_unit, "", 1] call EFUNC(common,doAnimation); +}; +private _fnc_condition = { + (_this select 0) params ["", "_trench", "", "_handle"]; + + if (_trench getVariable [QGVAR(diggerCount), 0] <= 0) exitWith {false}; + if (isNil "_handle") exitWith {false}; + if (GVAR(stopBuildingAtFatigueMax) && (QEGVAR(advanced_fatigue,anReserve) <= 0)) exitWith {false}; + true +}; + +[[_unit, _trench, _type, _handle], _fnc_onFinish, _fnc_onFailure, localize "STR_ace_trenches_DiggingTrench", _fnc_condition] call FUNC(progressBar); + +[_unit, "AinvPknlMstpSnonWnonDnon_medic4"] call EFUNC(common,doAnimation);; diff --git a/addons/trenches/functions/fnc_applyCamouflageAttribute.sqf b/addons/trenches/functions/fnc_applyCamouflageAttribute.sqf new file mode 100644 index 00000000000..a6f8aa88785 --- /dev/null +++ b/addons/trenches/functions/fnc_applyCamouflageAttribute.sqf @@ -0,0 +1,18 @@ +/* + @Authors + Christian 'chris5790' Klemm + @Arguments + ? + @Return Value + ? + @Example + ? +*/ +#include "script_component.hpp" +params ["_object", "_value"]; + +if (_value isEqualTo 1) then { + [_object] call FUNC(placeCamouflage); +} else { + [_object] call FUNC(deleteCamouflage); +}; diff --git a/addons/trenches/functions/fnc_automaticFilePath.sqf b/addons/trenches/functions/fnc_automaticFilePath.sqf new file mode 100644 index 00000000000..a12030d1ea4 --- /dev/null +++ b/addons/trenches/functions/fnc_automaticFilePath.sqf @@ -0,0 +1,28 @@ +#include "script_component.hpp" + +diag_log "Starting Automatic!"; + +if (isText (configFile >> "CfgWorlds" >> worldName >> "surfaceTextureBasePath")) exitWith {}; +private _config = configfile >> "CfgWorlds" >> worldName >> "OutsideTerrain" >> "Layers" >> "Layer0" >> "texture"; +if !(isText (_config)) exitWith { + diag_log format ["GRAD Trenches: Found no OutsideTerrain texture for Map %1, automatic file path not possible!", worldName]; +}; +private _path = getText (_config); +if (_path find"A3\Map_Data\" >= -1) exitWith { + diag_log format ["GRAD Trenches: Found OutsideTerrain texture not matching path for Map %1, automatic file path not possible!", worldName]; +}; + +private _split = _path splitString "\"; +private _count = ((count _split) -1); +private _texture = _split select _count; +_split deleteAt _count; +_path = _split joinString "\"; + +private _filePrefix = ".paa"; +if ((_texture find "co.paa" >= -1)|| _texture find "ca.paa" >= -1) then { + _split = _texture splitString "_"; + _filePrefix = _split select ((count _split) -1); +}; + +GVAR(automaticFileSetup) = [_path, _filePrefix]; +publicVariable QGVAR(automaticFileSetup); diff --git a/addons/trenches/functions/fnc_canDigTrench.sqf b/addons/trenches/functions/fnc_canDigTrench.sqf index d6bf05993d8..421961bffe9 100644 --- a/addons/trenches/functions/fnc_canDigTrench.sqf +++ b/addons/trenches/functions/fnc_canDigTrench.sqf @@ -17,6 +17,7 @@ params ["_unit"]; +if !(GVAR(allowDigging)) exitWith {false}; if !("ACE_EntrenchingTool" in (_unit call EFUNC(common,uniqueItems))) exitWith {false}; _unit call EFUNC(common,canDig) diff --git a/addons/trenches/functions/fnc_canHelpDiggingTrench.sqf b/addons/trenches/functions/fnc_canHelpDiggingTrench.sqf new file mode 100644 index 00000000000..0b754f4a84d --- /dev/null +++ b/addons/trenches/functions/fnc_canHelpDiggingTrench.sqf @@ -0,0 +1,21 @@ +/* + @Authors + Salbei + @Arguments + ? + @Return Value + ? + @Example + ? +*/ + +#include "script_component.hpp" + +params ["_trench", "_unit"]; + +if !("ACE_EntrenchingTool" in (_unit call EFUNC(common,uniqueItems))) exitWith {false}; +if ((_trench getVariable [QGVAR(progress), 0]) >= 1) exitWith {false}; +if !(_trench getVariable [QGVAR(digging), false]) exitWith {false}; +if ((_trench getVariable [QGVAR(diggerCount), 0]) < 1) exitWith {false}; + +true diff --git a/addons/trenches/functions/fnc_canPlaceCamouflage.sqf b/addons/trenches/functions/fnc_canPlaceCamouflage.sqf new file mode 100644 index 00000000000..c69d4207808 --- /dev/null +++ b/addons/trenches/functions/fnc_canPlaceCamouflage.sqf @@ -0,0 +1,34 @@ +/* +* Author: chris579 +* Checks if camouflage can be applied to a trench +* +* Arguments: +* 0: trench +* +* Return Value: +* Can place +* +* Example: +* [TrenchObj] call ace_trenches_fnc_canPlaceCamouflage +* +* Public: No +*/ +#include "script_component.hpp" + +params ["_trench", "_unit"]; + +private _statusNumber = _trench getVariable [QGVAR(trenchCamouflageStatus), 0]; +private _statusString = ""; + +if (_statusNumber <10) then { + _statusString = ("CamouflagePositions0" + str(_statusNumber +1)); +}else{ + _statusString = ("CamouflagePositions" + str(_statusNumber +1)); +}; + +if !(GVAR(allowCamouflage)) exitWith {false}; +if (GVAR(camouflageRequireEntrenchmentTool) && {!("ACE_EntrenchingTool" in items _unit)}) exitWith {false}; + +(isClass (configFile >> "CfgVehicles" >> (typeof _trench) >> _statusString)) && +{count (getArray (configFile >> "CfgWorlds" >> worldName >> "camouflageObjects")) > 0} && +{count (configProperties [configFile >> "CfgVehicles" >> (typeof _trench) >> _statusString]) > 0} diff --git a/addons/trenches/functions/fnc_canRemoveCamouflage.sqf b/addons/trenches/functions/fnc_canRemoveCamouflage.sqf new file mode 100644 index 00000000000..28181f20b45 --- /dev/null +++ b/addons/trenches/functions/fnc_canRemoveCamouflage.sqf @@ -0,0 +1,15 @@ +/* + @Authors + Christian 'chris5790' Klemm + @Arguments + ? + @Return Value + ? + @Example + ? +*/ +#include "script_component.hpp" + +params ["_trench"]; +if !(GVAR(allowCamouflage)) exitWith {false}; +(count (_trench getVariable [QGVAR(camouflageObjects), []]) > 0) diff --git a/addons/trenches/functions/fnc_continueDiggingTrench.sqf b/addons/trenches/functions/fnc_continueDiggingTrench.sqf index efedfa031ba..f327b043157 100644 --- a/addons/trenches/functions/fnc_continueDiggingTrench.sqf +++ b/addons/trenches/functions/fnc_continueDiggingTrench.sqf @@ -1,6 +1,5 @@ -#include "script_component.hpp" /* - * Author: Garth 'L-H' de Wet, Ruthberg, edited by commy2 for better MP and eventual AI support, esteldunedain + * Author: Garth 'L-H' de Wet, Ruthberg, edited by commy2 for better MP and eventual AI support, esteldunedain, Salbei * Continue process of digging trench. * * Arguments: @@ -15,77 +14,121 @@ * * Public: No */ +#include "script_component.hpp" -params ["_trench", "_unit"]; +params ["_trench", "_unit",["_switchingDigger", false]]; TRACE_2("continueDiggingTrench",_trench,_unit); -private _actualProgress = _trench getVariable [QGVAR(progress), 0]; -if(_actualProgress == 1) exitWith {}; +private _actualProgress = _trench getVariable [QGVAR(progress, 0]; +if (_actualProgress == 1) exitWith {}; // Mark trench as being worked on _trench setVariable [QGVAR(digging), true, true]; +_trench setVariable [QGVAR(diggingType), "UP", true]; +private _diggerCount = _trench getVariable [QGVAR(diggerCount), 0]; + +if (_diggerCount > 0) then { + if !(_switchingDigger) then { + [_trench, _unit] call FUNC(addDigger); + }; +}else{ + _trench setVariable [QGVAR(diggerCount), 1,true]; +}; -private _digTime = getNumber (configFile >> "CfgVehicles" >> (typeof _trench) >> QGVAR(diggingDuration)); -private _digTimeLeft = _digTime * (1 - _actualProgress); - +private _digTime = missionNamespace getVariable [getText (configFile >> "CfgVehicles" >> (typeOf _trench) >> QGVAR(diggingDuration)), 20]; private _placeData = _trench getVariable [QGVAR(placeData), [[], []]]; -_placeData params ["_basePos", "_vecDirAndUp"]; +_placeData params ["", "_vecDirAndUp"]; -private _trenchId = _unit getVariable [QGVAR(isDiggingId), -1]; -if(_trenchId < 0) then { - _trenchId = GVAR(trenchId); - _unit setVariable [QGVAR(isDiggingId), _trenchId, true]; - GVAR(trenchId) = GVAR(trenchId) + 1; +if (isNil "_vecDirAndUp") then { + _vecDirAndUp = [vectorDir _trench, vectorUp _trench]; }; // Create progress bar private _fnc_onFinish = { (_this select 0) params ["_unit", "_trench"]; - _unit setVariable [QGVAR(isDiggingId), -1, true]; _trench setVariable [QGVAR(digging), false, true]; + _trench setVariable [QGVAR(diggingType), nil, true]; // Save progress global - private _progress = _trench getVariable [QGVAR(progress), 0]; - _trench setVariable [QGVAR(progress), _progress, true]; + _trench setVariable [QGVAR(progress, 1, true]; // Reset animation [_unit, "", 1] call EFUNC(common,doAnimation); }; private _fnc_onFailure = { (_this select 0) params ["_unit", "_trench"]; - _unit setVariable [QGVAR(isDiggingId), -1, true]; _trench setVariable [QGVAR(digging), false, true]; + _trench setVariable [QGVAR(diggingType), nil, true]; // Save progress global - private _progress = _trench getVariable [QGVAR(progress), 0]; + private _progress = _trench getVariable [QGVAR(progress, 0]; _trench setVariable [QGVAR(progress), _progress, true]; // Reset animation [_unit, "", 1] call EFUNC(common,doAnimation); }; -[(_digTimeLeft + 0.5), [_unit, _trench], _fnc_onFinish, _fnc_onFailure, localize LSTRING(DiggingTrench)] call EFUNC(common,progressBar); +private _fnc_condition = { + (_this select 0) params ["", "_trench"]; + + if !(_trench getVariable [QGVAR(digging), false]) exitWith {false}; + if (_trench getVariable [QGVAR(diggerCount), 0] <= 0) exitWith {false}; + if (GVAR(stopBuildingAtFatigueMax) && (EGVAR(advanced_fatigue,anReserve) <= 0)) exitWith {false}; + true +}; -if(_actualProgress == 0) then { - [_unit, _trench, _trenchId, _basePos vectorDiff [0, 0, 1.0], _vecDirAndUp, _actualProgress] call FUNC(setTrenchPlacement); +[[_unit, _trench], _fnc_onFinish, _fnc_onFailure, localize "STR_ace_trenches_DiggingTrench", _fnc_condition] call FUNC(progressBar); - //Remove grass +if (_actualProgress == 0) then { + //Remove grass { private _trenchGrassCutter = createVehicle ["Land_ClutterCutter_medium_F", [0, 0, 0], [], 0, "NONE"]; private _cutterPos = AGLToASL (_trench modelToWorld _x); _cutterPos set [2, getTerrainHeightASL _cutterPos]; _trenchGrassCutter setPosASL _cutterPos; deleteVehicle _trenchGrassCutter; - } foreach getArray (configFile >> "CfgVehicles" >> (typeof _trench) >> QGVAR(grassCuttingPoints)); + } foreach getArray (configFile >> "CfgVehicles" >> (typeOf _trench) >> "ace_trenches_grassCuttingPoints"); }; -private _progressLeft = (_actualProgress * 10) + 1; +[{ + params ["_args", "_handle"]; + _args params ["_trench", "_unit", "_digTime", "_vecDirAndUp"]; + private _actualProgress = _trench getVariable [QGVAR(progress), 0]; + private _diggerCount = _trench getVariable [QGVAR(diggerCount), 0]; + + if ( + !(_trench getVariable [QGVAR(digging), false]) || + (_diggerCount <= 0) || + (_actualProgress >= 1) + ) exitWith { + [_handle] call CBA_fnc_removePerFrameHandler; + _trench setVariable [QGVAR(digging), false, true]; + _trench setVariable [QGVAR(diggerCount), ((_diggerCount -1) max 0), true]; + }; -for "_i" from _progressLeft to 10 do { - private _vectorDiffZ = 1 - (_i / 10); - private _delay = _digTime * ((_i / 10) - _actualProgress); - private _progress = _i / 10; - [DFUNC(setTrenchPlacement), [_unit, _trench, _trenchId, _basePos vectorDiff [0, 0, _vectorDiffZ], _vecDirAndUp, _progress], _delay] call CBA_fnc_waitAndExecute; -}; + private _boundingBox = boundingBoxReal _trench; + _boundingBox params ["_lbfc"]; //_lbfc(Left Bottom Front Corner) _rtbc (Right Top Back Corner) + _lbfc params ["", "", "_lbfcZ"]; + + private _pos = (getPosWorld _trench); + private _posDiff = ((abs((_trench getVariable [QGVAR(diggingSteps), 0]) + _lbfcZ)) * _diggerCount)/(_digTime*5); + _pos set [2,((_pos select 2) + _posDiff)]; + + _trench setPosWorld _pos; + _trench setVectorDirAndUp _vecDirAndUp; + + //Fatigue impact + EGVAR(advanced_fatigue,anReserve) = (EGVAR(advanced_fatigue,anReserve) - ((_digTime /12) * GVAR(buildFatigueFactor))) max 0; + EGVAR(advanced_fatigue,anFatigue) = (EGVAR(advanced_fatigue,anFatigue) + (((_digTime/12) * GVAR(buildFatigueFactor))/1200)) min 1; + + // Save progress + _trench setVariable [QGVAR(progress), (_actualProgress + ((1/(_digTime *10)) * _diggerCount)), true]; + + if (GVAR(stopBuildingAtFatigueMax) && (EGVAR(advanced_fatigue,anReserve) <= 0)) exitWith { + [_handle] call CBA_fnc_removePerFrameHandler; + _trench setVariable [QGVAR(digging), false, true]; + _trench setVariable [QGVAR(diggerCount), ((_diggerCount -1) max 0), true]; + }; +},0.1,[_trench, _unit, _digTime, _vecDirAndUp]] call CBA_fnc_addPerFrameHandler; // Play animation [_unit, "AinvPknlMstpSnonWnonDnon_medic4"] call EFUNC(common,doAnimation); diff --git a/addons/trenches/functions/fnc_deleteCamouflage.sqf b/addons/trenches/functions/fnc_deleteCamouflage.sqf new file mode 100644 index 00000000000..ab58a958c50 --- /dev/null +++ b/addons/trenches/functions/fnc_deleteCamouflage.sqf @@ -0,0 +1,22 @@ +/* + @Authors + Christian 'chris5790' Klemm + @Arguments + ? + @Return Value + ? + @Example + ? +*/ +#include "script_component.hpp" + +params ["_trench"]; + +private _camouflageObjects = _trench getVariable [QGVAR(camouflageObjects), []]; + +{ + deleteVehicle _x; +} forEach (_camouflageObjects select 0); + +_camouflageObjects deleteAt 0; +_trench setVariable [QGVAR(camouflageObjects), _camouflageObjects, true]; diff --git a/addons/trenches/functions/fnc_getSurfaceTexturePath.sqf b/addons/trenches/functions/fnc_getSurfaceTexturePath.sqf new file mode 100644 index 00000000000..e6163be5232 --- /dev/null +++ b/addons/trenches/functions/fnc_getSurfaceTexturePath.sqf @@ -0,0 +1,64 @@ +/* +* Author: chris579, Salbei +* Gets the path to the ground texture under the object +* +* Arguments: +* 0: trench +* +* Return Value: +* Surface path +* +* Example: +* [TrenchObj] call ace_trenches_fnc_getSurfaceTexturePath +* +* Public: No +*/ +#include "script_component.hpp" +params [ + ["_object", objnull, [objNull]] +]; +if (isNull _object) exitWith {}; +if !(isNil QGVAR(automaticFileSetup) && isText (configFile >> "CfgWorlds" >> worldName >> "surfaceTextureBasePath")) exitWith {DEFAULT_TEXTURE}; + +private _surfaceType = surfaceType (position _object); + +private _getTexturePath = { + params["_surfaceType", "_basePath", "_filePrefix"]; + + // remove leading # + private _parsedSurfaceType = _surfaceType select [1, count _surfaceType]; + // check for overridden surface paths + private _overrideCfg = configFile >> "CfgWorlds" >> worldName >> "Surfaces" >> _parsedSurfaceType >> "texturePath"; + if (isText (_overrideCfg)) exitWith { + getText(_overrideCfg) + }; + // get config file wildcard + private _fileWildcard = getText(configfile >> "CfgSurfaces" >> _parsedSurfaceType >> "files"); + // remove * in file wildcard + private _fileNameArr = _fileWildcard splitString ""; + if (_fileNameArr find "*" > -1) then { + _fileNameArr deleteAt (_fileNameArr find "*"); + }; + + format["%1%2%3", _basePath, (_fileNameArr joinString ""), _filePrefix]; +}; + +private _result = []; + +if !(isNil QGVAR(automaticFileSetup)) then { + GVAR(automaticFileSetup) params ["_basePath", "_filePrefix"]; + _result = [_surfaceType, _basePath, _filePrefix] call _getTexturePath; +}else{ + private _basePath = getText (configFile >> "CfgWorlds" >> "Altis" >> "surfaceTextureBasePath"); + if ((_surfaceType find "#Gdt" == -1) || {worldName == "Tanoa"}) then { + _basePath = getText (configFile >> "CfgWorlds" >> worldName >> "surfaceTextureBasePath") + }; + _result = [_surfaceType, _basePath, getText(configFile >> "CfgWorlds" >> worldName >> "filePrefix")] call _getTexturePath; +}; + +if (isNil {_result} || _result isEqualTo []) then { + _result = DEFAULT_TEXTURE; + diag_log format ["GRAD_Trenches: Type: %1, Position: %2, WorldName: %3, SurfaceType: %4, Texture: %5", (typeof _object), (position _object), worldName, _surfaceType, _result]; +}; + +_result; diff --git a/addons/trenches/functions/fnc_getSurfaceTexturePathNative.sqf b/addons/trenches/functions/fnc_getSurfaceTexturePathNative.sqf new file mode 100644 index 00000000000..6c64ab61583 --- /dev/null +++ b/addons/trenches/functions/fnc_getSurfaceTexturePathNative.sqf @@ -0,0 +1,28 @@ +/* + * Author: chris579 + * Gets the path to the ground texture under the object + * Native version using intercept cba 'surfaceTexture' + * Is compiled conditionally when intercept cba is available + * + * Arguments: + * 0: trench + * + * Return Value: + * Surface path + * + * Example: + * [TrenchObj] call ace_trenches_fnc_getSurfaceTexturePath + * + * Public: No + */ +#include "script_component.hpp" +params [ + ["_object", objnull, [objNull]] +]; + +if (isNull _object) exitWith {DEFAULT_TEXTURE}; + +private _result = surfaceTexture (getPos _object); + +if (isNil {_result}) exitWith {DEFAULT_TEXTURE}; +_result diff --git a/addons/trenches/functions/fnc_initCurator.sqf b/addons/trenches/functions/fnc_initCurator.sqf new file mode 100644 index 00000000000..b3bca113178 --- /dev/null +++ b/addons/trenches/functions/fnc_initCurator.sqf @@ -0,0 +1,28 @@ +/* + * Author: chris579 + * Inits curator logics with evhs + * + * Arguments: + * 0: curator logic + * + * Return Value: + * None + * + * Example: + * [Logic] call ace_trenches_fnc_initCurator + * + * Public: No + */ +#include "script_component.hpp" +params [ + ["_logic", objnull, [objNull]] +]; + +_logic addEventHandler ["CuratorObjectEdited", { + params ["_logic", "_object"]; + + if (IS_TRENCH(_object)) then { + private _texture = [_object] call FUNC(getSurfaceTexturePath); + _object setObjectTextureGlobal [0, _texture]; + }; +}]; diff --git a/addons/trenches/functions/fnc_initTrench.sqf b/addons/trenches/functions/fnc_initTrench.sqf new file mode 100644 index 00000000000..e87423000f9 --- /dev/null +++ b/addons/trenches/functions/fnc_initTrench.sqf @@ -0,0 +1,34 @@ +/* + * Author: chris579, Salbei + * Inits a trench + * + * Arguments: + * 0: trench + * + * Return Value: + * None + * + * Example: + * [TrenchObj] call ace_trenches_fnc_initTrench + * + * Public: No + */ +#include "script_component.hpp" +params [ + ["_object", objNull, [objNull]] +]; +if (isServer) then { + _object setVariable [QGVAR(progress), 1, true]; +}; + +if (is3DEN) exitWith { + [_object] call FUNC(initTrench3DEN); +}; + +if (local _object) then { + // Has to be spawned to ensure MP compatibility + _object spawn { + private _texture = [_this] call FUNC(getSurfaceTexturePath); + _this setObjectTextureGlobal [0, _texture]; + }; +}; diff --git a/addons/trenches/functions/fnc_initTrench3DEN.sqf b/addons/trenches/functions/fnc_initTrench3DEN.sqf new file mode 100644 index 00000000000..943b2bf3502 --- /dev/null +++ b/addons/trenches/functions/fnc_initTrench3DEN.sqf @@ -0,0 +1,50 @@ +/* + * Author: chris579 + * Inits a trench placed in 3DEN + * + * Arguments: + * 0: trench + * + * Return Value: + * Surface path + * + * Example: + * [TrenchObj] call ace_trenches_fnc_initTrench3DEN + * + * Public: No + */ +#include "script_component.hpp" +params [ + ["_object", objnull, [objNull]] +]; + +private _initTrench = { + params ["_object"]; + _object addEventHandler ["Dragged3DEN", { + params ["_object"]; + private _texture = [_object] call FUNC(getSurfaceTexturePath); + _object setObjectTexture [0, _texture]; + { + private _pos = _x getVariable [QGVAR(positionData), [0,0,0]]; + _x attachTo [_object, _pos]; + } forEach (_object getVariable [QGVAR(camouflageObjects), []]); + }]; + + private _texture = [_object] call FUNC(getSurfaceTexturePath); + _object setObjectTexture [0, _texture]; + + if (((_object get3DENAttribute CAMOUFLAGE_3DEN_ATTRIBUTE) select 0) isEqualTo 1) then { + [_object] call FUNC(placeCamouflage); + }; +}; + +// If no object is given apply this to all trenches in 3den +if (isNull _object) then { + { + if (IS_TRENCH(_x)) then { + [_x] call _initTrench; + }; + } forEach (all3DENEntities select 0); +} else { + [_object] call _initTrench; +} diff --git a/addons/trenches/functions/fnc_placeCamouflage.sqf b/addons/trenches/functions/fnc_placeCamouflage.sqf new file mode 100644 index 00000000000..fe8567d7c47 --- /dev/null +++ b/addons/trenches/functions/fnc_placeCamouflage.sqf @@ -0,0 +1,79 @@ +/* + * Author: chris579, Salbei + * Places camouflage on a trench + * + * Arguments: + * 0: trench + * 1: unit + * + * Return Value: + * None + * + * Example: + * [TrenchObj, Unit] call ace_trenches_fnc_placeCamouflage + * + * Public: No + */ +#include "script_component.hpp" + +params [ + ["_trench", objnull, [objnull]], + ["_unit", objnull, [objnull]] +]; + +if (isNull _trench || {count getArray (configFile >> "CfgWorlds" >> worldName >> "camouflageObjects") == 0}) exitWith {}; + +private _fnc_onFinish = { + (_this select 0) params ["_unit", "_trench"]; + + private _camouflageObjects = getArray (configFile >> "CfgWorlds" >> worldName >> "camouflageObjects"); + private _statusNumber = _trench getVariable [QGVAR(trenchCamouflageStatus), 0]; + private _statusString = ""; + _statusNumber = _statusNumber +1; + + if (_statusNumber <10) then { + _statusString = ("0" + str(_statusNumber)); + }else{ + _statusString = str(_statusNumber); + }; + + + private _placedObjects = []; + private _camouflageObjectsArray = _trench getVariable [QGVAR(camouflageObjects), []]; + + { + private _object = createSimpleObject [selectRandom _camouflageObjects, [0,0,0]]; + _object attachTo [_trench, getArray(_x)]; + + if (is3DEN) then { + _object setVariable [QGVAR(positionData), getArray(_x),true]; + }; + + _placedObjects pushBack _object; + } forEach (configProperties [configFile >> "CfgVehicles" >> (typeof _trench) >> ("CamouflagePositions" + _statusString)]); + + reverse _camouflageObjectsArray; + _camouflageObjectsArray pushBack _placedObjects; + reverse _camouflageObjectsArray; + + + _trench setVariable [QGVAR(camouflageObjects), _camouflageObjectsArray, true]; + _trench setVariable [QGVAR(trenchCamouflageStatus), _statusNumber]; + + // Reset animation + [_unit, "", 1] call EFUNC(common,doAnimation); +}; + +private _fnc_onFailure = { + (_this select 0) params ["_unit"]; + // Reset animation + [_unit, "", 1] call EFUNC(common,doAnimation); +}; + +if (isNull _unit) exitWith { + [[objnull, _trench]] call _fnc_onFinish; +}; + +[CAMOUFLAGE_DURATION, [_unit, _trench], _fnc_onFinish, _fnc_onFailure, localize LSTRING(placeCamouflageProgress)] call ace_common_fnc_progressBar; + +[_unit, "AinvPknlMstpSnonWnonDnon_medic4"] call EFUNC(common,doAnimation); diff --git a/addons/trenches/functions/fnc_placeCancel.sqf b/addons/trenches/functions/fnc_placeCancel.sqf index 36bf5c80233..1afcc6ba384 100644 --- a/addons/trenches/functions/fnc_placeCancel.sqf +++ b/addons/trenches/functions/fnc_placeCancel.sqf @@ -1,4 +1,3 @@ -#include "script_component.hpp" /* * Author: Garth 'L-H' de Wet, Ruthberg, edited by commy2 for better MP and eventual AI support * Cancels trench dig @@ -11,10 +10,11 @@ * None * * Example: - * [ACE_player] call ace_sandbag_fnc_placeCancel + * [ACE_player] call ace_trenches_fnc_placeCancel * * Public: No */ +#include "script_component.hpp" params ["_unit", "_key"]; diff --git a/addons/trenches/functions/fnc_placeConfirm.sqf b/addons/trenches/functions/fnc_placeConfirm.sqf index 25d675d09b6..f037c66661b 100644 --- a/addons/trenches/functions/fnc_placeConfirm.sqf +++ b/addons/trenches/functions/fnc_placeConfirm.sqf @@ -1,4 +1,3 @@ -#include "script_component.hpp" /* * Author: Garth 'L-H' de Wet, Ruthberg, edited by commy2 for better MP and eventual AI support and esteldunedain * Confirms trench dig @@ -14,61 +13,52 @@ * * Public: No */ +#include "script_component.hpp" params ["_unit"]; // enable running again -[_unit, "forceWalk", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", "ACE_Trenches", false] call ace_common_fnc_statusEffect_set; // remove dig pfh -[GVAR(digPFH)] call CBA_fnc_removePerFrameHandler; -GVAR(digPFH) = -1; +[ace_trenches_digPFH] call CBA_fnc_removePerFrameHandler; +ace_trenches_digPFH = -1; // remove mouse button actions -call EFUNC(interaction,hideMouseHint); +call ace_interaction_fnc_hideMouseHint; -[_unit, "DefaultAction", _unit getVariable [QGVAR(Dig), -1]] call EFUNC(common,removeActionEventHandler); +[_unit, "DefaultAction", _unit getVariable ["ace_trenches_Dig", -1]] call ace_common_fnc_removeActionEventHandler; -_unit setVariable [QGVAR(isPlacing), false, true]; +_unit setVariable ["ace_trenches_isPlacing", false, true]; // Delete placement dummy and create real trench params ["_unit"]; -if (isNull GVAR(trench)) exitWith {}; +if (isNull ace_trenches_trench) exitWith {}; -deleteVehicle GVAR(trench); -private _trench = createVehicle [GVAR(trenchClass), [0, 0, 0], [], 0, "NONE"]; +private _trenchClass = typeOf ace_trenches_trench; +private _vecDirAndUp = [(vectorDir ace_trenches_trench), (vectorUp ace_trenches_trench)]; +deleteVehicle ace_trenches_trench; -GVAR(trenchPlacementData) params ["_dx", "_dy", "_offset"]; -private _basePos = GVAR(trenchPos); -private _angle = (GVAR(digDirection) + getDir _unit); +ace_trenches_trenchPos set [2, -0.2]; +private _trench = createVehicle [_trenchClass, ace_trenches_trenchPos, [], 0, "CAN_COLLIDE"]; +_trench setObjectTextureGlobal [0,[_trench] call FUNC(getSurfaceTexturePath)]; +test_trench = _tench; +publicVariable "test_trench"; -// _v1 forward from the player, _v2 to the right, _v3 points away from the ground -private _v3 = surfaceNormal _basePos; -private _v2 = [sin _angle, +cos _angle, 0] vectorCrossProduct _v3; -private _v1 = _v3 vectorCrossProduct _v2; +private _boundingBox = boundingBoxReal _trench; +_boundingBox params ["_lbfc", "_rtbc"]; //_lbfc(Left Bottom Front Corner) _rtbc (Right Top Back Corner) +_lbfc params ["", "", "_lbfcZ"]; +_rtbc params ["", "", "_rtbcZ"]; -// Stick the trench to the ground -_basePos set [2, getTerrainHeightASL _basePos]; -private _minzoffset = 0; +private _boundingBoxOffset = missionNamespace getVariable [getText (configFile >> "CfgVehicles" >> _trenchClass >> "ace_trenches_boundingBoxOffset"),0]; +private _posDiff = (abs(_lbfcZ) + abs(_rtbcZ)) - _boundingBoxOffset; +private _newPos = (_trench modelToWorldWorld [0,0, -(_posDiff)]); +_trench setPosWorld _newPos; -for [{private _ix = -_dx/2},{_ix <= _dx/2},{_ix = _ix + _dx/3}] do { - for [{private _iy = -_dy/2},{_iy <= _dy/2},{_iy = _iy + _dy/3}] do { - private _pos = _basePos vectorAdd (_v2 vectorMultiply _ix) - vectorAdd (_v1 vectorMultiply _iy); - _minzoffset = _minzoffset min ((getTerrainHeightASL _pos) - (_pos select 2)); - #ifdef DEBUG_MODE_FULL - _pos set [2, getTerrainHeightASL _pos]; - _pos2 = +_pos; - _pos2 set [2, getTerrainHeightASL _pos + 1]; - drawLine3D [ASLtoAGL _pos, ASLtoAGL _pos2, [1,1,0,1]]; - #endif - }; -}; -_basePos set [2, (_basePos select 2) + _minzoffset + _offset]; -private _vecDirAndUp = [_v1, _v3]; -GVAR(trench) = objNull; +_trench setVariable [QGVAR(diggingSteps), (_posDiff/1000),true]; +_trench setVectorDirAndUp _vecDirAndUp; -_trench setVariable [QGVAR(placeData), [_basePos, _vecDirAndUp], true]; +_trench setVariable ["ace_trenches_placeData", [_newPos, _vecDirAndUp], true]; +_trench setVariable [QGVAR(progress), 0, true]; -[_trench, _unit] call FUNC(continueDiggingTrench); +[_trench, _unit, false] call FUNC(continueDiggingTrench); diff --git a/addons/trenches/functions/fnc_placeTrench.sqf b/addons/trenches/functions/fnc_placeTrench.sqf index 0f527865610..2ab61ea09ff 100644 --- a/addons/trenches/functions/fnc_placeTrench.sqf +++ b/addons/trenches/functions/fnc_placeTrench.sqf @@ -1,4 +1,3 @@ -#include "script_component.hpp" /* * Author: Garth 'L-H' de Wet, Ruthberg, edited by commy2 for better MP and eventual AI support, esteldunedain * Starts the place process for trench. @@ -15,48 +14,54 @@ * * Public: No */ +#include "script_component.hpp" params ["_unit", "_trenchClass"]; -//Load trench data -private _noGeoModel = getText (configFile >> "CfgVehicles" >> _trenchClass >> QGVAR(noGeoClass)); -if(_noGeoModel == "") then {_noGeoModel = _trenchClass;}; -GVAR(trenchClass) = _trenchClass; -GVAR(trenchPlacementData) = getArray (configFile >> "CfgVehicles" >> _trenchClass >> QGVAR(placementData)); -TRACE_1("",GVAR(trenchPlacementData)); +//Load trench data +ace_trenches_trenchPlacementData = getArray (configFile >> "CfgVehicles" >> _trenchClass >> "ace_trenches_placementData"); +TRACE_1("",ace_trenches_trenchPlacementData); // prevent the placing unit from running -[_unit, "forceWalk", "ACE_Trenches", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Trenches", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", "ACE_Trenches", true] call ace_common_fnc_statusEffect_set; // create the trench -private _trench = createVehicle [_noGeoModel, [0, 0, 0], [], 0, "NONE"]; - -GVAR(trench) = _trench; +private _trench = createSimpleObject [_trenchClass, [0, 0, 0]]; +ace_trenches_trench = _trench; // prevent collisions with trench -[QEGVAR(common,enableSimulationGlobal), [_trench, false]] call CBA_fnc_serverEvent; +["ace_common_enableSimulationGlobal", [_trench, false]] call CBA_fnc_serverEvent; GVAR(digDirection) = 0; +GVAR(currentSurface) = ""; // pfh that runs while the dig is in progress -GVAR(digPFH) = [{ +ace_trenches_digPFH = [{ (_this select 0) params ["_unit", "_trench"]; // Cancel if the helper object is gone if (isNull _trench) exitWith { - [_unit] call FUNC(placeCancel); + [_unit] call ace_trenches_fnc_placeCancel; }; // Cancel if the place is no longer suitable - if !([_unit] call FUNC(canDigTrench)) exitWith { - [_unit] call FUNC(placeCancel); + private _checkVar = [_unit] call ace_trenches_fnc_canDigTrench; + if ((typeName _checkVar) == "Number") then { + if (_checkVar > 0) then { + _checkVar = true; + }else{ + _checkVar = false; + }; + }; + + if !(_checkVar) exitWith { + [_unit] call ace_trenches_fnc_placeCancel; }; // Update trench position - GVAR(trenchPlacementData) params ["_dx", "_dy", "_offset"]; - private _basePos = eyePos _unit vectorAdd ([sin getDir _unit, +cos getDir _unit, 0] vectorMultiply 1.0); + ace_trenches_trenchPlacementData params ["_dx", "_dy", "_offset"]; + private _basePos = _unit ModelToWorld [0,2,0]; private _angle = (GVAR(digDirection) + getDir _unit); @@ -68,14 +73,16 @@ GVAR(digPFH) = [{ // Stick the trench to the ground _basePos set [2, getTerrainHeightASL _basePos]; private _minzoffset = 0; - for [{private _ix = -_dx/2},{_ix <= _dx/2},{_ix = _ix + _dx/3}] do { - for [{private _iy = -_dy/2},{_iy <= _dy/2},{_iy = _iy + _dy/3}] do { + private _ix = 0; + private _iy = 0; + for [{_ix = -_dx/2},{_ix <= _dx/2},{_ix = _ix + _dx/3}] do { + for [{_iy = -_dy/2},{_iy <= _dy/2},{_iy = _iy + _dy/3}] do { private _pos = _basePos vectorAdd (_v2 vectorMultiply _ix) vectorAdd (_v1 vectorMultiply _iy); _minzoffset = _minzoffset min ((getTerrainHeightASL _pos) - (_pos select 2)); #ifdef DEBUG_MODE_FULL _pos set [2, getTerrainHeightASL _pos]; - _pos2 = +_pos; + private _pos2 = +_pos; _pos2 set [2, getTerrainHeightASL _pos + 1]; drawLine3D [ASLtoAGL _pos, ASLtoAGL _pos2, [1,1,0,1]]; #endif @@ -85,17 +92,21 @@ GVAR(digPFH) = [{ TRACE_2("",_minzoffset,_offset); _trench setPosASL _basePos; _trench setVectorDirAndUp [_v1, _v3]; - GVAR(trenchPos) = _basePos; + ace_trenches_trenchPos = _basePos; + if (surfaceType (position _trench) != GVAR(currentSurface)) then { + GVAR(currentSurface) = surfaceType (position _trench); + _trench setObjectTextureGlobal [0, [_trench] call FUNC(getSurfaceTexturePath)]; + }; }, 0, [_unit, _trench]] call CBA_fnc_addPerFrameHandler; // add mouse button action and hint -[localize LSTRING(ConfirmDig), localize LSTRING(CancelDig), localize LSTRING(ScrollAction)] call EFUNC(interaction,showMouseHint); +[localize "STR_ace_trenches_ConfirmDig", localize "STR_ace_trenches_CancelDig"] call ace_interaction_fnc_showMouseHint; -_unit setVariable [QGVAR(Dig), [ +_unit setVariable ["ace_trenches_Dig", [ _unit, "DefaultAction", - {GVAR(digPFH) != -1}, + {ace_trenches_digPFH != -1}, {[_this select 0] call FUNC(placeConfirm)} -] call EFUNC(common,addActionEventHandler)]; +] call ace_common_fnc_addActionEventHandler]; -_unit setVariable [QGVAR(isPlacing), true, true]; +_unit setVariable ["ace_trenches_isPlacing", true, true]; diff --git a/addons/trenches/functions/fnc_progressBar.sqf b/addons/trenches/functions/fnc_progressBar.sqf new file mode 100644 index 00000000000..f6217b89d4e --- /dev/null +++ b/addons/trenches/functions/fnc_progressBar.sqf @@ -0,0 +1,102 @@ +/* + * Author: commy2, Glowbal, PabstMirror + * Modified by Salbei + * Draw progress bar and execute given function if succesful. + * Finish/Failure/Conditional are all passed [_args, _errorCode] + * + * Arguments: + * 0: Arguments, passed to condition, fail and finish + * 1: On Finish: Code called or STRING raised as event. + * 2: On Failure: Code called or STRING raised as event. + * 3: (Optional) Localized Title + * 4: Code to check each frame (Optional) + * 5: Exceptions for checking EFUNC(common,canInteractWith) (Optional) + * + * Return Value: + * None + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_args", "_onFinish", "_onFail", ["_localizedTitle", ""], ["_condition", {true}], ["_exceptions", []]]; + +private _player = ACE_player; + +//Open Dialog and set the title +closeDialog 0; +createDialog EGVAR(common,ProgressBar_Dialog); + +(uiNamespace getVariable EGVAR(common,ctrlProgressBarTitle)) ctrlSetText _localizedTitle; + +//Adjust position based on user setting: +private _ctrlPos = ctrlPosition (uiNamespace getVariable EGVAR(common,ctrlProgressBarTitle)); +_ctrlPos set [1, ((0 + 29 * ace_common_settingProgressBarLocation) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))]; + +(uiNamespace getVariable EGVAR(common,ctrlProgressBG)) ctrlSetPosition _ctrlPos; +(uiNamespace getVariable EGVAR(common,ctrlProgressBG)) ctrlCommit 0; +(uiNamespace getVariable EGVAR(common,ctrlProgressBar)) ctrlSetPosition _ctrlPos; +(uiNamespace getVariable EGVAR(common,ctrlProgressBar)) ctrlCommit 0; +(uiNamespace getVariable EGVAR(common,ctrlProgressBarTitle)) ctrlSetPosition _ctrlPos; +(uiNamespace getVariable EGVAR(common,ctrlProgressBarTitle)) ctrlCommit 0; + +[{ + (_this select 0) params ["_args", "_onFinish", "_onFail", "_condition", "_player", "_exceptions"]; + _args params ["", "_trench", ["_finishCondition", true]]; + private _progress = _trench getVariable [QGVAR(progress), 0]; + + private _errorCode = -1; + + // this does not check: target fell unconscious, target died, target moved inside vehicle / left vehicle, target moved outside of players range, target moves at all. + if (isNull (uiNamespace getVariable [EGVAR(common,ctrlProgressBar), controlNull])) then { + _errorCode = 1; + } else { + if (ACE_player != _player || !alive _player) then { + _errorCode = 2; + } else { + if !([_args, _errorCode] call _condition) then { + _errorCode = 3; + } else { + if !([_player, objNull, _exceptions] call ace_common_fnc_canInteractWith) then { + _errorCode = 4; + } else { + if (_finishCondition && _progress >= 1) then { + _errorCode = 0; + }else{ + if (!(_finishCondition) && _progress <= 0) then { + _errorCode = 0; + }; + }; + }; + }; + }; + }; + + if (_errorCode != -1) then { + //Error or Success, close dialog and remove PFEH + + //Only close dialog if it's the progressBar: + if (!isNull (uiNamespace getVariable [EGVAR(common,ctrlProgressBar), controlNull])) then { + closeDialog 0; + }; + + [_this select 1] call CBA_fnc_removePerFrameHandler; + + if (_errorCode == 0) then { + if (_onFinish isEqualType "") then { + [_onFinish, [_args, _errorCode]] call CBA_fnc_localEvent; + } else { + [_args, _errorCode] call _onFinish; + }; + } else { + if (_onFail isEqualType "") then { + [_onFail, [_args, _errorCode]] call CBA_fnc_localEvent; + } else { + [_args, _errorCode] call _onFail; + }; + }; + } else { + //Update Progress Bar + (uiNamespace getVariable EGVAR(common,ctrlProgressBar)) progressSetPosition _progress; + }; +}, 0, [_args, _onFinish, _onFail, _condition, _player, _exceptions]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/trenches/functions/fnc_removeCamouflage.sqf b/addons/trenches/functions/fnc_removeCamouflage.sqf new file mode 100644 index 00000000000..9241301e91b --- /dev/null +++ b/addons/trenches/functions/fnc_removeCamouflage.sqf @@ -0,0 +1,37 @@ +/* + * Author: chris579 + * Removes camouflage from a trench + * + * Arguments: + * 0: trench + * 1: unit + * + * Return Value: + * None + * + * Example: + * [TrenchObj, Unit] call ace_trenches_fnc_removeCamouflage + * + * Public: No + */ +#include "script_component.hpp" + +params ["_trench", "_unit"]; + +private _fnc_onFinish = { + (_this select 0) params ["_unit", "_trench"]; + [_trench] call FUNC(deleteCamouflage); + + // Reset animation + [_unit, "", 1] call EFUNC(common,doAnimation); +}; + +private _fnc_onFailure = { + (_this select 0) params ["_unit"]; + // Reset animation + [_unit, "", 1] call EFUNC(common,doAnimation); +}; + +[CAMOUFLAGE_DURATION, [_unit, _trench], _fnc_onFinish, _fnc_onFailure, localize LSTRING(removeCamouflageProgress)] call EFUNC(common,progressBar); + +[_unit, "AinvPknlMstpSnonWnonDnon_medic4"] call EFUNC(common,doAnimation); diff --git a/addons/trenches/functions/fnc_removeTrench.sqf b/addons/trenches/functions/fnc_removeTrench.sqf index 3a549eb16fd..5b426763f77 100644 --- a/addons/trenches/functions/fnc_removeTrench.sqf +++ b/addons/trenches/functions/fnc_removeTrench.sqf @@ -1,4 +1,3 @@ -#include "script_component.hpp" /* * Author: Garth 'L-H' de Wet, Ruthberg, edited by commy2 for better MP and eventual AI support and esteldunedain * Removes trench @@ -15,33 +14,40 @@ * * Public: No */ + #include "script_component.hpp" -params ["_trench", "_unit"]; +params ["_trench", "_unit",["_switchingDigger", false]]; TRACE_2("removeTrench",_trench,_unit); private _actualProgress = _trench getVariable [QGVAR(progress), 0]; -if(_actualProgress == 0) exitWith {}; +if (_actualProgress <= 0) exitWith {}; // Mark trench as being worked on _trench setVariable [QGVAR(digging), true, true]; +_trench setVariable [QGVAR(diggingType), "DOWN", true]; +private _diggerCount = _trench getVariable [QGVAR(diggerCount), 0]; -private _removeTime = getNumber (configFile >> "CfgVehicles" >> (typeof _trench) >> QGVAR(removalDuration)); -private _removeTimeLeft = _removeTime * _actualProgress; +if (_diggerCount > 0) then { + if !(_switchingDigger) then { + [_trench, _unit] call FUNC(addDigger); + }; +}else{ + _trench setVariable [QGVAR(diggerCount), 1,true]; +}; + +private _removeTime = missionNamespace getVariable [getText (configFile >> "CfgVehicles" >> (typeOf _trench) >>"ace_trenches_removalDuration"), 20]; -private _placeData = _trench getVariable [QGVAR(placeData), [[], []]]; -_placeData params ["_basePos", "_vecDirAndUp"]; +private _placeData = _trench getVariable ["ace_trenches_placeData", [[], []]]; +_placeData params ["", "_vecDirAndUp"]; -private _trenchId = _unit getVariable [QGVAR(isDiggingId), -1]; -if(_trenchId < 0) then { - _trenchId = GVAR(trenchId); - _unit setVariable [QGVAR(isDiggingId), _trenchId, true]; - GVAR(trenchId) = GVAR(trenchId) + 1; +if (count _vecDirAndUp == 0) then { + _vecDirAndUp = [vectorDir _trench, vectorUp _trench]; }; // Create progress bar private _fnc_onFinish = { - (_this select 0) params ["_unit", "_trench"]; - _unit setVariable [QGVAR(isDiggingId), -1, true]; + (_this select 0) params ["_unit", "_trench"]; + _trench setVariable [QGVAR(diggingType), nil, true]; // Remove trench deleteVehicle _trench; @@ -50,28 +56,73 @@ private _fnc_onFinish = { [_unit, "", 1] call EFUNC(common,doAnimation); }; private _fnc_onFailure = { - (_this select 0) params ["_unit", "_trench"]; - _unit setVariable [QGVAR(isDiggingId), -1, true]; - _trench setVariable [QGVAR(digging), false, true]; + (_this select 0) params ["_unit", "_trench"]; + _trench setVariable [QGVAR(digging), false, true]; + _trench setVariable [QGVAR(diggingType), nil, true]; - // Save progress global - private _progress = _trench getVariable [QGVAR(progress), 0]; - _trench setVariable [QGVAR(progress), _progress, true]; + // Save progress global + private _progress = _trench getVariable [QGVAR(progress), 0]; + _trench setVariable [QGVAR(progress), _progress, true]; - // Reset animation - [_unit, "", 1] call EFUNC(common,doAnimation); + // Reset animation + [_unit, "", 1] call EFUNC(common,doAnimation); +}; +private _fnc_condition = { + (_this select 0) params ["", "_trench"]; + + if !(_trench getVariable [QGVAR(digging), false]) exitWith {false}; + if (_trench getVariable [QGVAR(diggerCount), 0] <= 0) exitWith {false}; + if (GVAR(stopBuildingAtFatigueMax) && (EGVAR(advanced_fatigue,anReserve) <= 0)) exitWith {false}; + true }; -[(_removeTimeLeft + 0.5), [_unit, _trench], _fnc_onFinish, _fnc_onFailure, localize LSTRING(RemovingTrench)] call EFUNC(common,progressBar); +[[_unit, _trench, false], _fnc_onFinish, _fnc_onFailure, localize "STR_ace_trenches_RemovingTrench", _fnc_condition] call FUNC(progressBar); -private _progressLeft = ((1 - _actualProgress) * 10) + 1; +[{ + params ["_args", "_handle"]; + _args params ["_trench", "_unit", "_removeTime", "_vecDirAndUp"]; + private _actualProgress = _trench getVariable [QGVAR(progress), 0]; + private _diggerCount = _trench getVariable [QGVAR(diggerCount), 0]; -for "_i" from _progressLeft to 10 do { - private _vectorDiffZ = _i / 10; - private _delay = _removeTime * ((_i / 10) - (1 - _actualProgress)); - private _progress = 1 - (_i / 10); + if (_actualProgress <= 0) exitWith { + [_handle] call CBA_fnc_removePerFrameHandler; + _trench setVariable [QGVAR(digging), false, true]; + _trench setVariable [QGVAR(diggerCount), 0, true]; + deleteVehicle _trench; + }; - [DFUNC(setTrenchPlacement), [_unit, _trench, _trenchId, _basePos vectorDiff [0, 0, _vectorDiffZ], _vecDirAndUp, _progress], _delay] call CBA_fnc_waitAndExecute; -}; + if ( + !(_trench getVariable [QGVAR(digging), false]) || + (_diggerCount <= 0) + ) exitWith { + [_handle] call CBA_fnc_removePerFrameHandler; + _trench setVariable [QGVAR(digging), false, true]; + _trench setVariable [QGVAR(diggerCount), ((_diggerCount -1) max 0), true]; + }; + + private _boundingBox = boundingBoxReal _trench; + _boundingBox params ["_lbfc"]; //_lbfc(Left Bottom Front Corner) _rtbc (Right Top Back Corner) + _lbfc params ["", "", "_lbfcZ"]; + + private _pos = (getPosWorld _trench); + private _posDiff = (abs(((_trench getVariable [QGVAR(diggingSteps), 0]) * _diggerCount) + _lbfcZ))/(_removeTime*5); + _pos set [2,((_pos select 2) - _posDiff)]; + + _trench setPosWorld _pos; + _trench setVectorDirAndUp _vecDirAndUp; + + //Fatigue impact + EGVAR(advanced_fatigue,anReserve) = (EGVAR(advanced_fatigue,anReserve) - ((_removeTime /12) * GVAR(buildFatigueFactor))) max 0; + EGVAR(advanced_fatigue,anFatigue) = (EGVAR(advanced_fatigue,anFatigue) + (((_removeTime /12) * GVAR(buildFatigueFactor))/1200)) min 1; + + // Save progress + _trench setVariable [QGVAR(progress), (_actualProgress - ((1/(_removeTime *10)) * _diggerCount)), true]; + + if (GVAR(stopBuildingAtFatigueMax) && (EGVAR(advanced_fatigue,anReserve) <= 0)) exitWith { + [_handle] call CBA_fnc_removePerFrameHandler; + _trench setVariable [QGVAR(digging), false, true]; + _trench setVariable [QGVAR(diggerCount), ((_diggerCount -1) max 0), true]; + }; +},0.1,[_trench, _unit, _removeTime, _vecDirAndUp]] call CBA_fnc_addPerFrameHandler; // Play animation [_unit, "AinvPknlMstpSnonWnonDnon_medic4"] call EFUNC(common,doAnimation); diff --git a/addons/trenches/script_component.hpp b/addons/trenches/script_component.hpp index 338347a1a75..b573853749e 100644 --- a/addons/trenches/script_component.hpp +++ b/addons/trenches/script_component.hpp @@ -2,9 +2,9 @@ #define COMPONENT_BEAUTIFIED Trenches #include "\z\ace\addons\main\script_mod.hpp" -// #define DEBUG_MODE_FULL -// #define DISABLE_COMPILE_CACHE -// #define ENABLE_PERFORMANCE_COUNTERS +#define DEBUG_MODE_FULL +#define DISABLE_COMPILE_CACHE +#define ENABLE_PERFORMANCE_COUNTERS #ifdef DEBUG_ENABLED_TRENCHES #define DEBUG_MODE_FULL @@ -14,4 +14,9 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_TRENCHES #endif +#define DEFAULT_TEXTURE QPATHTOEF(apl,data\zr_plevel_co.paa) +#define CAMOUFLAGE_DURATION 5 +#define CAMOUFLAGE_3DEN_ATTRIBUTE QGVAR(camouflageTrench) +#define IS_TRENCH(OBJ) ((!isNull OBJ) && {isText (configFile >> "CfgVehicles" >> typeOf OBJ >> QGVAR(noGeoClass))}) + #include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/trenches/stringtable.xml b/addons/trenches/stringtable.xml index 9e0c1364dad..4c404e8a555 100644 --- a/addons/trenches/stringtable.xml +++ b/addons/trenches/stringtable.xml @@ -1,6 +1,10 @@ - + + + Trenches + Gräben + Entrenching Tool Klappspaten @@ -32,8 +36,8 @@ 戰備鍬 - Envelope - Small - Rund - Klein + Trench (Envelope - Small) + Schützengraben (Rund - Klein) Wnęka - mała Fascia - Piccola Trinchera pequeña @@ -76,8 +80,8 @@ 蓋小掩體 - Envelope - Big - Rund - Groß + Trench (Envelope - Big) + Schützengraben (Rund - Groß) Wnęka - duża Fascia - Grande Trinchera grande @@ -222,5 +226,220 @@ 移除掩体中 移除掩體中 + + Place camouflage + Tarnung platzieren + Камуфлировать окоп + + + Placing camouflage... + Platziere Tarnung... + Камуфлирую окоп... + + + Remove camouflage + Tarnung entfernen + Убрать камуфляж + + + Removing camouflage... + Entferne Tarnung... + Убираю камуфляж окопа... + + + Envelope - Gigant + Rund - Sehr groß + Огромный окоп + + + Giant Personal Trench + Sehr großer Schützengraben + Огромный окоп для пехоты + + + Dig Giant Trench + Grabe sehr großen Schützengraben + Вырыть огромный окоп + + + Apply camouflage + Tarnung anbringen + Применить камуфляж + + + Apply camouflage to this trench + Tarnung an diesen Graben anbringen + Применить камуфляж к этому окопу + + + Envelope - Vehicle + Rund - Fahrzeug + Окоп для техники + + + Vehicle Trench + Fahrzeug Schützengraben + Окоп для техники + + + Dig Vehicle Trench + Grabe Fahrzeug Schützengraben + Выкопать окоп для техники + + + Envelope - Short + Rund - Kurz + Короткий окоп + + + Short Trench + Kurzer Schützengraben + Короткий окоп + + + Dig Short Trench + Grabe kurzen Schützengraben + Вырыть короткий окоп + + + + ACE Trenches + ACE Trenches + + + Allow digging + Erlaube den Bau von Gräben + Разрешить копать окопы + + + Allow digging trenches with an entrenchment tool + Erlaube den Bau von Gräben mit dem Klappspaten + Разрешить копать окопы лопатой + + + Allow camouflage + Erlaube Tarnung + Разрешить камуфляж + + + Allow camouflaging trenches + Erlaube das Tarnen von Gräben + Разрешить камуфлировать окопы + + + Require entrenchment tool for camouflaging + Klappspaten für Tarnen benötigt + Нужна лопата чтобы камуфлировать окопы + + + Require entrenchment tool for camouflaging + Fordere Klappspaten für das Tarnen von Gräben + Нужна лопата чтобы камуфлировать окопы + + + Allow short envelope trenches + Erlaube kurze runde Gräben + Разрешить короткие окопы + + + Allow digging of short envelope trenches + Erlaube das Graben von kurzen runden Gräben + Разрешить копать короткие окопы + + + Allow small envelope trenches + Erlaube kleine runde Gräben + Разрешить малые окопы + + + Allow digging of small envelope trenches + Erlaube das Graben von kleinen runden Gräben + Разрешить копать малые окопы + + + Allow big envelope trenches + Erlaube große runde Gräben + Разрешить большие окопы + + + Allow digging of big envelope trenches + Erlaube das Graben von großen runden Gräben + Разрешить копать большие окопы + + + Allow giant envelope trenches + Erlaube riesige runde Gräben + Разрешить огромные окопы + + + Allow digging of giant envelope trenches + Erlaube das Graben von riesigen runden Gräben + Разрешить копать огромные окопы + + + Allow vehicle envelope trenches + Erlaube runde Fahrzeuggräben + Разрешить окопы для техники + + + Allow digging of envelope vehicle trenches + Erlaube das Graben von runden Fahrzeuggräben + Разрешить копать окопы для техники + + + Fatigue factor + Ausdauerkoeffizient + Коэффициент усталости + + + The fatigue factor when building trenches (0 to deactive fatigue use) + Der Ausdauerkoeffizient beim Bauen von Gräben (0 zum Deaktivieren) + Как сильно снижается стамина от копания (0 чтобы не снижалась) + + + Dig time (in seconds) for short envelope trenches + Zeit (in Sekunden) um kurze runde Gräben zu graben + Время (в секундах) копания короткого окопа + + + Dig time (in seconds) for small envelope trenches + Zeit (in Sekunden) um kleine runde Gräben zu graben + Время (в секундах) копания малого окопа + + + Dig time (in seconds) for big envelope trenches + Zeit (in Sekunden) um große runde Gräben zu graben + Время (в секундах) копания большого окопа + + + Dig time (in seconds) for gigant envelope trenches + Zeit (in Sekunden) um riesige runde Gräben zu graben + Время (в секундах) копания гигантского окопа + + + Dig time (in seconds) for vehicle envelope trenches + Zeit (in Sekunden) um runde Fahrzeuggräben zu graben + Время (в секундах) копания окопа для техники + + + Help digging + Mit graben + + + Enable Stop on Fatigue + Aktiviere Ausdauerbedingter grabe stop + + + If enabled the digger will stop digging if his fatigue reaches 0. + Wenn aktiviert hören die Spieler auf zu graben wenn ihre Ausdauer 0 erreicht. + + + Enable automatic file path for textures + Aktiviert automatische textur ausfüllung + + + If enabled the mod will try to fill in an automatic path and prefix for the texture files. (WARNING!!!) This can cause errors! + Wenn es aktiviert ist, versucht die Mod automatisch einen Pfad und preFix für die Map zu finden. (WARNUNG!!!) Kann zu Fehlern führen! +