From 434e17560f38aab90f2402a208e2d7852b795988 Mon Sep 17 00:00:00 2001 From: am195 Date: Thu, 6 Nov 2014 22:32:58 -0500 Subject: [PATCH 1/2] Better Explosive Attachment Allows for better explosive attachment on the undersides of vehicles 3 seconds where the placement will happen on first collision after three seconds default behavior --- AGM_Explosives/functions/fn_SetupExplosive.sqf | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/AGM_Explosives/functions/fn_SetupExplosive.sqf b/AGM_Explosives/functions/fn_SetupExplosive.sqf index e80ccb460..da41842e0 100644 --- a/AGM_Explosives/functions/fn_SetupExplosive.sqf +++ b/AGM_Explosives/functions/fn_SetupExplosive.sqf @@ -26,6 +26,7 @@ _this spawn { _config = _this select 2; _timer = _this select 3; AGM_Explosives_placer = _unit; + // Commented out due to the fact there is a distinction between who can deactivate mines and who can plant them in standard configs. // Would require custom config entries (AGM_ExplosiveSpecialist/AGM_Specialist) which excludes custom mods. //if ((AGM_Explosives_RequireSpecialist > 0) && {!([_unit] call AGM_Core_fnc_isEOD)}) exitWith {}; @@ -35,13 +36,14 @@ _this spawn { AGM_Explosives_Setup = getText(ConfigFile >> "CfgMagazines" >> _class >> "AGM_SetupObject") createVehicleLocal [0,0,-10000]; - AGM_Explosives_Setup enableSimulationGlobal false; + //AGM_Explosives_Setup enableSimulationGlobal false; AGM_Explosives_Setup setVariable ["AGM_Class", _class]; AGM_Explosives_Setup setVariable ["AGM_Trigger", _config]; //AGM_Explosives_Setup setVariable ["AGM_Offset", GetArray(ConfigFile >> "CfgVehicles" >> typeof AGM_Explosives_Setup >> "AGM_Offset")]; if (!isNil "_timer") then { AGM_Explosives_Setup setVariable ["AGM_Timer", _timer]; }; + AGM_Explosives_Setup setVariable ["AGM_Enable_Place", 0]; _unit forceWalk true; AGM_Explosives_TweakedAngle = 180; @@ -59,7 +61,15 @@ _this spawn { AGM_Explosives_Setup setDir (AGM_Explosives_TweakedAngle + getDir _player); }; }] call BIS_fnc_addStackedEventHandler; + AGM_Explosives_Setup addEventHandler ["EpeContactStart", { + private ["_enabled"]; + AGM_Explosives_Setup = _this select 0; + _enabled = AGM_Explosives_Setup getVariable ["AGM_Enable_Place", 0]; + if (_enabled == 1) then{ + call AGM_Explosives_fnc_Place_Approve; + }; + }]; [localize "STR_AGM_Explosives_PlaceAction", localize "STR_AGM_Explosives_CancelAction",localize "STR_AGM_Explosives_ScrollAction"] call AGM_Interaction_fnc_showMouseHint; - _unit setVariable ["AGM_Explosive_Place", [_unit, "DefaultAction", {AGM_Explosives_pfeh_running AND !isNull (AGM_Explosives_setup)}, {call AGM_Explosives_fnc_Place_Approve;}] call AGM_Core_fnc_AddActionEventHandler]; + _unit setVariable ["AGM_Explosive_Place", [_unit, "DefaultAction", {AGM_Explosives_pfeh_running AND !isNull (AGM_Explosives_setup)}, {AGM_Explosives_Setup setVariable ["AGM_Enable_Place", 1]; sleep(3);AGM_Explosives_Setup enableSimulationGlobal false;call AGM_Explosives_fnc_Place_Approve;}] call AGM_Core_fnc_AddActionEventHandler]; _unit setVariable ["AGM_Explosive_Cancel", [_unit, "MenuBack", {AGM_Explosives_pfeh_running AND !isNull (AGM_Explosives_setup)}, {call AGM_Explosives_fnc_Place_Cancel;}] call AGM_Core_fnc_AddActionEventHandler]; }; From f7fd06e10b16c570671e3265ccb91f29a61c660c Mon Sep 17 00:00:00 2001 From: am195 Date: Mon, 10 Nov 2014 18:52:24 -0500 Subject: [PATCH 2/2] Fixing Explosive Attachment Less Jank --- AGM_Explosives/functions/fn_SetupExplosive.sqf | 14 ++++++++++++-- AGM_Explosives/stringtable.xml | 14 +++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/AGM_Explosives/functions/fn_SetupExplosive.sqf b/AGM_Explosives/functions/fn_SetupExplosive.sqf index da41842e0..37d3a56cc 100644 --- a/AGM_Explosives/functions/fn_SetupExplosive.sqf +++ b/AGM_Explosives/functions/fn_SetupExplosive.sqf @@ -62,14 +62,24 @@ _this spawn { }; }] call BIS_fnc_addStackedEventHandler; AGM_Explosives_Setup addEventHandler ["EpeContactStart", { - private ["_enabled"]; + private ["_enabled","_disable"]; AGM_Explosives_Setup = _this select 0; _enabled = AGM_Explosives_Setup getVariable ["AGM_Enable_Place", 0]; if (_enabled == 1) then{ call AGM_Explosives_fnc_Place_Approve; }; + _disable=0; + _disable }]; [localize "STR_AGM_Explosives_PlaceAction", localize "STR_AGM_Explosives_CancelAction",localize "STR_AGM_Explosives_ScrollAction"] call AGM_Interaction_fnc_showMouseHint; - _unit setVariable ["AGM_Explosive_Place", [_unit, "DefaultAction", {AGM_Explosives_pfeh_running AND !isNull (AGM_Explosives_setup)}, {AGM_Explosives_Setup setVariable ["AGM_Enable_Place", 1]; sleep(3);AGM_Explosives_Setup enableSimulationGlobal false;call AGM_Explosives_fnc_Place_Approve;}] call AGM_Core_fnc_AddActionEventHandler]; + _unit setVariable ["AGM_Explosive_Place", [_unit, "DefaultAction", {AGM_Explosives_pfeh_running AND !isNull (AGM_Explosives_setup)}, { + _unit = call AGM_Core_fnc_player; + AGM_Explosives_Setup setVariable ["AGM_Enable_Place", 1]; + AGM_Explosives_Setup enableSimulationGlobal true; + [_unit, "DefaultAction", _unit getVariable ["AGM_Explosive_Place", -1]] call AGM_Core_fnc_removeActionEventHandler; + call AGM_Interaction_fnc_hideMouseHint; + [localize "STR_AGM_Explosives_PlantAction", localize "STR_AGM_Explosives_CancelAction",localize "STR_AGM_Explosives_ScrollAction"] call AGM_Interaction_fnc_showMouseHint; + _unit setVariable ["AGM_Explosive_Place", [_unit, "DefaultAction", {AGM_Explosives_pfeh_running AND !isNull (AGM_Explosives_setup)}, {AGM_Explosives_Setup enableSimulationGlobal false; call AGM_Explosives_fnc_Place_Approve;}] call AGM_Core_fnc_AddActionEventHandler]; + }] call AGM_Core_fnc_AddActionEventHandler]; _unit setVariable ["AGM_Explosive_Cancel", [_unit, "MenuBack", {AGM_Explosives_pfeh_running AND !isNull (AGM_Explosives_setup)}, {call AGM_Explosives_fnc_Place_Cancel;}] call AGM_Core_fnc_AddActionEventHandler]; }; diff --git a/AGM_Explosives/stringtable.xml b/AGM_Explosives/stringtable.xml index 3602ea35d..3f23eebcd 100644 --- a/AGM_Explosives/stringtable.xml +++ b/AGM_Explosives/stringtable.xml @@ -55,7 +55,19 @@ Platzieren Colocar Umieść - Placer + Mettre + Položit + Piazza + Elhelyezés + Colocar + Положить + + + Plant + Platzieren + Colocar + Umieść + Poser Položit Piazza Elhelyezés