From 811530f18000eae5b1dc47b455236f0aad84ad7e Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 26 Mar 2015 00:53:02 -0500 Subject: [PATCH 01/39] Ensure captiveNum is reset for respawning unit --- addons/captives/CfgEventHandlers.hpp | 8 ++++++ addons/captives/XEH_preInit.sqf | 1 + .../captives/functions/fnc_handleRespawn.sqf | 25 +++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 addons/captives/functions/fnc_handleRespawn.sqf diff --git a/addons/captives/CfgEventHandlers.hpp b/addons/captives/CfgEventHandlers.hpp index 0ce09280a7..9d1a69f4fd 100644 --- a/addons/captives/CfgEventHandlers.hpp +++ b/addons/captives/CfgEventHandlers.hpp @@ -41,3 +41,11 @@ class Extended_InitPost_EventHandlers { }; }; }; +//make sure captiveNum is reset on respawn +class Extended_Respawn_EventHandlers { + class CAManBase { + class ADDON { + respawn = QUOTE(_this call FUNC(handleRespawn)); + }; + }; +}; diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf index c09f81e51b..bc6a61bc4f 100644 --- a/addons/captives/XEH_preInit.sqf +++ b/addons/captives/XEH_preInit.sqf @@ -21,6 +21,7 @@ PREP(handleGetOut); PREP(handleKilled); PREP(handleOnUnconscious); PREP(handlePlayerChanged); +PREP(handleRespawn); PREP(handleUnitInitPost); PREP(handleZeusDisplayChanged); PREP(moduleSurrender); diff --git a/addons/captives/functions/fnc_handleRespawn.sqf b/addons/captives/functions/fnc_handleRespawn.sqf new file mode 100644 index 0000000000..fe2bc0a968 --- /dev/null +++ b/addons/captives/functions/fnc_handleRespawn.sqf @@ -0,0 +1,25 @@ +/* + * Author: commy2 PabstMirror + * Fix, because captiveNum doesn't reset properly on respawn + * + * Arguments: + * 0: Unit + * 1: Corpse + * + * Return Value: + * Nothing + * + * Example: + * [alive, body] call ACE_captives_fnc_handleRespawn; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_2(_unit,_dead); + +if (!local _unit) exitWith {}; + +[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus); +[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus); + From d4d0a0a6de53f9f688eaaf6d05d856371ec0c72e Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 26 Mar 2015 00:53:38 -0500 Subject: [PATCH 02/39] Make sure to remove animEH --- addons/captives/functions/fnc_handleKilled.sqf | 4 ++-- addons/captives/functions/fnc_handleRespawn.sqf | 1 - addons/captives/functions/fnc_setSurrendered.sqf | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/captives/functions/fnc_handleKilled.sqf b/addons/captives/functions/fnc_handleKilled.sqf index 9e9c5e1ac8..720bde9df7 100644 --- a/addons/captives/functions/fnc_handleKilled.sqf +++ b/addons/captives/functions/fnc_handleKilled.sqf @@ -18,7 +18,7 @@ PARAMS_1(_oldUnit); if (_oldUnit getVariable [QGVAR(isHandcuffed), false]) then { - _oldUnit setVariable [QGVAR(isHandcuffed), false, true]; + [_oldUnit, false] call FUNC(setSurrendered); }; if (_oldUnit getVariable [QGVAR(isEscorting), false]) then { @@ -26,5 +26,5 @@ if (_oldUnit getVariable [QGVAR(isEscorting), false]) then { }; if (_oldUnit getVariable [QGVAR(isSurrendering), false]) then { - _oldUnit setVariable [QGVAR(isSurrendering), false, true]; + [_oldUnit, false] call FUNC(setSurrendered); }; diff --git a/addons/captives/functions/fnc_handleRespawn.sqf b/addons/captives/functions/fnc_handleRespawn.sqf index fe2bc0a968..8a475f860d 100644 --- a/addons/captives/functions/fnc_handleRespawn.sqf +++ b/addons/captives/functions/fnc_handleRespawn.sqf @@ -22,4 +22,3 @@ if (!local _unit) exitWith {}; [_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus); [_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus); - diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 3a7436abc7..73451863dd 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -75,6 +75,7 @@ if (_state) then { }; }; + if (!alive _unit) exitWith {}; if (_unit getVariable ["ACE_isUnconscious", false]) exitWith {}; //don't touch animations if unconscious //if we are in "hands up" animationState, crack it now From 14cbceef9755e9ee4e1cafe46f07f15e65b145b0 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 26 Mar 2015 14:21:26 -0500 Subject: [PATCH 03/39] Rerun set func when respawn into captive unit --- .../captives/functions/fnc_handleRespawn.sqf | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/addons/captives/functions/fnc_handleRespawn.sqf b/addons/captives/functions/fnc_handleRespawn.sqf index 8a475f860d..02888c27a0 100644 --- a/addons/captives/functions/fnc_handleRespawn.sqf +++ b/addons/captives/functions/fnc_handleRespawn.sqf @@ -20,5 +20,20 @@ PARAMS_2(_unit,_dead); if (!local _unit) exitWith {}; -[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus); -[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus); +//With respawn="group", we could be respawning into a unit that is handcuffed/captive +//If they are, reset and rerun the SET function +//if not, make sure to explicity disable the setCaptivityStatus, because captiveNum does not work correctly on respawn + +if (_unit getVariable [QGVAR(isHandcuffed), false]) then { + _unit setVariable [QGVAR(isHandcuffed), false]; + [_unit, true] call FUNC(setHandcuffed); +} else { + [_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus); +}; + +if (_unit getVariable [QGVAR(isSurrendering), false]) then { + _unit setVariable [QGVAR(isSurrendering), false]; + [_unit, true] call FUNC(setSurrendered); +} else { + [_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus); +}; From 9ae4f39d054bbb700ce0834855158f7a961fffdf Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 26 Mar 2015 17:49:11 -0500 Subject: [PATCH 04/39] Binary Seach for attach pos --- addons/attach/functions/fnc_placeApprove.sqf | 32 +++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index c6277e2961..6b76dad3f9 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -15,8 +15,7 @@ */ #include "script_component.hpp" -private ["_setupObject", "_setupClassname", "_itemClassname", "_placementText", "_attachToVehicle", "_placer", "_startingPosition", "_startingOffset", "_distanceFromCenter", "_closeInUnitVector", "_keepGoingCloser", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"]; - +private ["_setupObject", "_setupClassname", "_itemClassname", "_placementText", "_attachToVehicle", "_placer", "_startingPosition", "_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_keepGoingCloser", "_closeInMax", "_closeInMin", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"]; if (GVAR(pfeh_running)) then { [QGVAR(PlacementEachFrame),"OnEachFrame"] call BIS_fnc_removeStackedEventHandler; @@ -50,20 +49,23 @@ call EFUNC(interaction,hideMouseHint); _startingPosition = _setupObject modelToWorld [0,0,0]; _startingOffset = _attachToVehicle worldToModel _startingPosition; -_distanceFromCenter = vectorMagnitude _startingOffset; +_startDistanceFromCenter = vectorMagnitude _startingOffset; _closeInUnitVector = vectorNormalized (_startingOffset vectorFromTo [0,0,0]); _keepGoingCloser = true; -_closeInDistance = 0; -while {_keepGoingCloser} do { - if (_closeInDistance >= _distanceFromCenter) exitWith {}; +_closeInMax = _startDistanceFromCenter; +_closeInMin = 0; - _closeInDistance = _closeInDistance + 0.01; //10mm each step +while {(_closeInMax - _closeInMin) > 0.01} do { + _closeInDistance = (_closeInMax + _closeInMin) / 2; + // systemChat format ["Trying %1 from %2 start %3", _closeInDistance, [_closeInMax, _closeInMin], _startDistanceFromCenter]; _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); _endPosTestOffset set [2, (_startingOffset select 2)]; _endPosTest = _attachToVehicle modelToWorld _endPosTestOffset; + _doesIntersect = false; { + if (_doesIntersect) exitWith {}; _startingPosShifted = _startingPosition vectorAdd _x; _startASL = if (surfaceIsWater _startingPosShifted) then {_startingPosShifted} else {ATLtoASL _startingPosShifted}; { @@ -73,21 +75,29 @@ while {_keepGoingCloser} do { //Uncomment to see the lazor show, and see how the scanning works: drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]]; - if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _placer, _setupObject]) exitWith {_keepGoingCloser = false}; + if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _placer, _setupObject]) exitWith {_doesIntersect = true}; } forEach [[0,0,0.045], [0,0,-0.045], [0,0.045,0], [0,-0.045,0], [0.045,0,0], [-0.045,0,0]]; } forEach [[0,0,0], [0,0,0.05], [0,0,-0.05]]; + + if (_doesIntersect) then { + _closeInMax = _closeInDistance; + } else { + _closeInMin = _closeInDistance; + }; }; +_closeInDistance = (_closeInMax + _closeInMin) / 2; + //Delete Local Placement Object deleteVehicle _setupObject; //Checks -if ((_closeInDistance >= _distanceFromCenter) || (!([_placer,_attachToVehicle,_itemClassname] call FUNC(canAttach)))) exitWith { - TRACE_2("no valid spot found",_closeInDistance,_distanceFromCenter); +if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_placer,_attachToVehicle,_itemClassname] call FUNC(canAttach))}) exitWith { + TRACE_2("no valid spot found",_closeInDistance,_startDistanceFromCenter); [localize "STR_ACE_Attach_Failed"] call EFUNC(common,displayTextStructured); }; -//Move it out slightly, for visability sake (better to look a little funny than be embedded//sunk in the hull) +//Move it out slightly, for visability sake (better to look a little funny than be embedded//sunk in the hull and be useless) _closeInDistance = (_closeInDistance - 0.0085); //Create New 'real' Object From efe57461b5da6e03826ab3f0376a33a9516f4a9f Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 26 Mar 2015 20:05:30 -0500 Subject: [PATCH 05/39] misc --- addons/attach/CfgVehicles.hpp | 8 ++++---- addons/attach/functions/fnc_attach.sqf | 6 ++++-- addons/attach/functions/fnc_canAttach.sqf | 5 +++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/addons/attach/CfgVehicles.hpp b/addons/attach/CfgVehicles.hpp index 15eca2fb62..328ec851ed 100644 --- a/addons/attach/CfgVehicles.hpp +++ b/addons/attach/CfgVehicles.hpp @@ -4,9 +4,9 @@ class ACE_MainActions { \ class GVAR(AttachVehicle) { \ displayName = "$STR_ACE_Attach_AttachDetach"; \ - condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \ + condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canAttach))); \ statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \ - exceptions[] = {"isNotDragging"}; \ + exceptions[] = {}; \ showDisabled = 0; \ priority = 0; \ icon = PATHTOF(UI\attach_ca.paa); \ @@ -16,7 +16,7 @@ displayName = "$STR_ACE_Attach_Detach"; \ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \ statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \ - exceptions[] = {"isNotDragging"}; \ + exceptions[] = {}; \ showDisabled = 0; \ priority = 0; \ icon = PATHTOF(UI\detach_ca.paa); \ @@ -55,7 +55,7 @@ class CfgVehicles { class ACE_Equipment { class GVAR(Attach) { displayName = "$STR_ACE_Attach_AttachDetach"; - condition = QUOTE(([ARR_3(_player, _player, '')] call FUNC(canAttach))); + condition = QUOTE(([ARR_2(_player, _player)] call FUNC(canAttach))); statement = QUOTE( [ARR_2(_player, _player)] call FUNC(openAttachUI); ); exceptions[] = {"isNotDragging"}; showDisabled = 0; diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 655cac598b..733a9c81eb 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -83,8 +83,10 @@ if (_unit == _attachToVehicle) then { //Self Attachment }] call BIS_fnc_addStackedEventHandler; // @todo replace with CBA PFH //had to delay the mouseHint, not sure why - [{[localize "STR_ACE_Attach_PlaceAction", localize "STR_ACE_Attach_CancelAction"] call EFUNC(interaction,showMouseHint)}, [], 0, 0] call EFUNC(common,waitAndExecute); + // [{[localize "STR_ACE_Attach_PlaceAction", localize "STR_ACE_Attach_CancelAction"] call EFUNC(interaction,showMouseHint)}, [], 0, 0] call EFUNC(common,waitAndExecute); + //RMB is unusable for now, so don't show it: + [{[localize "STR_ACE_Attach_PlaceAction", ""] call EFUNC(interaction,showMouseHint)}, [], 0, 0] call EFUNC(common,waitAndExecute); _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {GVAR(pfeh_running) && {!isNull (GVAR(setupObject))}}, {call FUNC(placeApprove);}] call EFUNC(common,AddActionEventHandler)]; - _unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {GVAR(pfeh_running) && {!isNull (GVAR(setupObject))}}, {call FUNC(placeCancel);}] call EFUNC(common,AddActionEventHandler)]; + // _unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {GVAR(pfeh_running) && {!isNull (GVAR(setupObject))}}, {call FUNC(placeCancel);}] call EFUNC(common,AddActionEventHandler)]; }; diff --git a/addons/attach/functions/fnc_canAttach.sqf b/addons/attach/functions/fnc_canAttach.sqf index 1c33f7b112..d4095570ef 100644 --- a/addons/attach/functions/fnc_canAttach.sqf +++ b/addons/attach/functions/fnc_canAttach.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: unit doing the attach (player) * 1: vehicle that it will be attached to (player or vehicle) - * 2: Name of the attachable item + * 2: Name of the attachable item * * Return Value: * Boolean @@ -17,7 +17,8 @@ */ #include "script_component.hpp" -PARAMS_3(_unit,_attachToVehicle,_item); +PARAMS_2(_unit,_attachToVehicle); +DEFAULT_PARAM(2,_item,""); private ["_attachLimit", "_attachedObjects"]; From d03e47407511444a642785bee6da41ffe263695e Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 27 Mar 2015 00:02:54 -0500 Subject: [PATCH 06/39] Replace selection dialog with interact children --- addons/attach/CfgVehicles.hpp | 22 +++---- addons/attach/XEH_preInit.sqf | 1 + addons/attach/functions/fnc_attach.sqf | 16 +++-- addons/attach/functions/fnc_canAttach.sqf | 20 +++--- addons/attach/functions/fnc_canDetach.sqf | 6 +- addons/attach/functions/fnc_detach.sqf | 8 +-- .../fnc_getChildrenAttachActions.sqf | 51 ++++++++++++++ addons/attach/functions/fnc_openAttachUI.sqf | 66 ------------------- addons/attach/functions/fnc_placeApprove.sqf | 2 +- 9 files changed, 92 insertions(+), 100 deletions(-) create mode 100644 addons/attach/functions/fnc_getChildrenAttachActions.sqf delete mode 100644 addons/attach/functions/fnc_openAttachUI.sqf diff --git a/addons/attach/CfgVehicles.hpp b/addons/attach/CfgVehicles.hpp index 328ec851ed..91155956d1 100644 --- a/addons/attach/CfgVehicles.hpp +++ b/addons/attach/CfgVehicles.hpp @@ -4,9 +4,9 @@ class ACE_MainActions { \ class GVAR(AttachVehicle) { \ displayName = "$STR_ACE_Attach_AttachDetach"; \ - condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canAttach))); \ - statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \ - exceptions[] = {}; \ + condition = QUOTE(_this call FUNC(canAttach)); \ + insertChildren = QUOTE(_this call FUNC(getChildrenAttachActions)); \ + exceptions[] = {"isNotDragging"}; \ showDisabled = 0; \ priority = 0; \ icon = PATHTOF(UI\attach_ca.paa); \ @@ -14,9 +14,9 @@ }; \ class GVAR(DetachVehicle) { \ displayName = "$STR_ACE_Attach_Detach"; \ - condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \ - statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \ - exceptions[] = {}; \ + condition = QUOTE(_this call FUNC(canDetach)); \ + statement = QUOTE(_this call FUNC(detach) ); \ + exceptions[] = {"isNotDragging"}; \ showDisabled = 0; \ priority = 0; \ icon = PATHTOF(UI\detach_ca.paa); \ @@ -55,18 +55,18 @@ class CfgVehicles { class ACE_Equipment { class GVAR(Attach) { displayName = "$STR_ACE_Attach_AttachDetach"; - condition = QUOTE(([ARR_2(_player, _player)] call FUNC(canAttach))); - statement = QUOTE( [ARR_2(_player, _player)] call FUNC(openAttachUI); ); + condition = QUOTE(_this call FUNC(canAttach)); + insertChildren = QUOTE(_this call FUNC(getChildrenAttachActions)); exceptions[] = {"isNotDragging"}; showDisabled = 0; priority = 5; icon = PATHTOF(UI\attach_ca.paa); - hotkey = "T"; + // hotkey = "T"; }; class GVAR(Detach) { displayName = "$STR_ACE_Attach_Detach"; - condition = QUOTE(([ARR_2(_player, _player)] call FUNC(canDetach))); - statement = QUOTE( [ARR_2(_player, _player)] call FUNC(detach) ); + condition = QUOTE(_this call FUNC(canDetach)); + statement = QUOTE(_this call FUNC(detach)); exceptions[] = {"isNotDragging"}; showDisabled = 0; priority = 5; diff --git a/addons/attach/XEH_preInit.sqf b/addons/attach/XEH_preInit.sqf index 63eb2e8438..d11a3992b5 100644 --- a/addons/attach/XEH_preInit.sqf +++ b/addons/attach/XEH_preInit.sqf @@ -6,6 +6,7 @@ PREP(attach); PREP(canAttach); PREP(canDetach); PREP(detach); +PREP(getChildrenAttachActions); PREP(openAttachUI); PREP(placeApprove); PREP(placeCancel); diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 733a9c81eb..6486a55d5f 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -3,9 +3,9 @@ * Attach an item to the unit * * Arguments: - * 0: unit doing the attach (player) - * 1: vehicle that it will be attached to (player or vehicle) - * 2: Name of the attachable item + * 0: vehicle that it will be attached to (player or vehicle) + * 1: unit doing the attach (player) + * 2: Array containing a string of the attachable item * * Return Value: * Nothing @@ -17,12 +17,14 @@ */ #include "script_component.hpp" -PARAMS_3(_unit,_attachToVehicle,_itemName); +PARAMS_3(_attachToVehicle,_unit,_args); + +private ["_item", "_itemVehClass", "_onAtachText", "_selfAttachPosition"]; + +_itemName = [_args, 0, ""] call CBA_fnc_defaultParam; //Sanity Check (_unit has item in inventory, not over attach limit) -if !([_unit, _attachToVehicle, _itemName] call FUNC(canAttach)) exitWith {ERROR("Tried to attach, but check failed");}; - -private ["_itemVehClass", "_onAtachText", "_selfAttachPosition"]; +if ((_itemName == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR("Tried to attach, but check failed");}; _itemVehClass = ""; _onAtachText = ""; diff --git a/addons/attach/functions/fnc_canAttach.sqf b/addons/attach/functions/fnc_canAttach.sqf index d4095570ef..fb83b44d26 100644 --- a/addons/attach/functions/fnc_canAttach.sqf +++ b/addons/attach/functions/fnc_canAttach.sqf @@ -3,9 +3,9 @@ * Check if a unit can attach a specific item. * * Arguments: - * 0: unit doing the attach (player) - * 1: vehicle that it will be attached to (player or vehicle) - * 2: Name of the attachable item + * 0: vehicle that it will be attached to (player or vehicle) + * 1: unit doing the attach (player) + * 2: Array empty or containing a string of the attachable item * * Return Value: * Boolean @@ -17,12 +17,16 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_attachToVehicle); -DEFAULT_PARAM(2,_item,""); +PARAMS_3(_attachToVehicle,_player,_args); -private ["_attachLimit", "_attachedObjects"]; +private ["_itemName", "_attachLimit", "_attachedObjects"]; -_attachLimit = [10, 1] select (_unit == _attachToVehicle); +_itemName = [_args, 0, ""] call CBA_fnc_defaultParam; +_attachLimit = [6, 1] select (_player == _attachToVehicle); _attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; -canStand _unit && {alive _attachToVehicle} && {count _attachedObjects < _attachLimit} && {_item in (itemsWithMagazines _unit + [""])} +_ret = (canStand _player) && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])}; + +systemChat format ["[%1] Checking = %2", _itemName, _ret ]; +x = _this; +_ret diff --git a/addons/attach/functions/fnc_canDetach.sqf b/addons/attach/functions/fnc_canDetach.sqf index ad2f68776c..a32440e56e 100644 --- a/addons/attach/functions/fnc_canDetach.sqf +++ b/addons/attach/functions/fnc_canDetach.sqf @@ -3,8 +3,8 @@ * Check if a unit has an item attached and if it can remove that item. * * Arguments: - * 0: unit doing the detaching (player) - * 1: vehicle that it will be detached from (player or vehicle) + * 0: vehicle that it will be detached from (player or vehicle) + * 1: unit doing the detaching (player) * * Return Value: * Boolean @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_attachToVehicle); +PARAMS_2(_attachToVehicle,_unit); private ["_attachedObjects", "_inRange"]; diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index 7b0d82dec1..0386f5452a 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -3,20 +3,20 @@ * Detach an item from a unit * * Arguments: - * 0: unit doing the attaching (player) - * 1: vehicle that it will be detached from (player or vehicle) + * 0: vehicle that it will be detached from (player or vehicle) + * 1: unit doing the detaching (player) * * Return Value: * Nothing * * Example: - * Nothing + * [car, bob] call ace_attach_fnc_detach * * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_attachToVehicle); +PARAMS_2(_attachToVehicle,_unit); private ["_attachedObjects", "_attachedItems"]; diff --git a/addons/attach/functions/fnc_getChildrenAttachActions.sqf b/addons/attach/functions/fnc_getChildrenAttachActions.sqf new file mode 100644 index 0000000000..13d0d0d84c --- /dev/null +++ b/addons/attach/functions/fnc_getChildrenAttachActions.sqf @@ -0,0 +1,51 @@ +/* + * Author: Garth de Wet (LH), PabstMirror + * Show the ammo counts for a static weapon. + * Called from "insertChildren" on interact_menu + * + * Argument: + * 0: Target + * 1: Player + * + * Return value: + * ChildActiosn + * + * Example: + * [player, player] call ace_attach_fnc_getChildrenAttachActions + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_2(_target,_player); + +_listed = []; +_actions = []; + +{ + if !(_x in _listed) then { + _listed pushBack _x; + _item = ConfigFile >> "CfgMagazines" >> _x; + if (getNumber (_item >> "ACE_Attachable") == 1) then { + _displayName = getText(_item >> "displayName"); + _picture = getText(_item >> "picture"); + _action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); + _actions pushBack [_action, [], _target]; + }; + }; +} forEach (magazines _player); + +{ + if !(_x in _listed) then { + _listed pushBack _x; + _item = ConfigFile >> "CfgWeapons" >> _x; + if (getNumber (_item >> "ACE_Attachable") == 1) then { + _displayName = getText(_item >> "displayName"); + _picture = getText(_item >> "picture"); + _action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, _x] call EFUNC(interact_menu,createAction); + _actions pushBack [_action, [], _target]; + }; + }; +} forEach (items _player); + +_actions diff --git a/addons/attach/functions/fnc_openAttachUI.sqf b/addons/attach/functions/fnc_openAttachUI.sqf deleted file mode 100644 index 1b95be9b84..0000000000 --- a/addons/attach/functions/fnc_openAttachUI.sqf +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Author: Garth de Wet (LH) - * Opens the UI for attaching objects. - * - * Arguments: - * 0: unit - * 1: target - * - * Return Value: - * Nothing - * - * Example: - * Nothing - * - * Public: No - */ -#include "script_component.hpp" - -private ["_actions", "_attachables", "_item"]; - -PARAMS_2(_unit,_target); - -GVAR(attachTarget) = _target; -_listed = []; -_attachables = magazines _unit; -_actions = [localize "STR_ACE_Attach_AttachDetach", localize "STR_ACE_Attach_Attach"] call EFUNC(interaction,prepareSelectMenu); -{ - if !(_x in _listed) then { - _item = ConfigFile >> "CfgMagazines" >> _x; - if (getNumber (_item >> "ACE_Attachable") == 1) then { - _actions = [ - _actions, - getText(_item >> "displayName"), - getText(_item >> "picture"), - _x - ] call EFUNC(interaction,addSelectableItem); - }; - _listed pushBack _x; - }; -} forEach _attachables; -_attachables = items _unit; -{ - if !(_x in _listed) then { - _item = ConfigFile >> "CfgWeapons" >> _x; - if (getNumber (_item >> "ACE_Attachable") == 1) then { - _actions = [ - _actions, - getText(_item >> "displayName"), - getText(_item >> "picture"), - _x - ] call EFUNC(interaction,addSelectableItem); - }; - _listed pushBack _x; - }; -} forEach _attachables; - -[ - _actions, - { - [ACE_player, GVAR(attachTarget), _this] call FUNC(attach); - call EFUNC(interaction,hideMenu); - }, - { - call EFUNC(interaction,hideMenu); - } -] call EFUNC(interaction,openSelectMenu); diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index 6b76dad3f9..6870acb54f 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -92,7 +92,7 @@ _closeInDistance = (_closeInMax + _closeInMin) / 2; deleteVehicle _setupObject; //Checks -if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_placer,_attachToVehicle,_itemClassname] call FUNC(canAttach))}) exitWith { +if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_attachToVehicle, _placer, _itemClassname] call FUNC(canAttach))}) exitWith { TRACE_2("no valid spot found",_closeInDistance,_startDistanceFromCenter); [localize "STR_ACE_Attach_Failed"] call EFUNC(common,displayTextStructured); }; From 51e8dbf53f7daed2c7ae3160e0ef72ce3b112f29 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 27 Mar 2015 00:12:39 -0500 Subject: [PATCH 07/39] misc --- addons/attach/XEH_preInit.sqf | 1 - addons/attach/functions/fnc_canAttach.sqf | 6 +----- .../functions/fnc_getChildrenAttachActions.sqf | 2 +- addons/attach/functions/fnc_placeApprove.sqf | 16 ++++++++-------- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/addons/attach/XEH_preInit.sqf b/addons/attach/XEH_preInit.sqf index d11a3992b5..c4629a2216 100644 --- a/addons/attach/XEH_preInit.sqf +++ b/addons/attach/XEH_preInit.sqf @@ -7,7 +7,6 @@ PREP(canAttach); PREP(canDetach); PREP(detach); PREP(getChildrenAttachActions); -PREP(openAttachUI); PREP(placeApprove); PREP(placeCancel); diff --git a/addons/attach/functions/fnc_canAttach.sqf b/addons/attach/functions/fnc_canAttach.sqf index fb83b44d26..944b0ed1a9 100644 --- a/addons/attach/functions/fnc_canAttach.sqf +++ b/addons/attach/functions/fnc_canAttach.sqf @@ -25,8 +25,4 @@ _itemName = [_args, 0, ""] call CBA_fnc_defaultParam; _attachLimit = [6, 1] select (_player == _attachToVehicle); _attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; -_ret = (canStand _player) && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])}; - -systemChat format ["[%1] Checking = %2", _itemName, _ret ]; -x = _this; -_ret +(canStand _player) && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])}; diff --git a/addons/attach/functions/fnc_getChildrenAttachActions.sqf b/addons/attach/functions/fnc_getChildrenAttachActions.sqf index 13d0d0d84c..6ff9410475 100644 --- a/addons/attach/functions/fnc_getChildrenAttachActions.sqf +++ b/addons/attach/functions/fnc_getChildrenAttachActions.sqf @@ -42,7 +42,7 @@ _actions = []; if (getNumber (_item >> "ACE_Attachable") == 1) then { _displayName = getText(_item >> "displayName"); _picture = getText(_item >> "picture"); - _action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, _x] call EFUNC(interact_menu,createAction); + _action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); _actions pushBack [_action, [], _target]; }; }; diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index 6870acb54f..b1bafe56ac 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -37,7 +37,7 @@ GVAR(placer) = objNull; [_placer, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); [_placer, "DefaultAction", _placer getVariable [QGVAR(placeActionEH), -1]] call EFUNC(common,removeActionEventHandler); -[_placer, "MenuBack", _placer getVariable [QGVAR(cancelActionEH), -1]] call EFUNC(common,removeActionEventHandler); +// [_placer, "MenuBack", _placer getVariable [QGVAR(cancelActionEH), -1]] call EFUNC(common,removeActionEventHandler); call EFUNC(interaction,hideMouseHint); //A player can release the attachObject with it floating in mid-air. @@ -56,6 +56,9 @@ _keepGoingCloser = true; _closeInMax = _startDistanceFromCenter; _closeInMin = 0; +//Delete Local Placement Object +deleteVehicle _setupObject; + while {(_closeInMax - _closeInMin) > 0.01} do { _closeInDistance = (_closeInMax + _closeInMin) / 2; // systemChat format ["Trying %1 from %2 start %3", _closeInDistance, [_closeInMax, _closeInMin], _startDistanceFromCenter]; @@ -73,12 +76,12 @@ while {(_closeInMax - _closeInMin) > 0.01} do { _endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLtoASL _endPosShifted}; //Uncomment to see the lazor show, and see how the scanning works: - drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]]; + // drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]]; - if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _placer, _setupObject]) exitWith {_doesIntersect = true}; + if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _placer]) exitWith {_doesIntersect = true}; } forEach [[0,0,0.045], [0,0,-0.045], [0,0.045,0], [0,-0.045,0], [0.045,0,0], [-0.045,0,0]]; } forEach [[0,0,0], [0,0,0.05], [0,0,-0.05]]; - + if (_doesIntersect) then { _closeInMax = _closeInDistance; } else { @@ -88,10 +91,7 @@ while {(_closeInMax - _closeInMin) > 0.01} do { _closeInDistance = (_closeInMax + _closeInMin) / 2; -//Delete Local Placement Object -deleteVehicle _setupObject; - -//Checks +//Checks (too close to center or can't attach) if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_attachToVehicle, _placer, _itemClassname] call FUNC(canAttach))}) exitWith { TRACE_2("no valid spot found",_closeInDistance,_startDistanceFromCenter); [localize "STR_ACE_Attach_Failed"] call EFUNC(common,displayTextStructured); From f43666eb93be7f0a1092edd65a0c43b11977678d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 27 Mar 2015 11:14:04 -0500 Subject: [PATCH 08/39] Use CBA PFEH instead of BI stacked --- addons/attach/CfgVehicles.hpp | 10 ++-- addons/attach/XEH_preInit.sqf | 1 - addons/attach/functions/fnc_canAttach.sqf | 4 +- addons/attach/functions/fnc_placeApprove.sqf | 51 +++++--------------- addons/attach/functions/fnc_placeCancel.sqf | 35 -------------- 5 files changed, 21 insertions(+), 80 deletions(-) delete mode 100644 addons/attach/functions/fnc_placeCancel.sqf diff --git a/addons/attach/CfgVehicles.hpp b/addons/attach/CfgVehicles.hpp index 91155956d1..ce9b1a7413 100644 --- a/addons/attach/CfgVehicles.hpp +++ b/addons/attach/CfgVehicles.hpp @@ -6,21 +6,21 @@ displayName = "$STR_ACE_Attach_AttachDetach"; \ condition = QUOTE(_this call FUNC(canAttach)); \ insertChildren = QUOTE(_this call FUNC(getChildrenAttachActions)); \ - exceptions[] = {"isNotDragging"}; \ + exceptions[] = {}; \ showDisabled = 0; \ priority = 0; \ icon = PATHTOF(UI\attach_ca.paa); \ - distance = 4; \ + distance = 4.5; \ }; \ class GVAR(DetachVehicle) { \ displayName = "$STR_ACE_Attach_Detach"; \ condition = QUOTE(_this call FUNC(canDetach)); \ statement = QUOTE(_this call FUNC(detach) ); \ - exceptions[] = {"isNotDragging"}; \ + exceptions[] = {}; \ showDisabled = 0; \ - priority = 0; \ + priority = 0.1; \ icon = PATHTOF(UI\detach_ca.paa); \ - distance = 4; \ + distance = 4.5; \ }; \ }; \ }; diff --git a/addons/attach/XEH_preInit.sqf b/addons/attach/XEH_preInit.sqf index c4629a2216..06c6ed1b01 100644 --- a/addons/attach/XEH_preInit.sqf +++ b/addons/attach/XEH_preInit.sqf @@ -8,6 +8,5 @@ PREP(canDetach); PREP(detach); PREP(getChildrenAttachActions); PREP(placeApprove); -PREP(placeCancel); ADDON = true; diff --git a/addons/attach/functions/fnc_canAttach.sqf b/addons/attach/functions/fnc_canAttach.sqf index 944b0ed1a9..550e780342 100644 --- a/addons/attach/functions/fnc_canAttach.sqf +++ b/addons/attach/functions/fnc_canAttach.sqf @@ -25,4 +25,6 @@ _itemName = [_args, 0, ""] call CBA_fnc_defaultParam; _attachLimit = [6, 1] select (_player == _attachToVehicle); _attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; -(canStand _player) && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])}; +_playerPos = (ACE_player modelToWorld (ACE_player selectionPosition "pilot")); + +(canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])}; diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index b1bafe56ac..f371ef7050 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -1,6 +1,11 @@ /* * Author: Pabst Mirror (based on Explosive attach by Garth de Wet (LH)) * Approves placement of the lightObject, scans for an appropriate location and attaches + * A player can release the attachObject with it floating in mid-air. + * This will use lineIntersectsWith to scan towards the center of the vehicle to find a collision + * ArmA's collision detection is of couse terrible and often misses collisions (difference between what we see and collision LOD) + * So it does multiple scans at slighly different angles + * This is VERY computationaly intensive, but doesn't happen that often. * * Arguments: * Nothing @@ -15,43 +20,14 @@ */ #include "script_component.hpp" -private ["_setupObject", "_setupClassname", "_itemClassname", "_placementText", "_attachToVehicle", "_placer", "_startingPosition", "_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_keepGoingCloser", "_closeInMax", "_closeInMin", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"]; +private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_setupObject", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"]; -if (GVAR(pfeh_running)) then { - [QGVAR(PlacementEachFrame),"OnEachFrame"] call BIS_fnc_removeStackedEventHandler; - GVAR(pfeh_running) = false; -}; +PARAMS_6(_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition); -_setupObject = GVAR(setupObject); -_setupClassname = typeOf _setupObject; -_itemClassname = GVAR(SetupPlacmentItem); -_placementText = GVAR(SetupPlacmentText); -_attachToVehicle = GVAR(SetupAttachVehicle); -_placer = GVAR(placer); - -GVAR(SetupPlacmentItem) = ""; -GVAR(SetupPlacmentText) = ""; -GVAR(setupObject) = objNull; -GVAR(SetupAttachVehicle) = objNull; -GVAR(placer) = objNull; - -[_placer, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); -[_placer, "DefaultAction", _placer getVariable [QGVAR(placeActionEH), -1]] call EFUNC(common,removeActionEventHandler); -// [_placer, "MenuBack", _placer getVariable [QGVAR(cancelActionEH), -1]] call EFUNC(common,removeActionEventHandler); -call EFUNC(interaction,hideMouseHint); - -//A player can release the attachObject with it floating in mid-air. -//This will use lineIntersectsWith to scan towards the center of the vehicle to find a collision -//ArmA's collision detection is of couse terrible and often misses collisions (difference between what we see and collision LOD) -//So it does multiple scans at slighly different angles -//This is VERY computationaly intensive, but doesn't happen that often. - -_startingPosition = _setupObject modelToWorld [0,0,0]; _startingOffset = _attachToVehicle worldToModel _startingPosition; _startDistanceFromCenter = vectorMagnitude _startingOffset; _closeInUnitVector = vectorNormalized (_startingOffset vectorFromTo [0,0,0]); -_keepGoingCloser = true; _closeInMax = _startDistanceFromCenter; _closeInMin = 0; @@ -76,9 +52,8 @@ while {(_closeInMax - _closeInMin) > 0.01} do { _endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLtoASL _endPosShifted}; //Uncomment to see the lazor show, and see how the scanning works: - // drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]]; - - if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _placer]) exitWith {_doesIntersect = true}; + drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]]; + if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _unit]) exitWith {_doesIntersect = true}; } forEach [[0,0,0.045], [0,0,-0.045], [0,0.045,0], [0,-0.045,0], [0.045,0,0], [-0.045,0,0]]; } forEach [[0,0,0], [0,0,0.05], [0,0,-0.05]]; @@ -92,7 +67,7 @@ while {(_closeInMax - _closeInMin) > 0.01} do { _closeInDistance = (_closeInMax + _closeInMin) / 2; //Checks (too close to center or can't attach) -if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_attachToVehicle, _placer, _itemClassname] call FUNC(canAttach))}) exitWith { +if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) exitWith { TRACE_2("no valid spot found",_closeInDistance,_startDistanceFromCenter); [localize "STR_ACE_Attach_Failed"] call EFUNC(common,displayTextStructured); }; @@ -103,11 +78,11 @@ _closeInDistance = (_closeInDistance - 0.0085); //Create New 'real' Object _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); _endPosTestOffset set [2, (_startingOffset select 2)]; -_attachedObject = _setupClassname createVehicle (getPos _placer); +_attachedObject = _itemVehClass createVehicle (getPos _unit); _attachedObject attachTo [_attachToVehicle, _endPosTestOffset]; //Remove Item from inventory -_placer removeItem _itemClassname; +_unit removeItem _itemClassname; //Add Object to ACE_AttachedObjects and ACE_AttachedItemNames _currentObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; @@ -117,4 +92,4 @@ _currentItemNames = _attachToVehicle getVariable [QGVAR(ItemNames), []]; _currentItemNames pushBack _itemClassname; _attachToVehicle setVariable [QGVAR(ItemNames), _currentItemNames, true]; -[_placementText] call EFUNC(common,displayTextStructured); +[_onAtachText] call EFUNC(common,displayTextStructured); diff --git a/addons/attach/functions/fnc_placeCancel.sqf b/addons/attach/functions/fnc_placeCancel.sqf deleted file mode 100644 index 3abdf848ba..0000000000 --- a/addons/attach/functions/fnc_placeCancel.sqf +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Author: Pabst Mirror (based on Explosive attach by Garth de Wet (LH)) - * Cancels placement of the lightObject - * - * Arguments: - * Nothing - * - * Return Value: - * Nothing - * - * Example: - * Nothing - * - * Public: No - */ -#include "script_component.hpp" - -if (GVAR(pfeh_running)) then { - [QGVAR(PlacementEachFrame),"OnEachFrame"] call BIS_fnc_removeStackedEventHandler; - GVAR(pfeh_running) = false; -}; -if (!isNull (GVAR(setupObject))) then { - deleteVehicle GVAR(setupObject); -}; - -[GVAR(placer), QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); -call EFUNC(interaction,hideMouseHint); -[GVAR(placer), "DefaultAction", GVAR(placer) getVariable [QGVAR(placeActionEH), -1]] call EFUNC(common,removeActionEventHandler); -[GVAR(placer), "MenuBack", GVAR(placer) getVariable [QGVAR(cancelActionEH), -1]] call EFUNC(common,removeActionEventHandler); - -GVAR(placer) = objNull; -GVAR(SetupPlacmentItem) = ""; -GVAR(SetupPlacmentText) = ""; -GVAR(setupObject) = objNull; -GVAR(SetupAttachVehicle) = objNull; From 86c7776802d782f9b41bc9435c501c207197587c Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 27 Mar 2015 11:14:19 -0500 Subject: [PATCH 09/39] and this --- addons/attach/functions/fnc_attach.sqf | 77 +++++++++++++++----------- 1 file changed, 44 insertions(+), 33 deletions(-) diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 6486a55d5f..0cb2030caf 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -21,35 +21,35 @@ PARAMS_3(_attachToVehicle,_unit,_args); private ["_item", "_itemVehClass", "_onAtachText", "_selfAttachPosition"]; -_itemName = [_args, 0, ""] call CBA_fnc_defaultParam; +_itemClassname = [_args, 0, ""] call CBA_fnc_defaultParam; //Sanity Check (_unit has item in inventory, not over attach limit) -if ((_itemName == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR("Tried to attach, but check failed");}; +if ((_itemClassname == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR("Tried to attach, but check failed");}; _itemVehClass = ""; _onAtachText = ""; _selfAttachPosition = [_unit, [-0.05, 0, 0.12], "rightshoulder"]; switch (true) do { - case (_itemName == "ACE_IR_Strobe_Item"): { +case (_itemClassname == "ACE_IR_Strobe_Item"): { _itemVehClass = "ACE_IR_Strobe_Effect"; _onAtachText = localize "STR_ACE_Attach_IrStrobe_Attached"; //_selfAttachPosition = [_unit, [0, -0.11, 0.16], "pilot"]; //makes it attach to the head a bit better, shoulder is not good for visibility - eRazeri }; - case (_itemName == "B_IR_Grenade"): { +case (_itemClassname == "B_IR_Grenade"): { _itemVehClass = "B_IRStrobe"; _onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached"; }; - case (_itemName == "O_IR_Grenade"): { +case (_itemClassname == "O_IR_Grenade"): { _itemVehClass = "O_IRStrobe"; _onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached"; }; - case (_itemName == "I_IR_Grenade"): { +case (_itemClassname == "I_IR_Grenade"): { _itemVehClass = "I_IRStrobe"; _onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached"; }; - case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]): { - _itemVehClass = _itemName; +case (toLower _itemClassname in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]): { + _itemVehClass = _itemClassname; _onAtachText = localize "STR_ACE_Attach_Chemlight_Attached"; }; }; @@ -57,38 +57,49 @@ switch (true) do { if (_itemVehClass == "") exitWith {ERROR("no _itemVehClass for Item");}; if (_unit == _attachToVehicle) then { //Self Attachment - _unit removeItem _itemName; // Remove item + _unit removeItem _itemClassname; // Remove item _attachedItem = _itemVehClass createVehicle [0,0,0]; _attachedItem attachTo _selfAttachPosition; [_onAtachText] call EFUNC(common,displayTextStructured); _attachToVehicle setVariable [QGVAR(Objects), [_attachedItem], true]; - _attachToVehicle setVariable [QGVAR(ItemNames), [_itemName], true]; + _attachToVehicle setVariable [QGVAR(ItemNames), [_itemClassname], true]; } else { - GVAR(setupObject) = _itemVehClass createVehicleLocal [0,0,-10000]; - GVAR(setupObject) enableSimulationGlobal false; - GVAR(SetupPlacmentText) = _onAtachText; - GVAR(SetupPlacmentItem) = _itemName; - GVAR(SetupAttachVehicle) = _attachToVehicle; - GVAR(placer) = _unit; + GVAR(placeAction) = -1; + + _tempObject = _itemVehClass createVehicleLocal [0,0,-10000]; + _tempObject enableSimulationGlobal false; + [_unit, QGVAR(vehAttach), true] call EFUNC(common,setForceWalkStatus); - [QGVAR(PlacementEachFrame),"OnEachFrame", { - private "_player"; - _player = ACE_player; - //Stop if player switch or player gets to far from vehicle - if (GVAR(placer) != _player || {_player distance GVAR(SetupAttachVehicle) > 7}) exitWith { - call FUNC(placeCancel); - }; - GVAR(pfeh_running) = true; - _pos = (ASLtoATL eyePos _player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]); - GVAR(setupObject) setPosATL _pos; - }] call BIS_fnc_addStackedEventHandler; // @todo replace with CBA PFH - - //had to delay the mouseHint, not sure why - // [{[localize "STR_ACE_Attach_PlaceAction", localize "STR_ACE_Attach_CancelAction"] call EFUNC(interaction,showMouseHint)}, [], 0, 0] call EFUNC(common,waitAndExecute); - //RMB is unusable for now, so don't show it: + //MenuBack isn't working for now (localize "STR_ACE_Attach_CancelAction") [{[localize "STR_ACE_Attach_PlaceAction", ""] call EFUNC(interaction,showMouseHint)}, [], 0, 0] call EFUNC(common,waitAndExecute); + _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = 1;}] call EFUNC(common,AddActionEventHandler)]; + // _unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {true}, {GVAR(placeAction) = 0;}] call EFUNC(common,AddActionEventHandler)]; - _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {GVAR(pfeh_running) && {!isNull (GVAR(setupObject))}}, {call FUNC(placeApprove);}] call EFUNC(common,AddActionEventHandler)]; - // _unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {GVAR(pfeh_running) && {!isNull (GVAR(setupObject))}}, {call FUNC(placeCancel);}] call EFUNC(common,AddActionEventHandler)]; + [{ + PARAMS_2(_args,_pfID); + EXPLODE_6_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_tempObject,_onAtachText); + + if ((GVAR(placeAction) != -1) || + {_unit != ACE_player} || + {!([_unit, _attachToVehicle, []] call EFUNC(common,canInteractWith))} || + {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) then { + + systemChat "exiting"; + + [_pfID] call CBA_fnc_removePerFrameHandler; + [_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); + [] call EFUNC(interaction,hideMouseHint); + [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); + //[_unit, "MenuBack", (_unit getVariable [QGVAR(cancelActionEH), -1])] call EFUNC(common,removeActionEventHandler); + + if (GVAR(placeAction) == 1) then { + _startingPosition = _tempObject modelToWorld [0,0,0]; + [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _startingPosition] call FUNC(placeApprove); + }; + deleteVehicle _tempObject; + } else { + _tempObject setPosATL ((ASLtoATL eyePos _unit) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]));; + }; + }, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _tempObject, _onAtachText]] call CBA_fnc_addPerFrameHandler; }; From 91a1ed32643db3daa19335a5f94c542d67840f7e Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 27 Mar 2015 11:36:31 -0500 Subject: [PATCH 10/39] Cancle attach action --- addons/attach/functions/fnc_attach.sqf | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 0cb2030caf..6b7de1e72f 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -19,7 +19,7 @@ PARAMS_3(_attachToVehicle,_unit,_args); -private ["_item", "_itemVehClass", "_onAtachText", "_selfAttachPosition"]; +private ["_itemClassname", "_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID"]; _itemClassname = [_args, 0, ""] call CBA_fnc_defaultParam; @@ -76,23 +76,24 @@ if (_unit == _attachToVehicle) then { //Self Attachment _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = 1;}] call EFUNC(common,AddActionEventHandler)]; // _unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {true}, {GVAR(placeAction) = 0;}] call EFUNC(common,AddActionEventHandler)]; + _actionID = _unit addAction [format ["%1", localize "STR_ACE_Attach_CancelAction"], {GVAR(placeAction) = 0}]; + [{ PARAMS_2(_args,_pfID); - EXPLODE_6_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_tempObject,_onAtachText); + EXPLODE_7_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_tempObject,_onAtachText,_actionID); if ((GVAR(placeAction) != -1) || {_unit != ACE_player} || {!([_unit, _attachToVehicle, []] call EFUNC(common,canInteractWith))} || {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) then { - systemChat "exiting"; - [_pfID] call CBA_fnc_removePerFrameHandler; [_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); [] call EFUNC(interaction,hideMouseHint); [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); //[_unit, "MenuBack", (_unit getVariable [QGVAR(cancelActionEH), -1])] call EFUNC(common,removeActionEventHandler); - + _unit removeAction _actionID; + if (GVAR(placeAction) == 1) then { _startingPosition = _tempObject modelToWorld [0,0,0]; [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _startingPosition] call FUNC(placeApprove); @@ -101,5 +102,5 @@ if (_unit == _attachToVehicle) then { //Self Attachment } else { _tempObject setPosATL ((ASLtoATL eyePos _unit) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]));; }; - }, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _tempObject, _onAtachText]] call CBA_fnc_addPerFrameHandler; + }, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _tempObject, _onAtachText, _actionID]] call CBA_fnc_addPerFrameHandler; }; From 4d62865ea2d06411771fb4c2f6326c08e6bd897a Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 27 Mar 2015 11:53:04 -0500 Subject: [PATCH 11/39] Stop placement on interact_menu open --- addons/attach/CfgEventHandlers.hpp | 6 +++++- addons/attach/XEH_clientInit.sqf | 6 ++++++ addons/attach/functions/fnc_attach.sqf | 6 +++--- addons/attach/functions/fnc_detach.sqf | 6 +++--- 4 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 addons/attach/XEH_clientInit.sqf diff --git a/addons/attach/CfgEventHandlers.hpp b/addons/attach/CfgEventHandlers.hpp index f0a9f14d91..3daad1425a 100644 --- a/addons/attach/CfgEventHandlers.hpp +++ b/addons/attach/CfgEventHandlers.hpp @@ -1,6 +1,10 @@ - class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) ); + }; +}; diff --git a/addons/attach/XEH_clientInit.sqf b/addons/attach/XEH_clientInit.sqf new file mode 100644 index 0000000000..f7e663c2ae --- /dev/null +++ b/addons/attach/XEH_clientInit.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +//If attach placing, stop when opening menu: +["interactMenuOpened", {GVAR(placeAction) = 0;}] call EFUNC(common,addEventHandler); diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 6b7de1e72f..2a79a28699 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -1,5 +1,5 @@ /* - * Author: eRazeri and esteldunedain + * Author: eRazeri, esteldunedain, PabstMirror * Attach an item to the unit * * Arguments: @@ -77,7 +77,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment // _unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {true}, {GVAR(placeAction) = 0;}] call EFUNC(common,AddActionEventHandler)]; _actionID = _unit addAction [format ["%1", localize "STR_ACE_Attach_CancelAction"], {GVAR(placeAction) = 0}]; - + [{ PARAMS_2(_args,_pfID); EXPLODE_7_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_tempObject,_onAtachText,_actionID); @@ -93,7 +93,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); //[_unit, "MenuBack", (_unit getVariable [QGVAR(cancelActionEH), -1])] call EFUNC(common,removeActionEventHandler); _unit removeAction _actionID; - + if (GVAR(placeAction) == 1) then { _startingPosition = _tempObject modelToWorld [0,0,0]; [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _startingPosition] call FUNC(placeApprove); diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index 0386f5452a..124e5910d6 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -74,13 +74,13 @@ _attachToVehicle setVariable [QGVAR(ItemNames), _attachedItems, true]; // Display message switch (true) do { - case (_itemName == "ACE_IR_Strobe_Item") : { +case (_itemName == "ACE_IR_Strobe_Item") : { [localize "STR_ACE_Attach_IrStrobe_Detached"] call EFUNC(common,displayTextStructured); }; - case (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) : { +case (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) : { [localize "STR_ACE_Attach_IrGrenade_Detached"] call EFUNC(common,displayTextStructured); }; - case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]) : { +case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]) : { [localize "STR_ACE_Attach_Chemlight_Detached"] call EFUNC(common,displayTextStructured); }; }; From 47c72ac4aeae2a98afa6660c668834134ea28bb2 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 27 Mar 2015 12:08:05 -0500 Subject: [PATCH 12/39] Disable Debug Laser / Commenting --- addons/attach/functions/fnc_attach.sqf | 5 ++--- addons/attach/functions/fnc_canAttach.sqf | 4 ++-- addons/attach/functions/fnc_canDetach.sqf | 4 ++-- addons/attach/functions/fnc_placeApprove.sqf | 11 ++++++++--- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 2a79a28699..a8b73052dc 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -11,16 +11,15 @@ * Nothing * * Example: - * Nothing + * [bob, bob, ["light"]] call ace_attach_fnc_attach; * * Public: No */ #include "script_component.hpp" -PARAMS_3(_attachToVehicle,_unit,_args); - private ["_itemClassname", "_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID"]; +PARAMS_3(_attachToVehicle,_unit,_args); _itemClassname = [_args, 0, ""] call CBA_fnc_defaultParam; //Sanity Check (_unit has item in inventory, not over attach limit) diff --git a/addons/attach/functions/fnc_canAttach.sqf b/addons/attach/functions/fnc_canAttach.sqf index 550e780342..966794b32f 100644 --- a/addons/attach/functions/fnc_canAttach.sqf +++ b/addons/attach/functions/fnc_canAttach.sqf @@ -8,10 +8,10 @@ * 2: Array empty or containing a string of the attachable item * * Return Value: - * Boolean + * Can Attach * * Example: - * Nothing + * [bob, bob, ["light"]] call ace_attach_fnc_canAttach; * * Public: No */ diff --git a/addons/attach/functions/fnc_canDetach.sqf b/addons/attach/functions/fnc_canDetach.sqf index a32440e56e..dc335e6bb6 100644 --- a/addons/attach/functions/fnc_canDetach.sqf +++ b/addons/attach/functions/fnc_canDetach.sqf @@ -7,10 +7,10 @@ * 1: unit doing the detaching (player) * * Return Value: - * Boolean + * Can Detach * * Example: - * Nothing + * [bob, bob] call ace_attach_fnc_canDetach; * * Public: No */ diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index f371ef7050..576721cf59 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -8,13 +8,18 @@ * This is VERY computationaly intensive, but doesn't happen that often. * * Arguments: - * Nothing + * 0: Unit (player) + * 1: attachToVehicle + * 2: Item Classname (cfgWeapon/cfgMagazine) + * 3: Light Vehicle Classname + * 4: On Attach Text + * 5: Starting Pos of dummy item * * Return Value: * Nothing * * Example: - * Nothing + * No * * Public: No */ @@ -52,7 +57,7 @@ while {(_closeInMax - _closeInMin) > 0.01} do { _endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLtoASL _endPosShifted}; //Uncomment to see the lazor show, and see how the scanning works: - drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]]; + // drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]]; if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _unit]) exitWith {_doesIntersect = true}; } forEach [[0,0,0.045], [0,0,-0.045], [0,0.045,0], [0,-0.045,0], [0.045,0,0], [-0.045,0,0]]; } forEach [[0,0,0], [0,0,0.05], [0,0,-0.05]]; From 5f1201d75a781e6a69a06aec87e0a05f38804c66 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 27 Mar 2015 19:08:01 +0100 Subject: [PATCH 13/39] fix unexpected stringtable format --- addons/magazinerepack/stringtable.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/magazinerepack/stringtable.xml b/addons/magazinerepack/stringtable.xml index 401d3beaf7..9931e5a8df 100644 --- a/addons/magazinerepack/stringtable.xml +++ b/addons/magazinerepack/stringtable.xml @@ -11,7 +11,7 @@ Přepáskovat<br/>Zásobníky Ricarica<br/>Caricatori Reorganizar<br/>Carregadores - Újratárazás<<br/>Hungarian> + Újratárazás<<br/> Перепаковать<br/>магазины From 66c026d4a01c75940be2610fdae883f2712a79c4 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 28 Mar 2015 00:30:51 +0100 Subject: [PATCH 14/39] refueling the uav didn't work on UAVs local to server or HC --- addons/common/XEH_postInit.sqf | 6 +----- addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index e3d2ed9327..237791ff5b 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -34,6 +34,7 @@ if (hasInterface) then { }] call FUNC(addEventhandler); ["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler); +["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler); // hack to get PFH to work in briefing [QGVAR(onBriefingPFH), "onEachFrame", { @@ -174,11 +175,6 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player; [QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable); -["VehicleSetFuel", { -PARAMS_2(_vehicle,_fuelLevel); -_vehicle setFuel _fuelLevel; -}] call FUNC(addEventhandler); - ["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler); ["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler); diff --git a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf index a23969aa9f..b5c6664657 100644 --- a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf +++ b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf @@ -24,7 +24,7 @@ _onFinish = { EXPLODE_2_PVT((_this select 0),_caller,_target); _caller removeItem "ACE_UAVBattery"; playSound3D [QUOTE(PATHTO_R(sounds\exchange_battery.ogg)), objNull, false, getPosASL _caller, 1, 1, 10]; - ["VehicleSetFuel", [_target], [_target, 1]] call EFUNC(common,targetEvent); //setFuel is local + ["setFuel", [_target], [_target, 1]] call EFUNC(common,targetEvent); //setFuel is local }; _onFailure = { From d12ba196c5b4b487bb306faef7f4333b82bf309d Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 28 Mar 2015 01:43:30 +0100 Subject: [PATCH 15/39] function to return attachments, muzzles with magazines and ammo, moved stuff around --- addons/common/XEH_preInit.sqf | 3 + .../functions/fnc_getWeaponModes.sqf | 0 .../functions/fnc_getWeaponMuzzles.sqf | 0 .../common/functions/fnc_getWeaponState.sqf | 73 +++++++++++++++++++ addons/weaponselect/XEH_preInit.sqf | 2 - .../functions/fnc_selectWeaponMode.sqf | 4 +- .../functions/fnc_selectWeaponMuzzle.sqf | 2 +- 7 files changed, 79 insertions(+), 5 deletions(-) rename addons/{weaponselect => common}/functions/fnc_getWeaponModes.sqf (100%) rename addons/{weaponselect => common}/functions/fnc_getWeaponMuzzles.sqf (100%) create mode 100644 addons/common/functions/fnc_getWeaponState.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index c23c6b1dd2..2a20c69bcb 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -95,6 +95,9 @@ PREP(getVehicleCrew); PREP(getVersion); PREP(getWeaponAzimuthAndInclination); PREP(getWeaponIndex); +PREP(getWeaponModes); +PREP(getWeaponMuzzles); +PREP(getWeaponState); PREP(getWeaponType); PREP(getWindDirection); PREP(goKneeling); diff --git a/addons/weaponselect/functions/fnc_getWeaponModes.sqf b/addons/common/functions/fnc_getWeaponModes.sqf similarity index 100% rename from addons/weaponselect/functions/fnc_getWeaponModes.sqf rename to addons/common/functions/fnc_getWeaponModes.sqf diff --git a/addons/weaponselect/functions/fnc_getWeaponMuzzles.sqf b/addons/common/functions/fnc_getWeaponMuzzles.sqf similarity index 100% rename from addons/weaponselect/functions/fnc_getWeaponMuzzles.sqf rename to addons/common/functions/fnc_getWeaponMuzzles.sqf diff --git a/addons/common/functions/fnc_getWeaponState.sqf b/addons/common/functions/fnc_getWeaponState.sqf new file mode 100644 index 0000000000..3fd39ed20c --- /dev/null +++ b/addons/common/functions/fnc_getWeaponState.sqf @@ -0,0 +1,73 @@ +/* + * Author: commy2 + * + * Return current state of the weapon. Attachments and magazines with ammo. + * + * Argument: + * 0: A unit (Object) + * 1: A weapon (String) + * + * Return value: + * NONE. + */ + #include "script_component.hpp" + +private ["_unit", "_weapon"]; + +_unit = _this select 0; +_weapon = _this select 1; + +private "_muzzles"; +_muzzles = [_weapon] call FUNC(getWeaponMuzzles); + +private "_weaponInfo"; +_weaponInfo = []; + +switch (_weapon) do { + case (primaryWeapon _unit): { + _weaponInfo pushBack primaryWeaponItems _unit; + + }; + + case (secondaryWeapon _unit): { + _weaponInfo pushBack secondaryWeaponItems _unit; + + }; + + case (handgunWeapon _unit): { + _weaponInfo pushBack handgunItems _unit; + + }; + + default { + _weaponInfo pushBack ["","","",""]; + + }; +}; + +// get loaded magazines and ammo +private ["_magazines", "_ammo"]; + +_magazines = []; +_ammo = []; + +{ + _magazines pushBack ""; + _ammo pushBack 0; +} forEach _muzzles; + +{ + if (_x select 2) then { + private "_index"; + _index = _muzzles find (_x select 4); + + if (_index != -1) then { + _magazines set [_index, _x select 0]; + _ammo set [_index, _x select 1]; + }; + }; +} forEach magazinesAmmoFull _unit; + +_weaponInfo append [_muzzles, _magazines, _ammo]; + +_weaponInfo diff --git a/addons/weaponselect/XEH_preInit.sqf b/addons/weaponselect/XEH_preInit.sqf index 0dfb72f353..790dfe7a99 100644 --- a/addons/weaponselect/XEH_preInit.sqf +++ b/addons/weaponselect/XEH_preInit.sqf @@ -8,8 +8,6 @@ PREP(findNextGrenadeMagazine); PREP(findNextGrenadeMuzzle); PREP(fireSmokeLauncher); PREP(getSelectedGrenade); -PREP(getWeaponModes); -PREP(getWeaponMuzzles); PREP(playChangeFiremodeSound); PREP(putWeaponAway); PREP(selectGrenadeAll); diff --git a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf index 236f934257..aea777d709 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf @@ -29,8 +29,8 @@ if (_weapon in (_unit getVariable [QEGVAR(safemode,safedWeapons), []])) exitWith private ["_muzzles", "_modes"]; -_muzzles = [_weapon] call FUNC(getWeaponMuzzles); -_modes = [_weapon] call FUNC(getWeaponModes); +_muzzles = [_weapon] call EFUNC(common,getWeaponMuzzles); +_modes = [_weapon] call EFUNC(common,getWeaponModes); private ["_index", "_muzzle", "_mode"]; diff --git a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf index 95e5a9a2aa..011108e448 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf @@ -19,7 +19,7 @@ _weapon = _this select 1; if (_weapon == "") exitWith {}; private "_muzzles"; -_muzzles = [_weapon] call FUNC(getWeaponMuzzles); +_muzzles = [_weapon] call EFUNC(common,getWeaponMuzzles); if (currentWeapon _unit != _weapon) exitWith { if (count _muzzles > 1) then { From e7ec618f9772328f2975ccfe1dad66d2b27ce7b5 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 28 Mar 2015 02:10:04 +0100 Subject: [PATCH 16/39] function decription --- addons/common/functions/fnc_getWeaponState.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/functions/fnc_getWeaponState.sqf b/addons/common/functions/fnc_getWeaponState.sqf index 3fd39ed20c..4ec54cc787 100644 --- a/addons/common/functions/fnc_getWeaponState.sqf +++ b/addons/common/functions/fnc_getWeaponState.sqf @@ -8,7 +8,7 @@ * 1: A weapon (String) * * Return value: - * NONE. + * Weapon info, format: [attachments, muzzles, magazines, ammo] (Array) */ #include "script_component.hpp" From 772551cbb3c24342f82c63075de2dafc1da5f7c4 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 28 Mar 2015 07:39:23 +0100 Subject: [PATCH 17/39] fix broken hungarian string --- addons/magazinerepack/stringtable.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/magazinerepack/stringtable.xml b/addons/magazinerepack/stringtable.xml index 9931e5a8df..d8fd5ca177 100644 --- a/addons/magazinerepack/stringtable.xml +++ b/addons/magazinerepack/stringtable.xml @@ -11,7 +11,7 @@ Přepáskovat<br/>Zásobníky Ricarica<br/>Caricatori Reorganizar<br/>Carregadores - Újratárazás<<br/> + Újratárazás<br/> Перепаковать<br/>магазины From 40ccf7b241605555318b5b2556ca3595755e8190 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 28 Mar 2015 01:46:04 -0500 Subject: [PATCH 18/39] Captives - Should disable reloading --- addons/captives/CfgMoves.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/captives/CfgMoves.hpp b/addons/captives/CfgMoves.hpp index d60fab5a33..aa64e85e22 100644 --- a/addons/captives/CfgMoves.hpp +++ b/addons/captives/CfgMoves.hpp @@ -39,6 +39,7 @@ class CfgMovesMaleSdr: CfgMovesBasic { interpolationRestart = 2; ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; + canReload = 0; }; class ACE_AmovPercMstpScapWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon { file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease"; @@ -63,6 +64,7 @@ class CfgMovesMaleSdr: CfgMovesBasic { interpolationRestart = 2; ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; + canReload = 0; }; class ACE_AmovPercMstpSsurWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon { file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon"; @@ -80,4 +82,3 @@ class CfgMovesMaleSdr: CfgMovesBasic { }; }; }; - From 53aaeaacd589f1ec6006fd25ffe7ec0cbd0b69f5 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 28 Mar 2015 08:38:16 +0100 Subject: [PATCH 19/39] fix #263 --- addons/protection/FixVests.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/protection/FixVests.hpp b/addons/protection/FixVests.hpp index 19e5d777d6..77354ca930 100644 --- a/addons/protection/FixVests.hpp +++ b/addons/protection/FixVests.hpp @@ -294,3 +294,10 @@ class V_Press_F: Vest_Camo_Base { /*passThrough = 1;*/ }; }; + +// marksman dlc +/*class V_PlateCarrierGL_blk: V_PlateCarrierGL_rgr {}; +class V_PlateCarrierGL_mtp: V_PlateCarrierGL_rgr {}; +class V_PlateCarrierSpec_blk: V_PlateCarrierSpec_rgr {}; +class V_PlateCarrierSpec_mtp: V_PlateCarrierSpec_rgr {}; +class V_PlateCarrierIAGL_oli: V_PlateCarrierIAGL_dgtl {};*/ From 86e5896c7306cdf2be2103ffb8faeb96f5ef8ecb Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 28 Mar 2015 09:05:58 +0100 Subject: [PATCH 20/39] intendation --- addons/protection/FixHelmets.hpp | 274 +++++----- addons/protection/FixUniforms.hpp | 818 +++++++++++++++--------------- addons/protection/FixVests.hpp | 382 +++++++------- 3 files changed, 737 insertions(+), 737 deletions(-) diff --git a/addons/protection/FixHelmets.hpp b/addons/protection/FixHelmets.hpp index 6c3d6a9e2f..eb2c515e50 100644 --- a/addons/protection/FixHelmets.hpp +++ b/addons/protection/FixHelmets.hpp @@ -7,224 +7,224 @@ /*class InventoryItem_Base_F; class HeadgearItem: InventoryItem_Base_F { - armor = 0; - passThrough = 1; + armor = 0; + passThrough = 1; }; class H_HelmetB: ItemCore { - class ItemInfo: HeadgearItem { - //mass = 40; - armor = 4; - passThrough = 0.5; - }; + class ItemInfo: HeadgearItem { + //mass = 40; + armor = 4; + passThrough = 0.5; + }; }; class H_HelmetB_camo: H_HelmetB { - class ItemInfo: HeadgearItem { - //mass = 40; - armor = 4; - passThrough = 0.5; - }; + class ItemInfo: HeadgearItem { + //mass = 40; + armor = 4; + passThrough = 0.5; + }; }; class H_HelmetB_light: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 30; - armor = 3; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 30; + armor = 3; + passThrough = 0.5; + }; }; class H_Booniehat_khk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 10; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 10; + armor = 0; + passThrough = 1; + }; }; class H_HelmetB_plain_mcamo: H_HelmetB {}; class H_HelmetSpecB: H_HelmetB_plain_mcamo { - class ItemInfo: ItemInfo { - //mass = 50; - armor = 5; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 50; + armor = 5; + passThrough = 0.5; + }; }; class H_HelmetIA: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 40; - armor = 4; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 40; + armor = 4; + passThrough = 0.5; + }; }; class H_Cap_red: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 4; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 4; + armor = 0; + passThrough = 1; + }; }; class H_Cap_headphones: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 8; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 8; + armor = 0; + passThrough = 1; + }; }; class H_HelmetCrew_B: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 40; - armor = 4; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 40; + armor = 4; + passThrough = 0.5; + }; }; class H_PilotHelmetFighter_B: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 50; - armor = 5; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 50; + armor = 5; + passThrough = 0.5; + }; }; class H_PilotHelmetHeli_B: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 30; - armor = 3; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 30; + armor = 3; + passThrough = 0.5; + }; }; class H_CrewHelmetHeli_B: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 30; - armor = 3; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 30; + armor = 3; + passThrough = 0.5; + }; }; class H_HelmetO_ocamo: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 50; - armor = 5; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 50; + armor = 5; + passThrough = 0.5; + }; }; class H_HelmetLeaderO_ocamo: H_HelmetO_ocamo { - class ItemInfo: ItemInfo { - //mass = 60; - armor = 6; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 60; + armor = 6; + passThrough = 0.5; + }; }; class H_MilCap_ocamo: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_BandMask_blk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 8; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 8; + armor = 0; + passThrough = 1; + }; }; class H_HelmetSpecO_ocamo: H_HelmetO_ocamo { - class ItemInfo: ItemInfo { - //mass = 40; - armor = 4; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 40; + armor = 4; + passThrough = 0.5; + }; }; class H_Bandanna_surfer: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 8; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 8; + armor = 0; + passThrough = 1; + }; }; class H_Shemag_khk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_ShemagOpen_khk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_Beret_blk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_Beret_02: H_Beret_blk { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_Watchcap_blk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_TurbanO_blk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 8; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 8; + armor = 0; + passThrough = 1; + }; }; class H_StrawHat: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_Hat_blue: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_RacingHelmet_1_F: H_HelmetB_camo { - class ItemInfo: ItemInfo { - //mass = 50; - armor = 5; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 50; + armor = 5; + passThrough = 0.5; + }; };*/ diff --git a/addons/protection/FixUniforms.hpp b/addons/protection/FixUniforms.hpp index add1524c8a..24c02b79aa 100644 --- a/addons/protection/FixUniforms.hpp +++ b/addons/protection/FixUniforms.hpp @@ -1,62 +1,62 @@ class Man; class CAManBase: Man { - class HitPoints { - class HitHead { - /*armor = 1; - passThrough = 1; - radius = 0.1; - explosionShielding = 0.5; - minimalHit = 0;*/ + class HitPoints { + class HitHead { + /*armor = 1; + passThrough = 1; + radius = 0.1; + explosionShielding = 0.5; + minimalHit = 0;*/ + }; + + class HitBody { + /*armor = 1; + passThrough = 1; + radius = 0.15; + explosionShielding = 10; + minimalHit = 0;*/ + }; + + class HitHands { + /*armor = 1; + passThrough = 1; + radius = 0.08; + explosionShielding = 1; + minimalHit = 0;*/ + }; + + class HitLegs { + /*armor = 1; + passThrough = 1; + radius = 0.1; + explosionShielding = 1; + minimalHit = 0;*/ + }; }; - class HitBody { - /*armor = 1; - passThrough = 1; - radius = 0.15; - explosionShielding = 10; - minimalHit = 0;*/ - }; - - class HitHands { - /*armor = 1; - passThrough = 1; - radius = 0.08; - explosionShielding = 1; - minimalHit = 0;*/ - }; - - class HitLegs { - /*armor = 1; - passThrough = 1; - radius = 0.1; - explosionShielding = 1; - minimalHit = 0;*/ - }; - }; - - /*armor = 2; - armorStructural = 5;*/ + /*armor = 2; + armorStructural = 5;*/ }; class Civilian: CAManBase { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + }; - class HitBody: HitBody { - armor = 2; - }; + class HitBody: HitBody { + armor = 2; + }; - class HitHands: HitHands { - armor = 2; - }; + class HitHands: HitHands { + armor = 2; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ }; /*class Civilian_F: Civilian {}; @@ -67,503 +67,503 @@ class SoldierEB: CAManBase {}; class SoldierGB: CAManBase {}; class B_Soldier_base_F: SoldierWB { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + }; + + class HitBody: HitBody { + armor = 2; + }; + + class HitHands: HitHands { + armor = 2; + }; + + class HitLegs: HitLegs { + armor = 2; + }; }; - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 2; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - }; - - armor = 2; - armorStructural = 5;*/ + armor = 2; + armorStructural = 5;*/ }; class B_Soldier_02_f: B_Soldier_base_F { // t-shirt - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + }; - class HitBody: HitBody { - armor = 1; - }; + class HitBody: HitBody { + armor = 1; + }; - class HitHands: HitHands { - armor = 1; - }; + class HitHands: HitHands { + armor = 1; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ - armorStructural = 5; //7; + armorStructural = 5; //7; }; class B_Soldier_03_f: B_Soldier_base_F { // sleeves - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + }; - class HitBody: HitBody { - armor = 2; - }; + class HitBody: HitBody { + armor = 2; + }; - class HitHands: HitHands { - armor = 1; - }; + class HitHands: HitHands { + armor = 1; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ - armorStructural = 5; //7; + armorStructural = 5; //7; }; class B_Soldier_04_f: B_Soldier_base_F { // heli pilot - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; + class HitPoints: HitPoints { + class HitHead: HitHead { + /*armor = 1; + passThrough = 1; + explosionShielding = 0.5;*/ + }; - class HitBody: HitBody { - /*armor = 2;*/ - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; + class HitBody: HitBody { + /*armor = 2;*/ + passThrough = 1; //0.5; + /*explosionShielding = 2.4;*/ + }; - class HitHands: HitHands { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ - }; + class HitHands: HitHands { + armor = 2; //8; + passThrough = 1; //0.5; + /*explosionShielding = 1.2;*/ + }; - class HitLegs: HitLegs { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ + class HitLegs: HitLegs { + armor = 2; //8; + passThrough = 1; //0.5; + /*explosionShielding = 1.2;*/ + }; }; - }; }; class B_Soldier_05_f: B_Soldier_base_F { // cas pilot - armorStructural = 5; //3; + armorStructural = 5; //3; - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; + class HitPoints: HitPoints { + class HitHead: HitHead { + /*armor = 1; + passThrough = 1; + explosionShielding = 0.5;*/ + }; - class HitBody: HitBody { - armor = 3; //2; - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; + class HitBody: HitBody { + armor = 3; //2; + passThrough = 1; //0.5; + /*explosionShielding = 2.4;*/ + }; - class HitHands: HitHands { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ - }; + class HitHands: HitHands { + armor = 3; //8; + /*passThrough = 1; + explosionShielding = 1.2;*/ + }; - class HitLegs: HitLegs { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ + class HitLegs: HitLegs { + armor = 3; //8; + /*passThrough = 1; + explosionShielding = 1.2;*/ + }; }; - }; }; class B_Soldier_diver_base_F: B_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 2; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 2; + }; - class HitBody: HitBody { - armor = 2; - }; + class HitBody: HitBody { + armor = 2; + }; - class HitHands: HitHands { - armor = 2; - }; + class HitHands: HitHands { + armor = 2; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ }; // these appear to be broken, remnants from A2? /*class C_man_p_fugitive_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.3*10"; - }; + class HitPoints: HitPoints { + class HitBody: HitBody { + armor = "0.3*10"; + }; - class HitLegs: HitLegs { - armor = "0.3*5"; + class HitLegs: HitLegs { + armor = "0.3*5"; + }; }; - }; }; class C_man_w_worker_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.6*10"; - }; + class HitPoints: HitPoints { + class HitBody: HitBody { + armor = "0.6*10"; + }; - class HitHands: HitHands { - armor = "0.5*5"; - }; + class HitHands: HitHands { + armor = "0.5*5"; + }; - class HitLegs: HitLegs { - armor = "0.5*5"; + class HitLegs: HitLegs { + armor = "0.5*5"; + }; }; - }; }; class C_man_hunter_1_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.6*10"; - }; + class HitPoints: HitPoints { + class HitBody: HitBody { + armor = "0.6*10"; + }; - class HitHands: HitHands { - armor = "0.5*5"; - }; + class HitHands: HitHands { + armor = "0.5*5"; + }; - class HitLegs: HitLegs { - armor = "0.5*5"; + class HitLegs: HitLegs { + armor = "0.5*5"; + }; }; - }; }; class C_man_p_shorts_1_F: C_man_1 { - class HitPoints: HitPoints { - class HitLegs: HitLegs { - armor = "0.3*5"; + class HitPoints: HitPoints { + class HitLegs: HitLegs { + armor = "0.3*5"; + }; }; - }; }; class C_man_pilot_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.6*10"; - }; + class HitPoints: HitPoints { + class HitBody: HitBody { + armor = "0.6*10"; + }; - class HitHands: HitHands { - armor = "0.5*5"; - }; + class HitHands: HitHands { + armor = "0.5*5"; + }; - class HitLegs: HitLegs { - armor = "0.5*5"; + class HitLegs: HitLegs { + armor = "0.5*5"; + }; }; - }; };*/ class I_Soldier_base_F: SoldierGB { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + }; - class HitBody: HitBody { - armor = 2; - }; + class HitBody: HitBody { + armor = 2; + }; - class HitHands: HitHands { - armor = 2; - }; + class HitHands: HitHands { + armor = 2; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ - /*armor = 2;*/ - armorStructural = 5; //7; + /*armor = 2;*/ + armorStructural = 5; //7; }; class I_Soldier_02_F: I_Soldier_base_F { // sleeves - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + }; - class HitBody: HitBody { - armor = 2; - }; + class HitBody: HitBody { + armor = 2; + }; - class HitHands: HitHands { - armor = 1; - }; + class HitHands: HitHands { + armor = 1; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ }; class I_Soldier_03_F: I_Soldier_base_F { // heli pilot - /*armorStructural = 5;*/ + /*armorStructural = 5;*/ - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; + class HitPoints: HitPoints { + class HitHead: HitHead { + /*armor = 1; + passThrough = 1; + explosionShielding = 0.5;*/ + }; - class HitBody: HitBody { - /*armor = 2;*/ - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; + class HitBody: HitBody { + /*armor = 2;*/ + passThrough = 1; //0.5; + /*explosionShielding = 2.4;*/ + }; - class HitHands: HitHands { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ - }; + class HitHands: HitHands { + armor = 2; //8; + passThrough = 1; //0.5; + /*explosionShielding = 1.2;*/ + }; - class HitLegs: HitLegs { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ + class HitLegs: HitLegs { + armor = 2; //8; + passThrough = 1; //0.5; + /*explosionShielding = 1.2;*/ + }; }; - }; }; class I_Soldier_04_F: I_Soldier_base_F { // cas pilot - armorStructural = 5; //3; + armorStructural = 5; //3; - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; + class HitPoints: HitPoints { + class HitHead: HitHead { + /*armor = 1; + passThrough = 1; + explosionShielding = 0.5;*/ + }; - class HitBody: HitBody { - armor = 3; //2; - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; + class HitBody: HitBody { + armor = 3; //2; + passThrough = 1; //0.5; + /*explosionShielding = 2.4;*/ + }; - class HitHands: HitHands { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ - }; + class HitHands: HitHands { + armor = 3; //8; + /*passThrough = 1; + explosionShielding = 1.2;*/ + }; - class HitLegs: HitLegs { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ + class HitLegs: HitLegs { + armor = 3; //8; + /*passThrough = 1; + explosionShielding = 1.2;*/ + }; }; - }; }; class I_Soldier_diver_base_F: I_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 2; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 2; + }; - class HitBody: HitBody { - armor = 2; - }; + class HitBody: HitBody { + armor = 2; + }; - class HitHands: HitHands { - armor = 2; - }; + class HitHands: HitHands { + armor = 2; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ }; class O_Soldier_base_F: SoldierEB { - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ + class HitPoints: HitPoints { + class HitHead: HitHead { + /*armor = 1; + passThrough = 1; + explosionShielding = 0.5;*/ + }; + + class HitBody: HitBody { + armor = 4; //6; + passThrough = 0.85; //0.5; + /*explosionShielding = 1.5;*/ + }; + + class HitHands: HitHands { + armor = 4; //8; + passThrough = 0.85; //0.5; + /*explosionShielding = 0.8;*/ + }; + + class HitLegs: HitLegs { + armor = 4; //8; + passThrough = 0.85; //0.5; + /*explosionShielding = 0.8;*/ + }; }; - class HitBody: HitBody { - armor = 4; //6; - passThrough = 0.85; //0.5; - /*explosionShielding = 1.5;*/ - }; - - class HitHands: HitHands { - armor = 4; //8; - passThrough = 0.85; //0.5; - /*explosionShielding = 0.8;*/ - }; - - class HitLegs: HitLegs { - armor = 4; //8; - passThrough = 0.85; //0.5; - /*explosionShielding = 0.8;*/ - }; - }; - - /*armor = 2; - armorStructural = 5;*/ + /*armor = 2; + armorStructural = 5;*/ }; class O_officer_F: O_Soldier_base_F { - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; + class HitPoints: HitPoints { + class HitHead: HitHead { + /*armor = 1; + passThrough = 1; + explosionShielding = 0.5;*/ + }; - class HitBody: HitBody { - /*armor = 2; - passThrough = 1; - explosionShielding = 10;*/ - }; + class HitBody: HitBody { + /*armor = 2; + passThrough = 1; + explosionShielding = 10;*/ + }; - class HitHands: HitHands { - /*armor = 2; - passThrough = 1; - explosionShielding = 1;*/ - }; + class HitHands: HitHands { + /*armor = 2; + passThrough = 1; + explosionShielding = 1;*/ + }; - class HitLegs: HitLegs { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1;*/ + class HitLegs: HitLegs { + armor = 2; //8; + passThrough = 1; //0.5; + /*explosionShielding = 1;*/ + }; }; - }; }; class O_Soldier_02_F: O_Soldier_base_F { // crew ? - armorStructural = 5; //3; + armorStructural = 5; //3; - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; + class HitPoints: HitPoints { + class HitHead: HitHead { + /*armor = 1; + passThrough = 1; + explosionShielding = 0.5;*/ + }; - class HitBody: HitBody { - armor = 4; //6; - passThrough = 0.85; //0.5; - /*explosionShielding = 1.5;*/ - }; + class HitBody: HitBody { + armor = 4; //6; + passThrough = 0.85; //0.5; + /*explosionShielding = 1.5;*/ + }; - class HitHands: HitHands { - armor = 4; //8; - passThrough = 0.85; //1; - /*explosionShielding = 0.8;*/ - }; + class HitHands: HitHands { + armor = 4; //8; + passThrough = 0.85; //1; + /*explosionShielding = 0.8;*/ + }; - class HitLegs: HitLegs { - armor = 4; //8; - passThrough = 0.85; //1; - /*explosionShielding = 0.8;*/ + class HitLegs: HitLegs { + armor = 4; //8; + passThrough = 0.85; //1; + /*explosionShielding = 0.8;*/ + }; }; - }; }; class O_Soldier_diver_base_F: O_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 2; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 2; + }; - class HitBody: HitBody { - armor = 2; - }; + class HitBody: HitBody { + armor = 2; + }; - class HitHands: HitHands { - armor = 2; - }; + class HitHands: HitHands { + armor = 2; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ }; class O_Soldier_VR_F: O_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - passThrough = 1; - explosionShielding = 0.5; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + passThrough = 1; + explosionShielding = 0.5; + }; - class HitBody: HitBody { - armor = 2; - passThrough = 1; - explosionShielding = 10; - }; + class HitBody: HitBody { + armor = 2; + passThrough = 1; + explosionShielding = 10; + }; - class HitHands: HitHands { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; + class HitHands: HitHands { + armor = 2; + passThrough = 1; + explosionShielding = 1; + }; - class HitLegs: HitLegs { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + passThrough = 1; + explosionShielding = 1; + }; + };*/ }; class O_Protagonist_VR_F: O_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - passThrough = 1; - explosionShielding = 0.5; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + passThrough = 1; + explosionShielding = 0.5; + }; - class HitBody: HitBody { - armor = 2; - passThrough = 1; - explosionShielding = 10; - }; + class HitBody: HitBody { + armor = 2; + passThrough = 1; + explosionShielding = 10; + }; - class HitHands: HitHands { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; + class HitHands: HitHands { + armor = 2; + passThrough = 1; + explosionShielding = 1; + }; - class HitLegs: HitLegs { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + passThrough = 1; + explosionShielding = 1; + }; + };*/ }; diff --git a/addons/protection/FixVests.hpp b/addons/protection/FixVests.hpp index 77354ca930..f3d1ad2b3d 100644 --- a/addons/protection/FixVests.hpp +++ b/addons/protection/FixVests.hpp @@ -3,296 +3,296 @@ class ItemCore; class VestItem; class Vest_Camo_Base: ItemCore { - class ItemInfo: VestItem { - /*containerClass = "Supply0"; - mass = 0; - armor = 0; - passThrough = 1;*/ - }; + class ItemInfo: VestItem { + /*containerClass = "Supply0"; + mass = 0; + armor = 0; + passThrough = 1;*/ + }; }; class Vest_NoCamo_Base: ItemCore { - class ItemInfo: VestItem { - /*containerClass = "Supply0"; - mass = 0; - armor = 0; - passThrough = 1;*/ - }; + class ItemInfo: VestItem { + /*containerClass = "Supply0"; + mass = 0; + armor = 0; + passThrough = 1;*/ + }; }; // belts class V_Rangemaster_belt: Vest_NoCamo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply40"; - mass = 10; - armor = 0; - passThrough = 1;*/ - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply40"; + mass = 10; + armor = 0; + passThrough = 1;*/ + }; }; // bandolliers class V_BandollierB_khk: Vest_Camo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply80"; - mass = 15; - armor = 0;*/ - passThrough = 0.85; //1; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply80"; + mass = 15; + armor = 0;*/ + passThrough = 0.85; //1; + }; }; /*class V_BandollierB_cbr: V_BandollierB_khk { - class ItemInfo: ItemInfo {}; + class ItemInfo: ItemInfo {}; }; class V_BandollierB_rgr: V_BandollierB_khk { - class ItemInfo: ItemInfo {}; + class ItemInfo: ItemInfo {}; }; class V_BandollierB_blk: V_BandollierB_khk { - class ItemInfo: ItemInfo {}; + class ItemInfo: ItemInfo {}; }; class V_BandollierB_oli: V_BandollierB_khk { - class ItemInfo: ItemInfo {}; + class ItemInfo: ItemInfo {}; };*/ // plate carriers class V_PlateCarrier1_rgr: Vest_NoCamo_Base { // lite - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 80;*/ - armor = 8; //20; - passThrough = 0.75; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply140"; + mass = 80;*/ + armor = 8; //20; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrier2_rgr: V_PlateCarrier1_rgr { // heavy - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 100;*/ - armor = 12; //30; - passThrough = 0.75; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply140"; + mass = 100;*/ + armor = 12; //30; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrier3_rgr: Vest_NoCamo_Base { // heavy (us) - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 100;*/ - armor = 12; //30; - passThrough = 0.75; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply140"; + mass = 100;*/ + armor = 12; //30; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrierGL_rgr: Vest_NoCamo_Base { // lite (gl) - class ItemInfo: ItemInfo { - containerClass = "Supply160"; //"Supply140"; - /*mass = 100;*/ - armor = 8; //100; - passThrough = 0.75; //0.7; - }; + class ItemInfo: ItemInfo { + containerClass = "Supply160"; //"Supply140"; + /*mass = 100;*/ + armor = 8; //100; + passThrough = 0.75; //0.7; + }; }; class V_PlateCarrier1_blk: Vest_Camo_Base { // heavy (black) - class ItemInfo: ItemInfo { - /*containerClass = "Supply140";*/ - mass = 100; //80; - armor = 12; //20; - passThrough = 0.75; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply140";*/ + mass = 100; //80; + armor = 12; //20; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrierSpec_rgr: Vest_NoCamo_Base { // lite (special) - class ItemInfo: ItemInfo { - /*containerClass = "Supply100"; - mass = 120;*/ - armor = 16; //40; - passThrough = 0.75; //0.1; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply100"; + mass = 120;*/ + armor = 16; //40; + passThrough = 0.75; //0.1; + }; }; // chestrigs /*class V_Chestrig_khk: Vest_Camo_Base { - class ItemInfo: ItemInfo { - containerClass = "Supply140"; - mass = 20; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + containerClass = "Supply140"; + mass = 20; + armor = 0; + passThrough = 1; + }; }; class V_Chestrig_rgr: V_Chestrig_khk {}; class V_Chestrig_blk: V_Chestrig_khk {}; class V_Chestrig_oli: Vest_Camo_Base { - class ItemInfo: ItemInfo { - containerClass = "Supply140"; - mass = 20; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + containerClass = "Supply140"; + mass = 20; + armor = 0; + passThrough = 1; + }; };*/ // tactical vests class V_TacVest_khk: Vest_Camo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply100"; - mass = 40;*/ - armor = 8; //20; - /*passThrough = 1;*/ - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply100"; + mass = 40;*/ + armor = 8; //20; + /*passThrough = 1;*/ + }; }; class V_TacVest_brn: V_TacVest_khk {}; class V_TacVest_oli: V_TacVest_khk {}; class V_TacVest_blk: V_TacVest_khk {}; class V_TacVest_camo: Vest_Camo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply100"; - mass = 40;*/ - armor = 8; //20; - /*passThrough = 1;*/ - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply100"; + mass = 40;*/ + armor = 8; //20; + /*passThrough = 1;*/ + }; }; class V_TacVest_blk_POLICE: Vest_Camo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply100";*/ - mass = 40; //60; - armor = 8; //100; - passThrough = 1; //0.7; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply100";*/ + mass = 40; //60; + armor = 8; //100; + passThrough = 1; //0.7; + }; }; class V_TacVestIR_blk: Vest_NoCamo_Base { // raven vest - class ItemInfo: VestItem { - /*containerClass = "Supply100"; - mass = 50;*/ - armor = 8; //20; - passThrough = 0.85; //0.5; - }; + class ItemInfo: VestItem { + /*containerClass = "Supply100"; + mass = 50;*/ + armor = 8; //20; + passThrough = 0.85; //0.5; + }; }; class V_TacVestCamo_khk: Vest_Camo_Base { - class ItemInfo: VestItem { - /*containerClass = "Supply100"; - mass = 40;*/ - armor = 8; //20; - /*passThrough = 1;*/ - }; + class ItemInfo: VestItem { + /*containerClass = "Supply100"; + mass = 40;*/ + armor = 8; //20; + /*passThrough = 1;*/ + }; }; // harnesses class V_HarnessO_brn: Vest_NoCamo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply160"; - mass = 30; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply160"; + mass = 30; + armor = 0;*/ + passThrough = 0.85; //0.5; + }; }; class V_HarnessOGL_brn: Vest_NoCamo_Base { // gl - class ItemInfo: ItemInfo { - /*containerClass = "Supply120"; - mass = 20; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply120"; + mass = 20; + armor = 0;*/ + passThrough = 0.85; //0.5; + }; }; class V_HarnessO_gry: V_HarnessO_brn { - class ItemInfo: ItemInfo { - /*containerClass = "Supply160"; - mass = 30; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply160"; + mass = 30; + armor = 0;*/ + passThrough = 0.85; //0.5; + }; }; class V_HarnessOGL_gry: V_HarnessO_gry { // gl - class ItemInfo: ItemInfo { - /*containerClass = "Supply120"; - mass = 20; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply120"; + mass = 20; + armor = 0;*/ + passThrough = 0.85; //0.5; + }; }; class V_HarnessOSpec_brn: V_HarnessO_brn { - class ItemInfo: VestItem { - /*containerClass = "Supply160"; - mass = 30; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; + class ItemInfo: VestItem { + /*containerClass = "Supply160"; + mass = 30; + armor = 0;*/ + passThrough = 0.85; //0.5; + }; }; class V_HarnessOSpec_gry: V_HarnessO_gry { - class ItemInfo: ItemInfo { - /*containerClass = "Supply160"; - mass = 30; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply160"; + mass = 30; + armor = 0;*/ + passThrough = 0.85; //0.5; + }; }; // indep plate carriers class V_PlateCarrierIA1_dgtl: Vest_NoCamo_Base { // lite - class ItemInfo: VestItem { - /*containerClass = "Supply120"; - mass = 60;*/ - armor = 8; //20; - passThrough = 0.75; //0.5; - }; + class ItemInfo: VestItem { + /*containerClass = "Supply120"; + mass = 60;*/ + armor = 8; //20; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrierIA2_dgtl: V_PlateCarrierIA1_dgtl { // heavy - class ItemInfo: VestItem { - /*containerClass = "Supply120"; - mass = 80;*/ - armor = 12; //30; - passThrough = 0.75; //0.5; - }; + class ItemInfo: VestItem { + /*containerClass = "Supply120"; + mass = 80;*/ + armor = 12; //30; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrierIAGL_dgtl: V_PlateCarrierIA2_dgtl { // heavy (gl) - class ItemInfo: VestItem { - containerClass = "Supply140"; //"Supply120"; - mass = 100; //80; - armor = 12; //100; - passThrough = 0.75; //0.7; - }; + class ItemInfo: VestItem { + containerClass = "Supply140"; //"Supply120"; + mass = 100; //80; + armor = 12; //100; + passThrough = 0.75; //0.7; + }; }; // rebreather /*class V_RebreatherB: Vest_Camo_Base { - class ItemInfo: ItemInfo { - containerClass = "Supply0"; - mass = 80; - armor = 20; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + containerClass = "Supply0"; + mass = 80; + armor = 20; + passThrough = 1; + }; }; class V_RebreatherIR: V_RebreatherB {}; class V_RebreatherIA: V_RebreatherB {};*/ // more plate carriers class V_PlateCarrier_Kerry: V_PlateCarrier1_rgr { // lighter - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 80;*/ - armor = 8; //30; - passThrough = 0.75; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply140"; + mass = 80;*/ + armor = 8; //30; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrierL_CTRG: V_PlateCarrier1_rgr { // lite - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 80;*/ - armor = 8; //20; - passThrough = 0.75; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply140"; + mass = 80;*/ + armor = 8; //20; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrierH_CTRG: V_PlateCarrier2_rgr { // heavy - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 100;*/ - armor = 12; //30; - passThrough = 0.75; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply140"; + mass = 100;*/ + armor = 12; //30; + passThrough = 0.75; //0.5; + }; }; // another tactical vest class V_I_G_resistanceLeader_F: V_TacVest_camo { - class ItemInfo: ItemInfo {}; + class ItemInfo: ItemInfo {}; }; // press vest class V_Press_F: Vest_Camo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply40"; - mass = 20;*/ - armor = 8; //0; ? - /*passThrough = 1;*/ - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply40"; + mass = 20;*/ + armor = 8; //0; ? + /*passThrough = 1;*/ + }; }; // marksman dlc From c3b9d4283448db397bc6346da3acc081de736f4e Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 28 Mar 2015 12:39:51 +0100 Subject: [PATCH 21/39] prepare realistic names for marksman --- addons/realisticnames/CfgVehicles.hpp | 81 ++++++++++++++++++ addons/realisticnames/CfgWeapons.hpp | 114 ++++++++++++++++++++++++++ addons/realisticnames/stringtable.xml | 94 ++++++++++++++++++++- 3 files changed, 288 insertions(+), 1 deletion(-) diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp index 218e04ff09..0fa3111243 100644 --- a/addons/realisticnames/CfgVehicles.hpp +++ b/addons/realisticnames/CfgVehicles.hpp @@ -552,4 +552,85 @@ class CfgVehicles { class Weapon_srifle_DMR_01_F: Weapon_Base_F { displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; }; + + // marksmen + /*class Weapon_srifle_DMR_02_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_02"; + }; + + class Weapon_srifle_DMR_02_camo_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_camo"; + }; + + class Weapon_srifle_DMR_02_sniper_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_sniper"; + }; + + class Weapon_srifle_DMR_03_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03"; + }; + + class Weapon_srifle_DMR_03_khaki_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_khaki"; + }; + + class Weapon_srifle_DMR_03_tan_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_tan"; + }; + + class Weapon_srifle_DMR_03_multicam_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_multicam"; + }; + + class Weapon_srifle_DMR_03_woodland_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_woodland"; + }; + + class Weapon_srifle_DMR_04_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_04"; + }; + + class Weapon_srifle_DMR_04_Tan_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_04_Tan"; + }; + + class Weapon_srifle_DMR_05_blk_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_blk"; + }; + + class Weapon_srifle_DMR_05_hex_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_hex"; + }; + + class Weapon_srifle_DMR_05_tan_f: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_tan"; + }; + + class Weapon_srifle_DMR_06_camo_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_camo"; + }; + + class Weapon_srifle_DMR_06_olive_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_olive"; + }; + + class Weapon_MMG_01_hex_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_MMG_01_hex"; + }; + + class Weapon_MMG_01_tan_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_MMG_01_tan"; + }; + + class Weapon_MMG_02_camo_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_MMG_02_camo"; + }; + + class Weapon_MMG_02_black_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_MMG_02_black"; + }; + + class Weapon_MMG_02_sand_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_MMG_02_sand"; + };*/ }; diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp index 8e64434bd4..56d9e3b7c8 100644 --- a/addons/realisticnames/CfgWeapons.hpp +++ b/addons/realisticnames/CfgWeapons.hpp @@ -192,6 +192,120 @@ class CfgWeapons { displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; }; + // marksmen marksman + /*class DMR_02_base_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_DMR_02"; //MAR-10 .338"; + }; + + class srifle_DMR_02_F: DMR_02_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_02"; //MAR-10 .338 (Black)"; + }; + + class srifle_DMR_02_camo_F: srifle_DMR_02_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_camo"; //MAR-10 .338 (Camo)"; + }; + + class srifle_DMR_02_sniper_F: srifle_DMR_02_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_sniper"; //MAR-10 .338 (Sand)"; + }; + + class DMR_03_base_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_DMR_03"; //Mk-I EMR 7.62 mm"; + }; + + class srifle_DMR_03_F: DMR_03_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03"; //Mk-I EMR 7.62 mm (Black)"; + }; + + class srifle_DMR_03_khaki_F: srifle_DMR_03_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_khaki"; //Mk-I EMR 7.62 mm (Khaki)"; + }; + + class srifle_DMR_03_tan_F: srifle_DMR_03_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_tan"; //Mk-I EMR 7.62 mm (Sand)"; + }; + + class srifle_DMR_03_multicam_F: srifle_DMR_03_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_multicam"; //Mk-I EMR 7.62 mm (Camo)"; + }; + + class srifle_DMR_03_woodland_F: srifle_DMR_03_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_woodland"; //Mk-I EMR 7.62 mm (Woodland)"; + }; + + class srifle_DMR_03_spotter_F: srifle_DMR_03_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_spotter"; //NATO DMR (provisional) spotter"; + }; + + class DMR_04_base_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_DMR_04"; //ASP-1 Kir 12.7 mm"; + }; + + class srifle_DMR_04_F: DMR_04_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_04"; //ASP-1 Kir 12.7 mm (Black)"; + }; + + class srifle_DMR_04_Tan_F: srifle_DMR_04_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_04_Tan"; //ASP-1 Kir 12.7 mm (Tan)"; + }; + + class DMR_05_base_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_DMR_05"; //Cyrus 9.3 mm"; + }; + + class srifle_DMR_05_blk_F: DMR_05_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_blk"; //Cyrus 9.3 mm (Black) + }; + + class srifle_DMR_05_hex_F: srifle_DMR_05_blk_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_hex"; //Cyrus 9.3 mm (Hex)"; + }; + + class srifle_DMR_05_tan_f: srifle_DMR_05_blk_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_tan"; //Cyrus 9.3 mm (Tan)"; + }; + + class DMR_06_base_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_DMR_06"; //Mk14 7.62 mm"; + }; + + class srifle_DMR_06_camo_F: DMR_06_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_camo"; //Mk14 7.62 mm (Camo) + }; + + class srifle_DMR_06_olive_F: srifle_DMR_06_camo_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_olive"; //Mk14 7.62 mm (Olive)"; + }; + + // marksmen mgs + class MMG_01_base_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_MMG_01"; //Navid 9.3 mm"; + }; + + class MMG_01_hex_F: MMG_01_base_F { + displayName = "$STR_ACE_RealisticNames_MMG_01_hex"; //Navid 9.3 mm (Hex)"; + }; + + class MMG_01_tan_F: MMG_01_hex_F { + displayName = "$STR_ACE_RealisticNames_MMG_01_tan"; //Navid 9.3 mm (Tan)"; + }; + + class MMG_02_base_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_MMG_02"; //SPMG .338"; + }; + + class MMG_02_camo_F: MMG_02_base_F { + displayName = "$STR_ACE_RealisticNames_MMG_02_camo"; //SPMG .338 (MTP)"; + }; + + class MMG_02_black_F: MMG_02_camo_F { + displayName = "$STR_ACE_RealisticNames_MMG_02_black"; //SPMG .338 (Black)"; + }; + + class MMG_02_sand_F: MMG_02_camo_F { + displayName = "$STR_ACE_RealisticNames_MMG_02_sand"; //SPMG .338 (Sand)"; + };*/ + // vehicle weapons // gatlings diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 8c1483ead2..9ccd7752d2 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -1214,5 +1214,97 @@ VS-121 VS-121 + + + TODO: MAR-10 .338 + + + TODO: MAR-10 .338 (Black) + + + TODO: MAR-10 .338 (Camo) + + + TODO: MAR-10 .338 (Sand) + + + + TODO: Mk-I EMR 7.62 mm + + + TODO: Mk-I EMR 7.62 mm (Black) + + + TODO: Mk-I EMR 7.62 mm (Khaki) + + + TODO: Mk-I EMR 7.62 mm (Sand) + + + TODO: Mk-I EMR 7.62 mm (Camo) + + + TODO: Mk-I EMR 7.62 mm (Woodland) + + + TODO: NATO DMR (provisional) spotter + + + + TODO: ASP-1 Kir 12.7 mm + + + TODO: ASP-1 Kir 12.7 mm (Black) + + + TODO: ASP-1 Kir 12.7 mm (Tan) + + + + TODO: Cyrus 9.3 mm + + + TODO: Cyrus 9.3 mm (Black) + + + TODO: Cyrus 9.3 mm (Hex) + + + TODO: Cyrus 9.3 mm (Tan) + + + + TODO: Mk14 7.62 mm + + + TODO: Mk14 7.62 mm (Camo) + + + TODO: Mk14 7.62 mm (Olive) + + + + TODO: Navid 9.3 mm + + + TODO: Navid 9.3 mm (Hex) + + + TODO: Navid 9.3 mm (Tan) + + + + TODO: SPMG .338 + + + TODO: SPMG .338 (MTP) + + + TODO: SPMG .338 (Black) + + + TODO: SPMG .338 (Sand) + + - \ No newline at end of file + From e574d198443c95d53a36968fef70e82078a0919d Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 28 Mar 2015 16:24:17 +0100 Subject: [PATCH 22/39] 1.42 - cursor mode when bipod deployed --- addons/interact_menu/functions/fnc_keyDown.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index faa5b0f453..d4a7f8a96e 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -32,7 +32,7 @@ GVAR(openedMenuType) = _menuType; GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) || visibleMap || - (GVAR(AlwaysUseCursorSelfInteraction) && _menuType == 1); + {(_menuType == 1) && {(isWeaponDeployed ACE_player) || GVAR(AlwaysUseCursorSelfInteraction)}}; if (GVAR(useCursorMenu)) then { createDialog QGVAR(cursorMenu); // The dialog sets: From 95a9daf18b070f6253380cd99aecfc8a1538f3e5 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 28 Mar 2015 19:08:25 -0500 Subject: [PATCH 23/39] Minor Header Correction --- addons/interact_menu/functions/fnc_addActionToObject.sqf | 2 +- addons/interact_menu/functions/fnc_createAction.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/interact_menu/functions/fnc_addActionToObject.sqf b/addons/interact_menu/functions/fnc_addActionToObject.sqf index 9c4b5013ae..5c736a2da6 100644 --- a/addons/interact_menu/functions/fnc_addActionToObject.sqf +++ b/addons/interact_menu/functions/fnc_addActionToObject.sqf @@ -13,7 +13,7 @@ * The entry full path, which can be used to remove the entry, or add children entries . * * Example: - * [typeOf cursorTarget, 0, ["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToClass; + * [cursorTarget, 0, ["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToObject; * * Public: No */ diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf index 768d51f2a7..172bbea3a4 100644 --- a/addons/interact_menu/functions/fnc_createAction.sqf +++ b/addons/interact_menu/functions/fnc_createAction.sqf @@ -19,7 +19,7 @@ * Action * * Example: - * [VulcanPinch","Vulcan Pinch",{_target setDamage 1;},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction; + * [VulcanPinch","Vulcan Pinch","",{_target setDamage 1;},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction; * * Public: No */ From 4a9124c170869e147298dc78c199883ee67c0919 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 29 Mar 2015 14:09:51 +0200 Subject: [PATCH 24/39] changed behavior of silencers from Marksmen --- addons/magazines/CfgWeapons.hpp | 80 ++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 7 deletions(-) diff --git a/addons/magazines/CfgWeapons.hpp b/addons/magazines/CfgWeapons.hpp index 2b24d578fe..46344d5f06 100644 --- a/addons/magazines/CfgWeapons.hpp +++ b/addons/magazines/CfgWeapons.hpp @@ -230,7 +230,7 @@ class CfgWeapons { class muzzle_snds_H: ItemCore { class ItemInfo: InventoryMuzzleItem_Base_F { class MagazineCoef { - initSpeed = 1.0; + initSpeed = 1.05; }; class AmmoCoef { @@ -263,7 +263,7 @@ class CfgWeapons { class muzzle_snds_L: muzzle_snds_H { class ItemInfo: ItemInfo { class MagazineCoef { - initSpeed = 1.0; + initSpeed = 1.05; }; class AmmoCoef { @@ -296,7 +296,7 @@ class CfgWeapons { class muzzle_snds_M: muzzle_snds_H { class ItemInfo: ItemInfo { class MagazineCoef { - initSpeed = 1.0; + initSpeed = 1.05; }; class AmmoCoef { @@ -329,7 +329,7 @@ class CfgWeapons { class muzzle_snds_B: muzzle_snds_H { class ItemInfo: ItemInfo { class MagazineCoef { - initSpeed = 1.0; + initSpeed = 1.05; }; class AmmoCoef { @@ -362,7 +362,7 @@ class CfgWeapons { class muzzle_snds_H_MG: muzzle_snds_H { class ItemInfo: ItemInfo { class MagazineCoef { - initSpeed = 1.0; + initSpeed = 1.05; }; class AmmoCoef { @@ -395,7 +395,7 @@ class CfgWeapons { class muzzle_snds_H_SW: muzzle_snds_H_MG { class ItemInfo: ItemInfo { class MagazineCoef { - initSpeed = 1.0; + initSpeed = 1.05; }; class AmmoCoef { @@ -428,7 +428,73 @@ class CfgWeapons { class muzzle_snds_acp: muzzle_snds_H { class ItemInfo: ItemInfo { class MagazineCoef { - initSpeed = 1.0; + initSpeed = 1.05; + }; + + class AmmoCoef { + hit = 0.9; + visibleFire = 0.5; + audibleFire = 0.1; + visibleFireTime = 0.5; + audibleFireTime = 0.5; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.8f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + }; + + class muzzle_snds_338_black: ItemCore { + class ItemInfo: InventoryMuzzleItem_Base_F { + class MagazineCoef { + initSpeed = 1.05; + }; + + class AmmoCoef { + hit = 0.9; + visibleFire = 0.5; + audibleFire = 0.1; + visibleFireTime = 0.5; + audibleFireTime = 0.5; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.8f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + }; + + class muzzle_snds_93mmg: ItemCore { + class ItemInfo: InventoryMuzzleItem_Base_F { + class MagazineCoef { + initSpeed = 1.05; }; class AmmoCoef { From 6ca84c3d31f0108452a8c63a0a36f364b8508153 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 29 Mar 2015 14:25:13 +0200 Subject: [PATCH 25/39] delete obsolete ammo configs --- addons/ballistics/CfgAmmo.hpp | 41 ------------------- addons/ballistics/CfgMagazines.hpp | 65 ------------------------------ addons/ballistics/config.cpp | 2 - 3 files changed, 108 deletions(-) delete mode 100644 addons/ballistics/CfgAmmo.hpp delete mode 100644 addons/ballistics/CfgMagazines.hpp diff --git a/addons/ballistics/CfgAmmo.hpp b/addons/ballistics/CfgAmmo.hpp deleted file mode 100644 index 6e11038924..0000000000 --- a/addons/ballistics/CfgAmmo.hpp +++ /dev/null @@ -1,41 +0,0 @@ - -class CfgAmmo { - - /* 6.5x39mm Grendel */ - - class BulletBase; - class B_65x39_Caseless: BulletBase { - typicalSpeed = 724; - airFriction = -0.000915; - }; - - - /* 5.56x45mm NATO */ - - class B_556x45_Ball: BulletBase { - typicalSpeed = 911; - airFriction = -0.001335; - }; - - - /* 7.62x51mm NATO */ - - class B_762x51_Ball: BulletBase { - typicalSpeed = 853; - //airfriction = - }; - - - /* Other */ - - class B_9x21_Ball; - class B_9x19_Ball: B_9x21_Ball { - typicalSpeed = 381; - airfriction = -0.00213; - }; - - class B_45ACP_Ball: BulletBase { - typicalSpeed = 250; - airfriction = -0.0009; - }; -}; diff --git a/addons/ballistics/CfgMagazines.hpp b/addons/ballistics/CfgMagazines.hpp deleted file mode 100644 index 1c5dabacd8..0000000000 --- a/addons/ballistics/CfgMagazines.hpp +++ /dev/null @@ -1,65 +0,0 @@ - -class CfgMagazines { - - /* 6.5x39mm Grendel - MX */ - - class CA_Magazine; - class 30Rnd_65x39_caseless_mag: CA_Magazine { - initSpeed = 724; - }; - - class 100Rnd_65x39_caseless_mag: CA_Magazine { - initSpeed = 724; - }; - - - /* 6.5x39mm Grendel - Katiba */ - - class 30Rnd_65x39_caseless_green: 30Rnd_65x39_caseless_mag { - initSpeed = 724; - }; - - class 200Rnd_65x39_cased_Box: 100Rnd_65x39_caseless_mag { - initSpeed = 691; - }; - - - /* 5.56x45mm NATO */ - - class 30Rnd_556x45_Stanag: CA_Magazine { - initSpeed = 911; - }; - - - /* 7.62x51mm NATO */ - - class 20Rnd_762x51_Mag: CA_Magazine { - initSpeed = 792; // 18" M14 EBR barrel - }; - - class 150Rnd_762x51_Box: CA_Magazine { - ammo = "B_762x51_Ball"; - initSpeed = 853; // Typical MV for M240 - }; - - - /* Other */ - - class 30Rnd_9x21_Mag: CA_Magazine { - ammo = "B_9x19_Ball"; - initSpeed = 370; - }; - - class 16Rnd_9x21_Mag: 30Rnd_9x21_Mag { - ammo = "B_9x19_Ball"; - initSpeed = 381; - }; - - class 30Rnd_45ACP_Mag_SMG_01: 30Rnd_9x21_Mag { - initSpeed = 259; - }; - - class 9Rnd_45ACP_Mag: 30Rnd_45ACP_Mag_SMG_01 { - initSpeed = 250; - }; -}; diff --git a/addons/ballistics/config.cpp b/addons/ballistics/config.cpp index e94c9f4efb..c526b0f7d4 100644 --- a/addons/ballistics/config.cpp +++ b/addons/ballistics/config.cpp @@ -12,7 +12,5 @@ class CfgPatches { }; }; -#include "CfgAmmo.hpp" -#include "CfgMagazines.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" From 24b47584a28742fc45278247e0f94222eb3cd9c1 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 29 Mar 2015 12:04:57 -0500 Subject: [PATCH 26/39] InteractMenu - Fix Actions Added to Objects --- addons/interact_menu/functions/fnc_renderActionPoints.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index d35bcc9a93..a2f9d929c1 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -38,7 +38,7 @@ _fnc_renderNearbyActions = { // Only render them directly if they are base level actions if (count (_x select 1) == 0) then { // Try to render the menu - _action = [_x,[]]; + _action = _x; if ([_target, _action] call FUNC(renderBaseMenu)) then { _numInteractions = _numInteractions + 1; }; From 1e2b47d6e7254ae672b7224ee7c032c5b02bd228 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 29 Mar 2015 12:08:01 -0500 Subject: [PATCH 27/39] Wirecutters - use new createAction system --- .../functions/fnc_interactEH.sqf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf index 6012b1e0e2..6dace9c42d 100644 --- a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -40,12 +40,12 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; if (((getPosASL ace_player) distance _setPosition) > 5) then { _fncStatement = { - _attachedFence = _target getVariable [QGVAR(attachedFence), objNull]; - [ace_player, _attachedFence] call FUNC(cutDownFence); + PARAMS_3(_dummyTarget,_player,_attachedFence); + [_player, _attachedFence] call FUNC(cutDownFence); }; _fncCondition = { - _attachedFence = _target getVariable [QGVAR(attachedFence), objNull]; - ((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items ace_player))}) + PARAMS_3(_dummyTarget,_player,_attachedFence); + ((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items _player))}) }; { @@ -53,10 +53,10 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; if ([_x] call FUNC(isFence)) then { _fencesHelped pushBack _x; _helper = "Sign_Sphere25cm_F" createVehicleLocal (getpos _x); - [_helper, 0, [""], (localize "STR_ACE_logistics_wirecutter_CutFence"), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), [0,0,0], _fncStatement, _fncCondition, 5] call EFUNC(interact_menu,addAction); + _action = [QGVAR(helperCutFence), (localize "STR_ACE_logistics_wirecutter_CutFence"), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), _fncStatement, _fncCondition, {}, _x, [0,0,0], 5] call EFUNC(interact_menu,createAction); + [_helper, 0, [],_action] call EFUNC(interact_menu,addActionToObject); _helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]); _helper hideObject true; - _helper setVariable [QGVAR(attachedFence), _x]; _addedHelpers pushBack _helper; }; }; From 54369b772fbd73e13ed82dab886c6bed756bea84 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 29 Mar 2015 20:46:29 +0200 Subject: [PATCH 28/39] fix: crate instantly drops when trying to pick up with lowered weapon --- addons/dragging/functions/fnc_handleAnimChanged.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/dragging/functions/fnc_handleAnimChanged.sqf b/addons/dragging/functions/fnc_handleAnimChanged.sqf index 91fa3d681b..14b2eff611 100644 --- a/addons/dragging/functions/fnc_handleAnimChanged.sqf +++ b/addons/dragging/functions/fnc_handleAnimChanged.sqf @@ -22,8 +22,8 @@ if (_unit getVariable [QGVAR(isDragging), false]) then { if (_unit getVariable [QGVAR(isCarrying), false]) then { - // drop carried object when not standing - if (stance _unit != "STAND") then { + // drop carried object when not standing; also some exceptions when picking up crate + if (stance _unit != "STAND" && {_anim != "amovpercmstpsnonwnondnon"}) then { private "_carriedObject"; _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; From d9bfb84675d932364380c1ff4b179456b55f918c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Mon, 30 Mar 2015 17:31:50 -0300 Subject: [PATCH 29/39] Revert "1.42 - cursor mode when bipod deployed" --- addons/interact_menu/functions/fnc_keyDown.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index d4a7f8a96e..faa5b0f453 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -32,7 +32,7 @@ GVAR(openedMenuType) = _menuType; GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) || visibleMap || - {(_menuType == 1) && {(isWeaponDeployed ACE_player) || GVAR(AlwaysUseCursorSelfInteraction)}}; + (GVAR(AlwaysUseCursorSelfInteraction) && _menuType == 1); if (GVAR(useCursorMenu)) then { createDialog QGVAR(cursorMenu); // The dialog sets: From 146812b5e6f38889c7307f8f946f1903d24beb8c Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 30 Mar 2015 21:51:11 -0500 Subject: [PATCH 30/39] Dragging - Detect static weapon disassembled Static weapons can still be disassembled at any time during dragging. This just adds a simple distance check and drops if object moves away from player. --- addons/dragging/functions/fnc_carryObjectPFH.sqf | 4 ++-- addons/dragging/functions/fnc_dragObjectPFH.sqf | 4 ++-- addons/dragging/functions/fnc_startCarryPFH.sqf | 4 ++-- addons/dragging/functions/fnc_startDragPFH.sqf | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index 8afa0f541a..f3a9329d35 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -14,8 +14,8 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -// drop if the crate is destroyed -if !([_target] call EFUNC(common,isAlive)) then { +// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) +if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject_carry); [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index 2290c65e9d..8af8e62b90 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -14,8 +14,8 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -// drop if the crate is destroyed -if !([_target] call EFUNC(common,isAlive)) then { +// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) +if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject); [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf index a932d4e189..d98522c5f2 100644 --- a/addons/dragging/functions/fnc_startCarryPFH.sqf +++ b/addons/dragging/functions/fnc_startCarryPFH.sqf @@ -16,8 +16,8 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -// same as dragObjectPFH, checks if object is deleted or dead. -if !([_target] call EFUNC(common,isAlive)) then { +// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) +if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject); [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index 10d9d896a8..d77a23457e 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -16,8 +16,8 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -// same as dragObjectPFH, checks if object is deleted or dead. -if !([_target] call EFUNC(common,isAlive)) then { +// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) +if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject); [_this select 1] call CBA_fnc_removePerFrameHandler; }; From 9a182b98b66f421504a94e97996d8f15378a7752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Tue, 31 Mar 2015 18:05:24 -0300 Subject: [PATCH 31/39] Fix the FCS keybinds --- addons/fcs/initKeybinds.sqf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf index 7d1cc8f09b..3f1a5707a8 100644 --- a/addons/fcs/initKeybinds.sqf +++ b/addons/fcs/initKeybinds.sqf @@ -3,7 +3,7 @@ ["ACE3", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget", { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false}; @@ -20,7 +20,7 @@ GVAR(isDownStateKey1) = false; // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false}; @@ -33,7 +33,7 @@ ["ACE3", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp", { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; @@ -47,7 +47,7 @@ ["ACE3", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown", { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; From 149fd13fceee15a014a9cfb572e1d9e4df9601e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Tue, 31 Mar 2015 18:05:47 -0300 Subject: [PATCH 32/39] Prevent the interact menu from closing dialogs opened by the actions --- addons/interact_menu/functions/fnc_keyUp.sqf | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index 5ab9b61788..58d0b2a71d 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -15,6 +15,10 @@ // Exit if there's no menu opened if (GVAR(openedMenuType) < 0) exitWith {true}; +if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then { + closeDialog 0; +}; + if(GVAR(actionSelected)) then { this = GVAR(selectedTarget); @@ -27,7 +31,9 @@ if(GVAR(actionSelected)) then { // Check the action conditions _actionData = GVAR(selectedAction) select 0; + systemChat "Checking Condition"; if ([_target, _player, _actionData select 6] call (_actionData select 4)) then { + systemChat format ["Condition met: %1", [_target, _player, _actionData select 6, (_actionData select 3)]]; // Call the statement [_target, _player, _actionData select 6] call (_actionData select 3); @@ -40,10 +46,6 @@ GVAR(keyDown) = false; GVAR(keyDownSelfAction) = false; GVAR(openedMenuType) = -1; -if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then { - closeDialog 0; -}; - GVAR(expanded) = false; GVAR(lastPath) = []; GVAR(menuDepthPath) = []; From 4381f164d160ab4606c4ce7a18ac1d12c9036833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Tue, 31 Mar 2015 18:06:04 -0300 Subject: [PATCH 33/39] Fix the self interaction menu of vehicles --- addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 195d741761..5ceb0ddfe0 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -43,7 +43,7 @@ _recurseFnc = { if (_condition == "") then {_condition = "true"}; // Add canInteract (including exceptions) and canInteractWith to condition - _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, objNull, %1)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; + _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, _target, %1)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; _insertChildren = compile (getText (_entryCfg >> "insertChildren")); @@ -90,7 +90,7 @@ _actions = [ // Dummy statement so it's not collapsed when there's no available actions true }, - {[ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)}, + {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)}, {}, [], "Spine3", From 1def2bd2b470eba34a82047d00db5f37f844c26f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Tue, 31 Mar 2015 18:06:28 -0300 Subject: [PATCH 34/39] Fix bugs with interaction with vehicles and passengers --- addons/common/XEH_postInit.sqf | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 237791ff5b..962c91ec0e 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -179,4 +179,11 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player; ["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler); ["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithCondition); -["isNotInside", {_this select 0 == _this select 1 || {vehicle (_this select 0) == _this select 0}}] call FUNC(addCanInteractWithCondition); +["isNotInside", { + // Players can always interact with himself if not boarded + vehicle (_this select 0) == (_this select 0) || + // Players can always interact with his vehicle + {vehicle (_this select 0) == (_this select 1)} || + // Players can always interact with passengers of the same vehicle + {!((_this select 0) isEqualTo (_this select 1)) && {vehicle (_this select 0) == vehicle (_this select 1)}} +}] call FUNC(addCanInteractWithCondition); From e38f48d7adeb0005398b6daa3d8a5c28095b17ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Tue, 31 Mar 2015 18:16:53 -0300 Subject: [PATCH 35/39] Remove debug stuff --- addons/interact_menu/functions/fnc_keyUp.sqf | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index 58d0b2a71d..735130e69a 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -31,9 +31,7 @@ if(GVAR(actionSelected)) then { // Check the action conditions _actionData = GVAR(selectedAction) select 0; - systemChat "Checking Condition"; if ([_target, _player, _actionData select 6] call (_actionData select 4)) then { - systemChat format ["Condition met: %1", [_target, _player, _actionData select 6, (_actionData select 3)]]; // Call the statement [_target, _player, _actionData select 6] call (_actionData select 3); From 0daa029622ed8239426bc4561b06c22299eaaecb Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 31 Mar 2015 23:56:41 -0500 Subject: [PATCH 36/39] Show Vehicle Name/Icon for interaction --- .../functions/fnc_compileMenuSelfAction.sqf | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 5ceb0ddfe0..ccdce4dd5c 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -79,13 +79,24 @@ _recurseFnc = { private "_actionsCfg"; _actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions"; +private ["_baseDisplayName", "_baseIcon"]; +_baseDisplayName = ""; +_baseIcon = ""; +if (_objectType isKindOf "CAManBase") then { + _baseDisplayName = "Self Actions"; + _baseIcon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; +} else { + _baseDisplayName = getText (configFile >> "CfgVehicles" >> _objectType >> "displayName"); + _baseIcon = getText (configFile >> "CfgVehicles" >> _objectType >> "Icon"); +}; + // Create a master action to base on self action _actions = [ [ [ "ACE_SelfActions", - "Self Actions", - "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa", + _baseDisplayName, + _baseIcon, { // Dummy statement so it's not collapsed when there's no available actions true From b66bb4ffd663a92a70d2ab2b23bbebf611116f41 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 1 Apr 2015 19:36:11 +0200 Subject: [PATCH 37/39] add functions to get cfg type of items and objects --- addons/common/XEH_preInit.sqf | 2 ++ addons/common/functions/fnc_getConfigType.sqf | 24 +++++++++++++++++++ .../functions/fnc_getConfigTypeObject.sqf | 22 +++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 addons/common/functions/fnc_getConfigType.sqf create mode 100644 addons/common/functions/fnc_getConfigTypeObject.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 2a20c69bcb..abdccd619a 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -57,6 +57,8 @@ PREP(getAllGear); PREP(getCaptivityStatus); PREP(getConfigCommander); PREP(getConfigGunner); +PREP(getConfigType); +PREP(getConfigTypeObject); PREP(getDeathAnim); PREP(getDefaultAnim); PREP(getDefinedVariable); diff --git a/addons/common/functions/fnc_getConfigType.sqf b/addons/common/functions/fnc_getConfigType.sqf new file mode 100644 index 0000000000..f3c21923ef --- /dev/null +++ b/addons/common/functions/fnc_getConfigType.sqf @@ -0,0 +1,24 @@ +/* + * Author: commy2 + * + * What kind of Cfg is the item. Works for CfgMagaines, CfgWeapons and CfgGlasses + * + * Argument: + * 0: A item's classname. (String) + * + * Return value: + * CfgWhatever (String) + */ +#include "script_component.hpp" + +private "_item"; + +_item = _this select 0; + +if (isClass (configFile >> "CfgWeapons" >> _item)) exitWith {"CfgWeapons"}; + +if (isClass (configFile >> "CfgMagazines" >> _item)) exitWith {"CfgMagazines"}; + +if (isClass (configFile >> "CfgGlasses" >> _item)) exitWith {"CfgGlasses"}; + +"" diff --git a/addons/common/functions/fnc_getConfigTypeObject.sqf b/addons/common/functions/fnc_getConfigTypeObject.sqf new file mode 100644 index 0000000000..35799da6b5 --- /dev/null +++ b/addons/common/functions/fnc_getConfigTypeObject.sqf @@ -0,0 +1,22 @@ +/* + * Author: commy2 + * + * What kind of Cfg is the object. Works for CfgVehicles and CfgAmmo + * + * Argument: + * 0: An object's classname. (String) + * + * Return value: + * CfgWhatever (String) + */ +#include "script_component.hpp" + +private "_object"; + +_object = _this select 0; + +if (isClass (configFile >> "CfgVehicles" >> _object)) exitWith {"CfgVehicles"}; + +if (isClass (configFile >> "CfgAmmo" >> _object)) exitWith {"CfgAmmo"}; + +"" From a14cc0853e02d61d595a4e981f4b0123174a98d7 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 1 Apr 2015 21:52:56 +0200 Subject: [PATCH 38/39] function to return item type --- addons/common/XEH_preInit.sqf | 2 + addons/common/functions/fnc_getItemType.sqf | 29 ++++++++ .../functions/fnc_getItemTypeWeapon.sqf | 74 +++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 addons/common/functions/fnc_getItemType.sqf create mode 100644 addons/common/functions/fnc_getItemTypeWeapon.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index abdccd619a..6dacdf316b 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -72,6 +72,8 @@ PREP(getGunner); PREP(getHitPoints); PREP(getHitPointsWithSelections); PREP(getInPosition); +PREP(getItemType); +PREP(getItemTypeWeapon); PREP(getMarkerType); PREP(getName); PREP(getNumberFromMissionSQM); diff --git a/addons/common/functions/fnc_getItemType.sqf b/addons/common/functions/fnc_getItemType.sqf new file mode 100644 index 0000000000..a6d4a76dd1 --- /dev/null +++ b/addons/common/functions/fnc_getItemType.sqf @@ -0,0 +1,29 @@ +/* + * Author: commy2 + * + * What kind of item is given classname + * + * Argument: + * 0: Classname of a item. (String) + * + * Return value: + * Item type. (Array) + * 0: "weapon", "item", "magazine", "unknown" or "" (String) + * 1: A description of the item (e.g. "primary" for a weapon or "vest" for a vest item) + * + */ +#include "script_component.hpp" + +private "_item"; + +_item = _this select 0; + +_cfgType = [_item] call FUNC(getConfigType); + +if (_cfgType == "CfgGlasses") exitWith {["item","glasses"]}; + +if (_cfgType == "CfgMagazines") exitWith { ["magazine", [_item] call FUNC(getItemTypeWeapon) select 1] }; + +if (_cfgType == "CfgWeapons") exitWith { [_item] call FUNC(getItemTypeWeapon) }; + +["",""] diff --git a/addons/common/functions/fnc_getItemTypeWeapon.sqf b/addons/common/functions/fnc_getItemTypeWeapon.sqf new file mode 100644 index 0000000000..a23773a8f5 --- /dev/null +++ b/addons/common/functions/fnc_getItemTypeWeapon.sqf @@ -0,0 +1,74 @@ +/* + * Author: commy2 + * + * What kind of item is given classname. Has to be a CfgWeapons. Undefined behavior for CfgMagazine. + * + * Argument: + * 0: Classname of a CfgWeapon. (String) + * + * Return value: + * See ace_common_fnc_getItemType + * + */ +#include "script_component.hpp" + +private "_item"; + +_item = _this select 0; + +private "_config"; +_config = configFile >> [_item] call FUNC(getConfigType) >> _item; + +if (!isClass _config) exitWith {["",""]}; + +private "_type"; +_type = getNumber (_config >> "type"); + +if (isNumber (_config >> "ItemInfo" >> "type")) then { + _type = getNumber (_config >> "ItemInfo" >> "type"); +}; + +switch (true) do { + case (_type == 0): {["unknown","unknown"]}; + case (_type == 2^0): {["weapon","primary"]}; + case (_type == 2^1): {["weapon","handgun"]}; + case (_type == 2^2): {["weapon","secondary"]}; + case (_type < 2^4): {["weapon","unknown"]}; + case (_type == 2^4): {["magazine","handgun"]}; // handgun + case (_type == 2^8): {["magazine","primary"]}; // rifle + case (_type == 2^9): {["magazine","secondary"]}; // rpg, mg, mines + case (_type == 768): {["magazine","secondary"]}; // NLAW + case (_type == 1536): {["magazine","secondary"]}; // titan + + case (_type == 101): {["item","muzzle"]}; + case (_type == 201): {["item","optics"]}; + case (_type == 301): {["item","flashlight"]}; + case (_type == 302): {["item","under"]}; // czech for bipod item + case (_type == 401): {["item","first_aid_kit"]}; + case (_type == 501): {["item","fins"]}; // not implemented + case (_type == 601): {["item","breathing_bomb"]}; // not implemented + case (_type == 603): {["item","goggles"]}; + case (_type == 604): {["item","scuba"]}; // not implemented + case (_type == 605): {["item","headgear"]}; + case (_type == 611): {["item","radio"]}; + case (_type == 616): {["item","hmd"]}; + case (_type == 617): {["item","binocular"]}; + case (_type == 619): {["item","medikit"]}; + case (_type == 620): {["item","toolkit"]}; + case (_type == 621): {["item","uav_terminal"]}; + case (_type == 701): {["item","vest"]}; + case (_type == 801): {["item","uniform"]}; + + case (_type == 2^12): { + switch (toLower getNumber (_config >> "simulation")) do { + case ("binocular"): {["weapon","binocular"]}; + case ("nvgoggles"): {["item","nvgoggles"]}; + case ("itemminedetector"): {["item","minedetector"]}; + default {["weapon","unknown"]}; + }; + }; + + case (_type == 2^16): {["weapon","vehicle"]}; + case (_type == 2^17): {["item","unknown"]}; // ??? + default {["item","unknown"]}; +}; From 411fb6bc62e9183e1f5d19146fa448a94c84340d Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 1 Apr 2015 22:13:37 +0200 Subject: [PATCH 39/39] getText vs. getNumber --- addons/common/functions/fnc_getItemTypeWeapon.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/functions/fnc_getItemTypeWeapon.sqf b/addons/common/functions/fnc_getItemTypeWeapon.sqf index a23773a8f5..36b0f6d6d8 100644 --- a/addons/common/functions/fnc_getItemTypeWeapon.sqf +++ b/addons/common/functions/fnc_getItemTypeWeapon.sqf @@ -60,7 +60,7 @@ switch (true) do { case (_type == 801): {["item","uniform"]}; case (_type == 2^12): { - switch (toLower getNumber (_config >> "simulation")) do { + switch (toLower getText (_config >> "simulation")) do { case ("binocular"): {["weapon","binocular"]}; case ("nvgoggles"): {["item","nvgoggles"]}; case ("itemminedetector"): {["item","minedetector"]};