diff --git a/description.ext b/description.ext index fc424f8..400ebd2 100644 --- a/description.ext +++ b/description.ext @@ -2,14 +2,15 @@ class CfgFunctions { createShortcuts = 1; + #include "scripts\diary\funcs.hpp" // ingame documentation (as diary entries in the map screen) #include "scripts\arsr\funcs.hpp" // enable sound directionfinder #include "scripts\stomper\funcs.hpp" // enable sitting on Stomper UGV #include "scripts\craters\funcs.hpp" // terrain deformation on artillery impacts #include "scripts\lgshells\funcs.hpp" // fix for unreliable vanilla laser guided shells - #include "scripts\spot-randomizer\funcs.hpp" // handle randomization of supply containers #include "scripts\tfar-persistence\funcs.hpp" // restore previous TFAR settings after respawn - #include "scripts\grad-loadout\CfgFunctions.hpp" // Gruppe Adler loadout handling #include "scripts\shelltracker\funcs.hpp" // display of artillery shells for Zeus and streamers + #include "scripts\grad-loadout\CfgFunctions.hpp" // Gruppe Adler loadout handling + #include "scripts\spot-randomizer\funcs.hpp" // handle randomization of supply containers }; diff --git a/initPlayerLocal.sqf b/initPlayerLocal.sqf index 538dc6c..7c76b20 100644 --- a/initPlayerLocal.sqf +++ b/initPlayerLocal.sqf @@ -72,6 +72,15 @@ fnc_TFAR_Boost_RadioTower_Loop = { [fnc_TFAR_Boost_RadioTower_Loop, 2] call CBA_fnc_addPerFrameHandler; +// store last unloaded Mk6 mortar +// (as workaround for https://github.com/acemod/ACE3/issues/10010) +["ace_cargoUnloaded", { + params ["_item", "_vehicle", "_unloadType"]; + if (_item isKindOf "Mortar_01_base_F") then { + localNamespace setVariable ["shootnscoot_lastUnloadedMortar", _item]; + }; +}] call CBA_fnc_addEventHandler; + // prevent map markers because this would be too easy // --> we want to foster teamplay through radio comms instead diff --git a/scripts/diary/funcs.hpp b/scripts/diary/funcs.hpp new file mode 100644 index 0000000..e45001f --- /dev/null +++ b/scripts/diary/funcs.hpp @@ -0,0 +1,8 @@ +class diary { + tag = "diary"; + class functions { + file = "scripts\diary\functions"; + class postInit{postInit = 1;}; + class placeMortarOnTerrain{}; + }; +}; diff --git a/scripts/diary/functions/fn_placeMortarOnTerrain.sqf b/scripts/diary/functions/fn_placeMortarOnTerrain.sqf new file mode 100644 index 0000000..fae9471 --- /dev/null +++ b/scripts/diary/functions/fn_placeMortarOnTerrain.sqf @@ -0,0 +1,27 @@ +/*///////////////////////////////////////////////// +Author: Bernhard + +File: fn_placeMortarOnTerrain.sqf +Parameters: +Return: none + +This function is a workaround for a suspected ACE glitch. + +During unloading of mortars quite a lot of them disappear. +They are then located below the surface. + +Using this function they are being brought back to the surface. + +See https://github.com/acemod/ACE3/issues/10010 for more information. + +*/////////////////////////////////////////////// + +private _mortar = localNamespace getVariable "shootnscoot_lastUnloadedMortar"; + +if (!isNil "_mortar") then { + private _pos = getPosATL _mortar; + diag_log format ["fn_placeMortarOnTerrain.sqf: getPosATL=%1", _pos]; // logging output might help to narrow down the problem + _mortar setPosATL [_pos#0, _pos#1, 0]; // place at same x and y coordinate, but with z coordinate on the surface +} else { + hint parseText "This restore function works on the last mortar that you've unloaded.
You haven`t unloaded a mortar yet."; +}; diff --git a/scripts/diary/functions/fn_postInit.sqf b/scripts/diary/functions/fn_postInit.sqf new file mode 100644 index 0000000..d455488 --- /dev/null +++ b/scripts/diary/functions/fn_postInit.sqf @@ -0,0 +1,13 @@ +if !(hasInterface) exitWith {}; + +// create root of ingame documentation +player createDiarySubject ["shootnscoot_diarySubject","Shoot and Scoot"]; + +// create documentation topics for different game aspects + +// mortar docu +player createDiaryRecord ["shootnscoot_diarySubject", ["Mortar","During past games quite a few Mk6 mortars got lost after unloading them from the vehicle.
+Using the link below you should be able to restore them.
+Fix lost mortar
+
+In case it doesn't work for you --> ping Zeus"]];