From bdc60c074a07eac84b4b6f8f895cde7de1b18157 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 24 Mar 2015 16:01:53 +0100 Subject: [PATCH 01/14] cleaning up in common --- addons/common/CfgEventHandlers.hpp | 16 ----- addons/common/XEH_postInit.sqf | 2 - addons/common/XEH_preInit.sqf | 7 -- addons/common/functions/fnc_beingCarried.sqf | 12 ---- addons/common/functions/fnc_carriedByObj.sqf | 13 ---- addons/common/functions/fnc_carryObj.sqf | 72 ------------------- addons/common/functions/fnc_getCarriedBy.sqf | 13 ---- addons/common/functions/fnc_getCarriedObj.sqf | 13 ---- .../functions/fnc_limitMovementSpeed.sqf | 53 -------------- addons/common/functions/fnc_loadPerson.sqf | 2 - addons/common/functions/fnc_setCarriedBy.sqf | 21 ------ 11 files changed, 224 deletions(-) delete mode 100644 addons/common/functions/fnc_beingCarried.sqf delete mode 100644 addons/common/functions/fnc_carriedByObj.sqf delete mode 100644 addons/common/functions/fnc_carryObj.sqf delete mode 100644 addons/common/functions/fnc_getCarriedBy.sqf delete mode 100644 addons/common/functions/fnc_getCarriedObj.sqf delete mode 100644 addons/common/functions/fnc_limitMovementSpeed.sqf delete mode 100644 addons/common/functions/fnc_setCarriedBy.sqf diff --git a/addons/common/CfgEventHandlers.hpp b/addons/common/CfgEventHandlers.hpp index 522df03d4f..eef90451ae 100644 --- a/addons/common/CfgEventHandlers.hpp +++ b/addons/common/CfgEventHandlers.hpp @@ -42,19 +42,3 @@ class Extended_Respawn_EventHandlers { }; }; }; - -class Extended_Killed_EventHandlers { - class CAManBase { - class GVAR(dropObject) { - Killed = QUOTE(if (local (_this select 0)) then {[ARR_2(_this select 0, ObjNull)] call FUNC(carryObj)};); - }; - }; -}; - -class Extended_GetIn_EventHandlers { - class CAManBase { - class GVAR(dropObject) { - GetIn = QUOTE(if (local (_this select 0)) then {[ARR_2(_this select 0, ObjNull)] call FUNC(carryObj)};); - }; - }; -}; diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 1d951c3ceb..c3f077178d 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -171,8 +171,6 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player; }, 0, []] call cba_fnc_addPerFrameHandler; [QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable); -[QGVAR(carriedBy),objNull,false,QUOTE(ADDON)] call FUNC(defineVariable); -[QGVAR(carriedObj),objNull,false,QUOTE(ADDON)] call FUNC(defineVariable); ["VehicleSetFuel", { PARAMS_2(_vehicle,_fuelLevel); diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 3c2797540f..c23c6b1dd2 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -15,7 +15,6 @@ PREP(adminKick); PREP(ambientBrightness); PREP(applyForceWalkStatus); PREP(ASLToPosition); -PREP(beingCarried); PREP(binarizeNumber); PREP(blurScreen); PREP(cachedCall); @@ -23,8 +22,6 @@ PREP(canGetInPosition); PREP(canInteract); PREP(canInteractWith); PREP(canUseWeapon); -PREP(carriedByObj); -PREP(carryObj); PREP(changeProjectileDirection); PREP(checkPBOs); PREP(claim); @@ -58,8 +55,6 @@ PREP(fixPosition); PREP(getAllDefinedSetVariables); PREP(getAllGear); PREP(getCaptivityStatus); -PREP(getCarriedBy); -PREP(getCarriedObj); PREP(getConfigCommander); PREP(getConfigGunner); PREP(getDeathAnim); @@ -122,7 +117,6 @@ PREP(isModLoaded); PREP(isPlayer); PREP(isTurnedOut); PREP(letterToCode); -PREP(limitMovementSpeed); PREP(loadPerson); PREP(loadPersonLocal); PREP(loadSettingsFromProfile); @@ -160,7 +154,6 @@ PREP(serverLog); PREP(setArrestState); PREP(setCanInteract); PREP(setCaptivityStatus); -PREP(setCarriedBy); PREP(setDefinedVariable); PREP(setDisableUserInputStatus); PREP(setForceWalkStatus); diff --git a/addons/common/functions/fnc_beingCarried.sqf b/addons/common/functions/fnc_beingCarried.sqf deleted file mode 100644 index ed0c7832bb..0000000000 --- a/addons/common/functions/fnc_beingCarried.sqf +++ /dev/null @@ -1,12 +0,0 @@ -/** - * fn_beingCarried.sqf - * @Descr: Check if object is being carried - * @Author: Glowbal - * - * @Arguments: [object OBJECT] - * @Return: BOOL True if object is being carried - * @PublicAPI: true - */ -#include "script_component.hpp" - -!(isNull ([_this select 0] call FUNC(getCarriedObj))); \ No newline at end of file diff --git a/addons/common/functions/fnc_carriedByObj.sqf b/addons/common/functions/fnc_carriedByObj.sqf deleted file mode 100644 index 139a449c77..0000000000 --- a/addons/common/functions/fnc_carriedByObj.sqf +++ /dev/null @@ -1,13 +0,0 @@ -/** - * fn_carriedByObj.sqf - * @Descr: Check if object A is being carried by object B. - * @Author: Glowbal - * - * @Arguments: [object OBJECT, unit OBJECT] - * @Return: BOOL True if B is carrying A. - * @PublicAPI: true - */ - -#include "script_component.hpp" - -([(_this select 0)] call FUNC(getCarriedBy) == [(_this select 1)] call FUNC(getCarriedBy)); \ No newline at end of file diff --git a/addons/common/functions/fnc_carryObj.sqf b/addons/common/functions/fnc_carryObj.sqf deleted file mode 100644 index 6d911029a2..0000000000 --- a/addons/common/functions/fnc_carryObj.sqf +++ /dev/null @@ -1,72 +0,0 @@ -/** - * fn_carryObj.sqf - * @Descr: Have a unit carry an object. Use ObjNull for second parameter if you want the unit to carry nothing - * @Author: Glowbal - * - * @Arguments: [unit OBJECT, objectToCarry OBJECT, attachToVector ARRAY (Optional)] - * @Return: BOOL Returns true if succesful - * @PublicAPI: true - */ - -#include "script_component.hpp" - -private ["_unit","_to","_return", "_fallDown", "_carriedObj", "_positionUnit"]; -_unit = [_this, 0,ObjNull, [ObjNull]] call bis_fnc_param; -_to = [_this, 1,ObjNull, [ObjNull]] call bis_fnc_param; -_fallDown = false; -if (count _this > 3) then { - _fallDown = _this select 3; -}; -_return = false; - -[format["fnc_carryObj - UNIT: %1 ATTEMPTS TO CARRY %2",_unit,_to],2] call FUNC(debug); - -if (((typeName _to) == "OBJECT" && (isNull ([_unit] call FUNC(getCarriedObj)))) || isNull _to) then { - if (vehicle _unit != _unit) exitwith {}; - if (!isNull _to) then { - if ((isNull ([_to] call FUNC(getCarriedObj))) && ([_unit] call FUNC(canInteract))) then { - _return = true; - _unit setvariable [QGVAR(carriedObj),_to,true]; - if (_fallDown) then { - // [_unit,_fallDown] call FUNC(limitMovementSpeed); - }; - [_to, _unit] call FUNC(setCarriedBy); - if (count _this > 2) then { - if (count (_this select 2) == 3) then { - _to attachTo [_unit,(_this select 2)]; - [format["fnc_carryObj - UNIT: %1 TO %2 - attachTo offset: %3",_unit,_to,(_this select 2)],2] call FUNC(debug); - }; - }; - ["carryObject", [_unit], [_unit, _to, _fallDown]] call EFUNC(common,targetEvent); - // ["carryObject", [_unit, _to, _fallDown]] call ace_common_fnc_localEvent; - }; - } else { - if (!isNull ([_unit] call FUNC(getCarriedObj))) then { - [format["fnc_carryObj - UNIT: %1 DROPING CARRIED OBJECT",_unit],2] call FUNC(debug); - _carriedObj = ([_unit] call FUNC(getCarriedObj)); - - detach _carriedObj; - //_carriedObj setPosATL [(getPosATL _carriedObj) select 0, (getPosATL _carriedObj) select 1,0]; - if (!surfaceIsWater getPos _unit) then { - _positionUnit = getPosATL _carriedObj; - _positionUnit set [2, ((getPosATL _unit) select 2) + 0.1]; - _carriedObj setPosATL _positionUnit; - } else { - _positionUnit = getPosASL _carriedObj; - _positionUnit set [2, ((getPosASL _unit) select 2) + 0.1]; - _carriedObj setPosASL _positionUnit; - }; - - [[_unit] call FUNC(getCarriedObj), objNull] call FUNC(setCarriedBy); - _unit setvariable [QGVAR(carriedObj),_to,true]; - _return = true; - - ["carryObjectDropped", [_unit], [_unit, _to, _fallDown]] call EFUNC(common,targetEvent); - // ["carryObjectDropped", [_unit, _to, _fallDown]] call ace_common_fnc_localEvent; - - }; - }; -} else { - [format["fnc_carryObj - UNIT: %1 FAILED TO CARRY %2 - not an object or already carrying",_unit,_to],2] call FUNC(debug); -}; -_return diff --git a/addons/common/functions/fnc_getCarriedBy.sqf b/addons/common/functions/fnc_getCarriedBy.sqf deleted file mode 100644 index 2b3c374eb3..0000000000 --- a/addons/common/functions/fnc_getCarriedBy.sqf +++ /dev/null @@ -1,13 +0,0 @@ -/** - * fn_getCarriedBy.sqf - * @Descr: Get the object that is carrying given unit or object - * @Author: Glowbal - * - * @Arguments: [unit OBJECT] - * @Return: OBJECT Returns the object that is carrying the unit. Otherwise returns ObjNull - * @PublicAPI: true - */ - -#include "script_component.hpp" - -((_this select 0) getvariable [QGVAR(carriedBy),objNull]); \ No newline at end of file diff --git a/addons/common/functions/fnc_getCarriedObj.sqf b/addons/common/functions/fnc_getCarriedObj.sqf deleted file mode 100644 index 8cb1209791..0000000000 --- a/addons/common/functions/fnc_getCarriedObj.sqf +++ /dev/null @@ -1,13 +0,0 @@ -/** - * fn_getCarriedObj.sqf - * @Descr: Grab the registered carried object - * @Author: Glowbal - * - * @Arguments: [unit OBJECT] - * @Return: OBJECT Returns the object that the unit is currently carrying. If not carrying, returns ObjNull - * @PublicAPI: true - */ - -#include "script_component.hpp" - -((_this select 0) getvariable [QGVAR(carriedObj),objNull]); diff --git a/addons/common/functions/fnc_limitMovementSpeed.sqf b/addons/common/functions/fnc_limitMovementSpeed.sqf deleted file mode 100644 index ad3d08c66c..0000000000 --- a/addons/common/functions/fnc_limitMovementSpeed.sqf +++ /dev/null @@ -1,53 +0,0 @@ -/** - * fn_limitMovementSpeed.sqf - * @Descr: Limits the movement speed of a unit - * @Author: Glowbal - * - * @Arguments: [unit OBJECT, fallDown BOOL (Optional)] - * @Return: void - * @PublicAPI: true - */ - -#include "script_component.hpp" - -private ["_unit","_carriedObj"]; -_unit = _this select 0; -_fallDown = false; -if (count _this > 1) then { - _fallDown = _this select 1; -}; - -if ((_unit getvariable [QGVAR(limitMovementSpeed),false])) exitwith { - _unit setvariable [QGVAR(limitMovementSpeed),nil,true]; -}; - -[{ - private["_unit","_fallDown","_carriedObj"]; - _unit = (_this select 0) select 0; - _fallDown = (_this select 0) select 1; - - _carriedObj = [_unit] call FUNC(getCarriedObj); - - if !(_unit getvariable [QGVAR(limitMovementSpeed),false]) exitwith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; - if !((!isNull _carriedObj) && (alive _unit)) exitwith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; - - if (speed _unit > 12 && vehicle _unit == _unit && isTouchingGround _unit) then { - - _unit setVelocity [0,0,0]; - - if (_fallDown) then { - _unit playMove "amovppnemstpsraswrfldnon"; - }; - - if (_carriedObj isKindOf "Man") then { - hint "You can not move this fast while transporting this person."; - } else { - hint "You can not move this fast while carrying this object"; - }; - [_unit,ObjNull] call FUNC(carryObj); - }; -}, 0.5, [_unit,_fallDown] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/common/functions/fnc_loadPerson.sqf b/addons/common/functions/fnc_loadPerson.sqf index 0d2995db1b..53bf51d599 100644 --- a/addons/common/functions/fnc_loadPerson.sqf +++ b/addons/common/functions/fnc_loadPerson.sqf @@ -35,8 +35,6 @@ if (_unit distance _loadcar <= 10) then { }; if (!isNull _vehicle) then { [_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide); - [_caller,objNull] call FUNC(carryObj); - [_unit,objNull] call FUNC(carryObj); [[_unit, _vehicle,_caller], QUOTE(FUNC(loadPersonLocal)), _unit, false] call EFUNC(common,execRemoteFnc); }; _vehicle \ No newline at end of file diff --git a/addons/common/functions/fnc_setCarriedBy.sqf b/addons/common/functions/fnc_setCarriedBy.sqf deleted file mode 100644 index 2ea5f3f469..0000000000 --- a/addons/common/functions/fnc_setCarriedBy.sqf +++ /dev/null @@ -1,21 +0,0 @@ -/** - * fn_setCarriedBy.sqf - * @Descr: Registers an object being carried by another object - * @Author: Glowbal - * - * @Arguments: [unitToBeCarried OBJECT, objectCarrying OBJECT] - * @Return: BOOL True if succesfully registered - * @PublicAPI: false - */ - -#include "script_component.hpp" - -private ["_unit","_to","_return"]; -_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; -_to = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param; -_return = false; -if ((isNull ([_unit] call FUNC(getCarriedBy))) || isNull _to) then { - _return = true; - _unit setvariable [QGVAR(carriedBy),_to,true]; -}; -_return \ No newline at end of file From 43846970fafccebd48aee53701fa0ce368a7a21e Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 24 Mar 2015 16:12:46 +0100 Subject: [PATCH 02/14] init drag/carry options on persons --- addons/dragging/CfgEventHandlers.hpp | 5 +++++ addons/dragging/XEH_preInit.sqf | 1 + addons/dragging/functions/fnc_initPerson.sqf | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 addons/dragging/functions/fnc_initPerson.sqf diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp index 6a6aa440f7..f568eace4e 100644 --- a/addons/dragging/CfgEventHandlers.hpp +++ b/addons/dragging/CfgEventHandlers.hpp @@ -13,6 +13,11 @@ class Extended_PostInit_EventHandlers { }; class Extended_Init_EventHandlers { + class CAManBase { + class ADDON { + init = QUOTE(_this call DFUNC(initPerson)); + }; + }; class StaticWeapon { class ADDON { init = QUOTE(_this call DFUNC(initObject)); diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf index 7a0be053ad..8e4749e5fe 100644 --- a/addons/dragging/XEH_preInit.sqf +++ b/addons/dragging/XEH_preInit.sqf @@ -19,6 +19,7 @@ PREP(handlePlayerChanged); PREP(handlePlayerWeaponChanged); PREP(handleScrollWheel); PREP(initObject); +PREP(initPerson); PREP(isObjectOnObject); PREP(setCarryable); PREP(setDraggable); diff --git a/addons/dragging/functions/fnc_initPerson.sqf b/addons/dragging/functions/fnc_initPerson.sqf new file mode 100644 index 0000000000..1191506ba2 --- /dev/null +++ b/addons/dragging/functions/fnc_initPerson.sqf @@ -0,0 +1,19 @@ +/* + * Author: commy2 + * + * Initialize variables for drag or carryable persons. Called from init EH. + * + * Argument: + * 0: Any Unit (Object) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private "_unit"; + +_unit = _this select 0; + +[_unit, true/*, _position, _direction*/] call FUNC(setDraggable); +[_unit, true/*, _position, _direction*/] call FUNC(setCarryable); From 749352f0a8c535096ac18418ed723c481df87dd9 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 24 Mar 2015 19:07:39 +0100 Subject: [PATCH 03/14] animations, onUnconscious events --- addons/common/XEH_postInit.sqf | 2 ++ addons/dragging/XEH_clientInit.sqf | 5 ++++ addons/dragging/XEH_preInit.sqf | 1 + addons/dragging/functions/fnc_canCarry.sqf | 2 +- addons/dragging/functions/fnc_canDrag.sqf | 2 +- addons/dragging/functions/fnc_dragObject.sqf | 4 +++ addons/dragging/functions/fnc_dropObject.sqf | 8 ++++++ .../functions/fnc_handleUnconscious.sqf | 25 +++++++++++++++++++ addons/dragging/functions/fnc_initPerson.sqf | 4 +-- addons/dragging/functions/fnc_startDrag.sqf | 7 ++++++ 10 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 addons/dragging/functions/fnc_handleUnconscious.sqf diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index c3f077178d..53042bb01d 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -33,6 +33,8 @@ if (hasInterface) then { _this lock (_this getVariable [QGVAR(lockStatus), locked _this]); }] call FUNC(addEventhandler); +["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler); + // hack to get PFH to work in briefing [QGVAR(onBriefingPFH), "onEachFrame", { if (time > 0) exitWith { diff --git a/addons/dragging/XEH_clientInit.sqf b/addons/dragging/XEH_clientInit.sqf index da9c6eefd6..b87e4890d1 100644 --- a/addons/dragging/XEH_clientInit.sqf +++ b/addons/dragging/XEH_clientInit.sqf @@ -17,3 +17,8 @@ if (isNil "ACE_maxWeightCarry") then { // release object on player change. This does work when returning to lobby, but not when hard disconnecting. ["playerChanged", {_this call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); ["playerWeaponChanged", {_this call DFUNC(handlePlayerWeaponChanged)}] call EFUNC(common,addEventhandler); + +// handle waking up dragged unit and falling unconscious while dragging +["medical_onUnconscious", {_this call DFUNC(handleUnconscious)}] call EFUNC(common,addEventhandler); + +//@todo Captivity? diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf index 8e4749e5fe..dba69eb22a 100644 --- a/addons/dragging/XEH_preInit.sqf +++ b/addons/dragging/XEH_preInit.sqf @@ -18,6 +18,7 @@ PREP(handleKilled); PREP(handlePlayerChanged); PREP(handlePlayerWeaponChanged); PREP(handleScrollWheel); +PREP(handleUnconscious); PREP(initObject); PREP(initPerson); PREP(isObjectOnObject); diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf index 13402b53b5..dbbacae915 100644 --- a/addons/dragging/functions/fnc_canCarry.sqf +++ b/addons/dragging/functions/fnc_canCarry.sqf @@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; // a static weapon has to be empty for dragging if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; -alive _target && {_target getVariable [QGVAR(canCarry), false]} +alive _target && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"]} diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index 9771496aa2..be3cda7e6c 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; // a static weapon has to be empty for dragging if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; -alive _target && {_target getVariable [QGVAR(canDrag), false]} +alive _target && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"]} diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index 2f04e0e599..bd27524fc6 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -33,6 +33,10 @@ _position = _position vectorAdd [0, 0, _offset]; _target attachTo [_unit, _position]; _target setDir _direction; +if (_target isKindOf "CAManBase") then { + [_target, "AinjPpneMrunSnonWnonDb_still", 0, true] call EFUNC(common,doAnimation); +}; + _unit setVariable [QGVAR(isDragging), true, true]; _unit setVariable [QGVAR(draggedObject), _target, true]; diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 00aa7a6bca..9ebbfae61f 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -33,6 +33,14 @@ _unit playAction "released"; // release object detach _target; +if (_target isKindOf "CAManBase") then { + if (_target getVariable ["ACE_isUnconscious", false]) then { + [_target, "unconscious", 2, true] call EFUNC(common,doAnimation); + } else { + [_target, "", 2, true] call EFUNC(common,doAnimation); //@todo "AinjPpneMrunSnonWnonDb_release" seems to fall back to unconsciousness anim. retest after config fix + }; +}; + _unit removeWeapon "ACE_FakePrimaryWeapon"; // prevent object from flipping inside buildings diff --git a/addons/dragging/functions/fnc_handleUnconscious.sqf b/addons/dragging/functions/fnc_handleUnconscious.sqf new file mode 100644 index 0000000000..ac774f9c68 --- /dev/null +++ b/addons/dragging/functions/fnc_handleUnconscious.sqf @@ -0,0 +1,25 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_isUnconscious"]; + +_unit = _this select 0; +_isUnconscious = _this select 1; + +private "_player"; +_player = ACE_player; + +if !(_player getVariable [QGVAR(isDragging), false]) exitWith {}; + +private "_draggedObject"; +_draggedObject = _player getVariable [QGVAR(draggedObject), objNull]; + +// handle falling unconscious +if (_unit == _player) then { + [_unit, _draggedObject] call FUNC(dropObject); +}; + +// handle waking up dragged unit +if (_unit == _draggedObject) then { + [_player, _draggedObject] call FUNC(dropObject); +}; diff --git a/addons/dragging/functions/fnc_initPerson.sqf b/addons/dragging/functions/fnc_initPerson.sqf index 1191506ba2..0dc2af1389 100644 --- a/addons/dragging/functions/fnc_initPerson.sqf +++ b/addons/dragging/functions/fnc_initPerson.sqf @@ -15,5 +15,5 @@ private "_unit"; _unit = _this select 0; -[_unit, true/*, _position, _direction*/] call FUNC(setDraggable); -[_unit, true/*, _position, _direction*/] call FUNC(setCarryable); +[_unit, true, [0,1.1,0.092], 180] call FUNC(setDraggable); +[_unit, true, [0.4,-0.1,-1.25], 195] call FUNC(setCarryable); // hard-coded selection: "LeftShoulder" diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index 07ed7e5a90..d98a9f8eaa 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -40,6 +40,13 @@ _unit selectWeapon primaryWeapon _unit; // can't play action that depends on weapon if it was added the same frame [{_this playActionNow "grabDrag";}, _unit] call EFUNC(common,execNextFrame); +// move a bit closer and adjust direction when trying to pick up a person +if (_target isKindOf "CAManBase") then { + [_target, "AinjPpneMrunSnonWnonDb_grab", 2, true] call EFUNC(common,doAnimation); + _target setDir (getDir _unit + 180); + _target setPos (getPos _unit vectorAdd (vectorDir _unit vectorMultiply 1.5)); +}; + // prevents draging and carrying at the same time _unit setVariable [QGVAR(isDragging), true, true]; From 34df28d93892a86b56753e220ea87e7562d928a6 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 24 Mar 2015 20:28:44 +0100 Subject: [PATCH 04/14] cleaning up common --- .../common/{FixPickup.hpp => CfgActions.hpp} | 1 + addons/common/CfgMoves.hpp | 76 +++++++++++++++++++ addons/common/{NoVoice.hpp => CfgVoice.hpp} | 1 + addons/common/FixAnimations.hpp | 35 --------- addons/common/config.cpp | 8 +- 5 files changed, 83 insertions(+), 38 deletions(-) rename addons/common/{FixPickup.hpp => CfgActions.hpp} (61%) create mode 100644 addons/common/CfgMoves.hpp rename addons/common/{NoVoice.hpp => CfgVoice.hpp} (99%) delete mode 100644 addons/common/FixAnimations.hpp diff --git a/addons/common/FixPickup.hpp b/addons/common/CfgActions.hpp similarity index 61% rename from addons/common/FixPickup.hpp rename to addons/common/CfgActions.hpp index 79ddf77026..8e556b38e3 100644 --- a/addons/common/FixPickup.hpp +++ b/addons/common/CfgActions.hpp @@ -1,5 +1,6 @@ class CfgActions { + // fixes pick up action on mine detectors, because all ACE items are of that simulationClass and BI doesn't seem to care class None; class TakeWeapon: None { show = 0; diff --git a/addons/common/CfgMoves.hpp b/addons/common/CfgMoves.hpp new file mode 100644 index 0000000000..b0df9a4466 --- /dev/null +++ b/addons/common/CfgMoves.hpp @@ -0,0 +1,76 @@ + +class CfgMovesBasic { + class Default; + class Actions { + // fixes grab animation with equipped pistol + class NoActions; + class PistolStandActions: NoActions { + grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2"; + }; + class LauncherKneelActions: NoActions { + grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2"; + }; + class CivilStandActions: NoActions { + grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2"; + }; + }; +}; + +class CfgMovesMaleSdr: CfgMovesBasic { + class AgonyBase; + class AgonyBaseRfl; + class StandBase; + class HealBase; + + class States { + // fixes being able to reload in some animations, can't remember now what exactly + class AinjPfalMstpSnonWnonDnon_carried_Down: AgonyBase { + canReload = 0; + }; + class AinjPfalMstpSnonWnonDnon_carried_Up: AgonyBase { + canReload = 0; + }; + class AinjPfalMstpSnonWrflDnon_carried_Down: AgonyBase { + canReload = 0; + }; + class AinjPfalMstpSnonWrflDnon_carried_Up: AgonyBaseRfl { + canReload = 0; + }; + + class AmovPpneMstpSnonWnonDnon_injured; + class AinjPpneMstpSnonWnonDnon: AmovPpneMstpSnonWnonDnon_injured { + canReload = 0; + }; + class AmovPpneMstpSrasWrflDnon_injured; + class AinjPpneMstpSnonWrflDnon: AmovPpneMstpSrasWrflDnon_injured { + canReload = 0; + }; + + // mark as on ladder animation + class LadderCivilStatic: StandBase { + ACE_isLadder = 1; + }; + + // dunno, important + class AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_1; + class AcinPknlMstpSnonWnonDnon: AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_1 { + enableDirectControl = 1; + }; + class AcinPknlMwlkSnonWnonDb: AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_1 { + enableDirectControl = 1; + }; + + // fix falling back to unconsciousness animation and disable rotating in that state + class Unconscious: Default { + ConnectTo[] = {}; + head = "headNo"; + forceAim = 1; + static = 1; + }; + + // idk. Flummi? + class AinvPknlMstpSnonWnonDnon_medic0: HealBase { + variantsPlayer[] = {}; + }; + }; +}; diff --git a/addons/common/NoVoice.hpp b/addons/common/CfgVoice.hpp similarity index 99% rename from addons/common/NoVoice.hpp rename to addons/common/CfgVoice.hpp index a34e30c08e..9c53338e6e 100644 --- a/addons/common/NoVoice.hpp +++ b/addons/common/CfgVoice.hpp @@ -218,6 +218,7 @@ class CfgVoice { displayName = "$STR_ACE_Common_NoVoice"; }; }; + class CfgVoiceTypes { class ACE_NoVoice { name = "$STR_ACE_Common_NoVoice"; diff --git a/addons/common/FixAnimations.hpp b/addons/common/FixAnimations.hpp deleted file mode 100644 index d389391ba1..0000000000 --- a/addons/common/FixAnimations.hpp +++ /dev/null @@ -1,35 +0,0 @@ - -class CfgMovesBasic; -class CfgMovesMaleSdr: CfgMovesBasic { - class AgonyBase; - class AgonyBaseRfl; - class StandBase; - - class States { - class AinjPfalMstpSnonWnonDnon_carried_Down: AgonyBase { - canReload = 0; - }; - class AinjPfalMstpSnonWnonDnon_carried_Up: AgonyBase { - canReload = 0; - }; - class AinjPfalMstpSnonWrflDnon_carried_Down: AgonyBase { - canReload = 0; - }; - class AinjPfalMstpSnonWrflDnon_carried_Up: AgonyBaseRfl { - canReload = 0; - }; - - class AmovPpneMstpSnonWnonDnon_injured; - class AinjPpneMstpSnonWnonDnon: AmovPpneMstpSnonWnonDnon_injured { - canReload = 0; - }; - class AmovPpneMstpSrasWrflDnon_injured; - class AinjPpneMstpSnonWrflDnon: AmovPpneMstpSrasWrflDnon_injured { - canReload = 0; - }; - - class LadderCivilStatic: StandBase { - ACE_isLadder = 1; - }; - }; -}; diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 8081a05637..82e52a5cb5 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -13,11 +13,16 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" + #include "CfgSounds.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" #include "CfgMagazines.hpp" +#include "CfgActions.hpp" +#include "CfgMoves.hpp" +#include "CfgVoice.hpp" + class ACE_Rsc_Display_Base { idd = -1; type = 0; @@ -126,9 +131,6 @@ class ACE_Settings { #include #include #include -#include -#include -#include class CfgUIGrids { class IGUI { From 12062c0e256e61e34329df0047b263386bb766be Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 24 Mar 2015 20:32:13 +0100 Subject: [PATCH 05/14] deleting obsolete stuff in common --- addons/common/DefaultItems.hpp | 1030 -------------------------------- 1 file changed, 1030 deletions(-) delete mode 100644 addons/common/DefaultItems.hpp diff --git a/addons/common/DefaultItems.hpp b/addons/common/DefaultItems.hpp deleted file mode 100644 index 539eb3beff..0000000000 --- a/addons/common/DefaultItems.hpp +++ /dev/null @@ -1,1030 +0,0 @@ -/* - -Autoexported while playing the unmodded game. - - -A = "_c = _x >> 'items'; isArray _c" configClasses (configFile >> "CfgVehicles"); - -B = []; {B set [_forEachIndex, inheritsFrom _x]} forEach A; -E = B - A; - -C = []; {C set [_forEachIndex, getArray (_x >> "items")]} forEach A; -D = []; {D set [_forEachIndex, getArray (_x >> "respawnItems")]} forEach A; - -{A set [_forEachIndex, configName _x]} forEach A; -{B set [_forEachIndex, configName _x]} forEach B; -{E set [_forEachIndex, configName _x]} forEach E; - -diag_log text "====================="; - -{ - diag_log text format ["class %1;", _x]; -} forEach E; - -{ - diag_log text format ["class %1: %2 {", _x, B select _forEachIndex]; - _s = str (C select _forEachIndex); _s = toString (toArray _s - [91,93]); - diag_log text format [" items[] = {%1};", _s]; - _s = str (D select _forEachIndex); _s = toString (toArray _s - [91,93]); - diag_log text format [" respawnItems[] = {%1};", _s]; - diag_log text "};"; -} forEach A; - -*/ - -class SoldierWB; -class SoldierGB; -class SoldierEB; -class C_man_1; -class B_Soldier_base_F: SoldierWB { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_02_f: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_03_f: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_04_f: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_05_f: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_RangeMaster_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_lite_F: B_Soldier_03_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_GL_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_AR_F: B_Soldier_02_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_SL_F: B_Soldier_03_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_TL_F: B_Soldier_03_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_M_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_LAT_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_medic_F: B_Soldier_02_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_repair_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_exp_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Helipilot_F: B_Soldier_04_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_A_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_AT_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_AA_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_engineer_F: B_Soldier_03_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_crew_F: B_Soldier_03_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_officer_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Competitor_F: B_RangeMaster_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Pilot_F: B_Soldier_05_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_helicrew_F: B_Helipilot_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_PG_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_UAV_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class b_soldier_unarmed_f: B_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_diver_base_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_diver_F: B_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_diver_TL_F: B_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_diver_exp_F: B_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_recon_base: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_recon_F: B_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_recon_LAT_F: B_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_recon_exp_F: B_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_recon_medic_F: B_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_recon_TL_F: B_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_recon_M_F: B_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_recon_JTAC_F: B_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_sniper_base_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_spotter_F: B_Soldier_sniper_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_sniper_F: B_Soldier_sniper_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Story_SF_Captain_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Story_Protagonist_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Story_Engineer_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Story_Colonel_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Story_Pilot_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Story_Tank_Commander_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class b_soldier_survival_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_CTRG_soldier_GL_LAT_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_CTRG_soldier_engineer_exp_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_CTRG_soldier_M_medic_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_CTRG_soldier_AR_A_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_support_base_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_AAR_F: B_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_AAT_F: B_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_AAA_F: B_soldier_AAT_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_support_MG_F: B_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_support_GMG_F: B_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_support_Mort_F: B_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_support_AMG_F: B_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_support_AMort_F: B_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_base_F: SoldierGB { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_lite_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_SL_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_TL_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_AR_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_medic_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_engineer_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_exp_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_GL_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_M_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_LAT_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_A_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_officer_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_F: I_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_F: I_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_lite_F: I_G_Soldier_lite_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_lite_F: I_G_Soldier_lite_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_SL_F: I_G_Soldier_SL_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_SL_F: I_G_Soldier_SL_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_TL_F: I_G_Soldier_TL_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_TL_F: I_G_Soldier_TL_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_AR_F: I_G_Soldier_AR_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_AR_F: I_G_Soldier_AR_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_medic_F: I_G_medic_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_medic_F: I_G_medic_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_engineer_F: I_G_engineer_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_engineer_F: I_G_engineer_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_exp_F: I_G_Soldier_exp_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_exp_F: I_G_Soldier_exp_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_GL_F: I_G_Soldier_GL_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_GL_F: I_G_Soldier_GL_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_M_F: I_G_Soldier_M_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_M_F: I_G_Soldier_M_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_LAT_F: I_G_Soldier_LAT_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_LAT_F: I_G_Soldier_LAT_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_A_F: I_G_Soldier_A_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_A_F: I_G_Soldier_A_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_officer_F: I_G_officer_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_officer_F: I_G_officer_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class i_g_soldier_unarmed_f: I_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class b_g_soldier_unarmed_f: B_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class o_g_soldier_unarmed_f: O_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class i_g_survivor_F: I_G_Soldier_F { - items[] = {}; - respawnItems[] = {}; -}; -class b_g_survivor_F: B_G_Soldier_F { - items[] = {}; - respawnItems[] = {}; -}; -class o_g_survivor_F: O_G_Soldier_F { - items[] = {}; - respawnItems[] = {}; -}; -class I_G_Story_Protagonist_F: B_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Story_SF_Captain_F: B_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_resistanceLeader_F: I_G_Story_Protagonist_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_resistanceCommander_F: I_G_Story_Protagonist_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_base_F: SoldierGB { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_02_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_03_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_04_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_soldier_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_lite_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_A_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_GL_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_AR_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_SL_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_TL_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_M_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_LAT_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_AT_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_AA_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_medic_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_repair_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_exp_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_engineer_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_crew_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_helipilot_F: I_Soldier_03_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_pilot_F: I_Soldier_04_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_helicrew_F: I_helipilot_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_officer_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Story_Colonel_F: I_officer_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_soldier_UAV_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class i_soldier_unarmed_f: I_soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_diver_base_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_diver_F: I_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_diver_exp_F: I_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_diver_TL_F: I_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_sniper_base_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Spotter_F: I_Soldier_sniper_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Sniper_F: I_Soldier_sniper_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_support_base_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_AAR_F: I_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_AAT_F: I_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_AAA_F: I_Soldier_AAT_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_support_MG_F: I_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_support_GMG_F: I_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_support_Mort_F: I_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_support_AMG_F: I_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_support_AMort_F: I_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_base_F: SoldierEB { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_officer_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_02_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_lite_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_GL_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_AR_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_SL_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_TL_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldier_M_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_LAT_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_medic_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldier_repair_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldier_exp_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_helipilot_F: O_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_A_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_AT_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_AA_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_engineer_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_crew_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Pilot_F: O_helipilot_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_helicrew_F: O_helipilot_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldier_PG_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Story_Colonel_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Story_CEO_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldier_UAV_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class o_soldier_unarmed_f: O_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_diver_base_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_diver_F: O_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_diver_TL_F: O_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_diver_exp_F: O_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_sniper_base_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_spotter_F: O_Soldier_sniper_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_sniper_F: O_Soldier_sniper_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_recon_base: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_recon_F: O_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_recon_M_F: O_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_recon_LAT_F: O_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_recon_medic_F: O_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_recon_exp_F: O_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_recon_JTAC_F: O_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_recon_TL_F: O_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_support_base_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_AAR_F: O_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_AAT_F: O_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_AAA_F: O_Soldier_AAT_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_support_MG_F: O_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_support_GMG_F: O_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_support_Mort_F: O_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_support_AMG_F: O_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_support_AMort_F: O_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_Urban_base: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_AR_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_AAR_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_LAT_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_AT_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_AAT_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_AA_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_AAA_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_TL_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_SoldierU_SL_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_medic_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_repair_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_exp_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_engineer_U_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_M_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_A_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_SoldierU_GL_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class C_Marshal_F: B_RangeMaster_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_VR_F: B_Soldier_base_F { - items[] = {}; - respawnItems[] = {}; -}; -class O_Soldier_VR_F: O_Soldier_base_F { - items[] = {}; - respawnItems[] = {}; -}; -class I_Soldier_VR_F: I_Soldier_base_F { - items[] = {}; - respawnItems[] = {}; -}; -class C_Soldier_VR_F: C_man_1 { - items[] = {}; - respawnItems[] = {}; -}; -class B_Protagonist_VR_F: B_Soldier_base_F { - items[] = {}; - respawnItems[] = {}; -}; -class O_Protagonist_VR_F: O_Soldier_base_F { - items[] = {}; - respawnItems[] = {}; -}; -class I_Protagonist_VR_F: I_Soldier_base_F { - items[] = {}; - respawnItems[] = {}; -}; -class B_UAV_AI: B_Helipilot_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_UAV_AI: O_helipilot_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_UAV_AI: O_UAV_AI { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class Underwear_F: B_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class b_survivor_F: B_Soldier_F { - items[] = {}; - respawnItems[] = {}; -}; -class o_survivor_F: O_Soldier_F { - items[] = {}; - respawnItems[] = {}; -}; -class i_survivor_F: I_soldier_F { - items[] = {}; - respawnItems[] = {}; -}; -class b_soldier_universal_f: B_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class b_g_soldier_universal_f: B_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class o_soldier_universal_f: O_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class o_g_soldier_universal_f: O_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class i_soldier_universal_f: I_soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class i_g_soldier_universal_f: I_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; From 655f23b53cfbf99017f4593c5855e1c83693f506 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 24 Mar 2015 21:37:27 +0100 Subject: [PATCH 06/14] start carrying phase --- addons/dragging/XEH_preInit.sqf | 2 + addons/dragging/functions/fnc_dropObject.sqf | 10 ++-- .../functions/fnc_dropObject_carry.sqf | 18 +++++- addons/dragging/functions/fnc_startCarry.sqf | 57 +++++++++++++++++++ .../dragging/functions/fnc_startCarryPFH.sqf | 23 ++++++++ 5 files changed, 103 insertions(+), 7 deletions(-) create mode 100644 addons/dragging/functions/fnc_startCarry.sqf create mode 100644 addons/dragging/functions/fnc_startCarryPFH.sqf diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf index dba69eb22a..f596a89493 100644 --- a/addons/dragging/XEH_preInit.sqf +++ b/addons/dragging/XEH_preInit.sqf @@ -24,6 +24,8 @@ PREP(initPerson); PREP(isObjectOnObject); PREP(setCarryable); PREP(setDraggable); +PREP(startCarry); +PREP(startCarryPFH); PREP(startDrag); PREP(startDragPFH); diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 9ebbfae61f..489457bfbc 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -27,7 +27,7 @@ _inBuilding = [_unit] call FUNC(isObjectOnObject); _unit playAction "released"; // prevent collision damage -["fixCollision", _unit, _unit] call EFUNC(common,targetEvent); +["fixCollision", _unit] call EFUNC(common,localEvent); ["fixCollision", _target, _target] call EFUNC(common,targetEvent); // release object @@ -37,7 +37,7 @@ if (_target isKindOf "CAManBase") then { if (_target getVariable ["ACE_isUnconscious", false]) then { [_target, "unconscious", 2, true] call EFUNC(common,doAnimation); } else { - [_target, "", 2, true] call EFUNC(common,doAnimation); //@todo "AinjPpneMrunSnonWnonDb_release" seems to fall back to unconsciousness anim. retest after config fix + [_target, "", 2, true] call EFUNC(common,doAnimation); //@todo "AinjPpneMrunSnonWnonDb_release" seems to fall back to unconsciousness anim. }; }; @@ -54,5 +54,7 @@ _unit setVariable [QGVAR(draggedObject), objNull, true]; // make object accesable for other units [objNull, _target, true] call EFUNC(common,claim); -["fixPosition", _target, _target] call EFUNC(common,targetEvent); -["fixFloating", _target, _target] call EFUNC(common,targetEvent); +if !(_target isKindOf "CAManBase") then { + ["fixPosition", _target, _target] call EFUNC(common,targetEvent); + ["fixFloating", _target, _target] call EFUNC(common,targetEvent); +}; diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index 497b96b95c..83c93827d1 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -24,12 +24,22 @@ private "_inBuilding"; _inBuilding = [_unit] call FUNC(isObjectOnObject); // prevent collision damage -["fixCollision", _unit, _unit] call EFUNC(common,targetEvent); +["fixCollision", _unit] call EFUNC(common,localEvent); ["fixCollision", _target, _target] call EFUNC(common,targetEvent); // release object detach _target; +if (_target isKindOf "CAManBase") then { + [_unit, "", 2, true] call EFUNC(common,doAnimation); + + if (_target getVariable ["ACE_isUnconscious", false]) then { + [_target, "unconscious", 2, true] call EFUNC(common,doAnimation); + } else { + [_target, "", 2, true] call EFUNC(common,doAnimation); //@todo + }; +}; + // reselect weapon and re-enable sprint _unit selectWeapon primaryWeapon _unit; @@ -46,5 +56,7 @@ _unit setVariable [QGVAR(carriedObject), objNull, true]; // make object accesable for other units [objNull, _target, true] call EFUNC(common,claim); -["fixPosition", _target, _target] call EFUNC(common,targetEvent); -["fixFloating", _target, _target] call EFUNC(common,targetEvent); +if !(_target isKindOf "CAManBase") then { + ["fixPosition", _target, _target] call EFUNC(common,targetEvent); + ["fixFloating", _target, _target] call EFUNC(common,targetEvent); +}; diff --git a/addons/dragging/functions/fnc_startCarry.sqf b/addons/dragging/functions/fnc_startCarry.sqf new file mode 100644 index 0000000000..ca73805b61 --- /dev/null +++ b/addons/dragging/functions/fnc_startCarry.sqf @@ -0,0 +1,57 @@ +/* + * Author: commy2 + * + * Start the carrying process. + * + * Argument: + * 0: Unit that should do the carrying (Object) + * 1: Object to carry (Object) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +// check weight +private "_weight"; +_weight = [_target] call FUNC(getWeight); + +if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith { + [localize "STR_ACE_Dragging_UnableToDrag"] call EFUNC(common,displayTextStructured); +}; + +// select no weapon and stop sprinting +_unit action ["SwitchWeapon", _unit, _unit, 99]; + +[_unit, "isDragging", true] call EFUNC(common,setforceWalkStatus); + +// prevent multiple players from accessing the same object +[_unit, _target, true] call EFUNC(common,claim); + +private "_timer"; +_timer = 2; + +// can't play action that depends on weapon if it was added the same frame +/*[{_this playActionNow "grabDrag";}, _unit] call EFUNC(common,execNextFrame);*/ //@todo + +// move a bit closer and adjust direction when trying to pick up a person +if (_target isKindOf "CAManBase") then { + /*[_target, "AinjPpneMrunSnonWnonDb_grab", 2, true] call EFUNC(common,doAnimation); + _target setDir (getDir _unit + 180); + _target setPos (getPos _unit vectorAdd (vectorDir _unit vectorMultiply 1.5));*/ + + _timer = 15; + + +//@todo +}; + +// prevents draging and carrying at the same time +_unit setVariable [QGVAR(isCarrying), true, true]; + +[FUNC(startCarryPFH), 0.2, [_unit, _target], _timer] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf new file mode 100644 index 0000000000..b9cfd06d0c --- /dev/null +++ b/addons/dragging/functions/fnc_startCarryPFH.sqf @@ -0,0 +1,23 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_target", "_timeOut"]; + +_unit = _this select 0 select 0; +_target = _this select 0 select 1; +_timeOut = _this select 0 select 2; + +// timeout. Done with lifting object. Start carrying process. +if (time > _timeOut) exitWith { + [_this select 1] call CBA_fnc_removePerFrameHandler; + + // drop if in timeout + private "_carriedObject"; + _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; + + if (!isNull _carriedObject) exitWith { + [_unit, _carriedObject] call FUNC(dropObject); + }; + + [_unit, _target] call FUNC(carryObject); +}; From ebe9d7ed5f96e017e3c4437f04f158de5a34faa5 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 25 Mar 2015 13:32:59 +0100 Subject: [PATCH 07/14] carrying unconscious persons --- addons/dragging/functions/fnc_carryObject.sqf | 41 +++++++--------- .../functions/fnc_dropObject_carry.sqf | 11 +++++ .../fnc_handlePlayerWeaponChanged.sqf | 21 +++++--- .../functions/fnc_handleScrollWheel.sqf | 5 +- .../functions/fnc_handleUnconscious.sqf | 37 ++++++++++---- .../dragging/functions/fnc_setCarryable.sqf | 2 +- addons/dragging/functions/fnc_startCarry.sqf | 49 ++++++++++++------- .../dragging/functions/fnc_startCarryPFH.sqf | 21 ++++---- addons/dragging/functions/fnc_startDrag.sqf | 3 +- .../dragging/functions/fnc_startDragPFH.sqf | 18 ++++--- addons/dragging/script_component.hpp | 1 + 11 files changed, 135 insertions(+), 74 deletions(-) diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index 5fe3f36ccb..5d8be3af9b 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -17,36 +17,33 @@ private ["_unit", "_target"]; _unit = _this select 0; _target = _this select 1; -// check weight -private "_weight"; -_weight = [_target] call FUNC(getWeight); - -if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith { - [localize "STR_ACE_Dragging_UnableToDrag"] call EFUNC(common,displayTextStructured); -}; - -// select no weapon and stop sprinting -_unit action ["SwitchWeapon", _unit, _unit, 99]; - -[_unit, "isDragging", true] call EFUNC(common,setforceWalkStatus); - -// prevent multiple players from accessing the same object -[_unit, _target, true] call EFUNC(common,claim); - // get attachTo offset and direction. private ["_position", "_direction"]; _position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]]; _direction = _target getVariable [QGVAR(carryDirection), 0]; -// add height offset of model -private "_offset"; -_offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2); +// handle objects vs persons +if (_target isKindOf "CAManBase") then { -_position = _position vectorAdd [0, 0, _offset]; + [_unit, "AcinPercMstpSnonWnonDnon", 2, true] call EFUNC(common,doAnimation); + [_target, "AinjPfalMstpSnonWnonDf_carried_dead", 2, true] call EFUNC(common,doAnimation); -// attach object -_target attachTo [_unit, _position]; + // attach person + _target attachTo [_unit, _position, "LeftShoulder"]; + +} else { + + // add height offset of model + private "_offset"; + _offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2); + + _position = _position vectorAdd [0, 0, _offset]; + + // attach object + _target attachTo [_unit, _position]; + +}; _target setDir _direction; _unit setVariable [QGVAR(isCarrying), true, true]; diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index 83c93827d1..b8d90a2c22 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -40,6 +40,17 @@ if (_target isKindOf "CAManBase") then { }; }; +// fix anim when aborting carrying persons +if (animationState _unit in CARRY_ANIMATIONS) then { + [_unit, "", 2, true] call EFUNC(common,doAnimation); + + if (_target getVariable ["ACE_isUnconscious", false]) then { + [_target, "unconscious", 2, true] call EFUNC(common,doAnimation); + } else { + [_target, "", 2, true] call EFUNC(common,doAnimation); + }; +}; + // reselect weapon and re-enable sprint _unit selectWeapon primaryWeapon _unit; diff --git a/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf b/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf index 44160b54c1..a7f9be7681 100644 --- a/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf +++ b/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf @@ -20,12 +20,21 @@ if (_unit getVariable [QGVAR(isDragging), false]) then { if (_unit getVariable [QGVAR(isCarrying), false]) then { - // drop carried object when selecting any weapon - if (_weapon != "") then { - private "_carriedObject"; - _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; + private "_carriedObject"; + _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; + + if (_carriedObject isKindOf "CAManBase") then { + + if (_weapon != primaryWeapon _unit) then { + [_unit, _carriedObject] call FUNC(dropObject_carry); + }; + + } else { + + // drop carried object when selecting any weapon + if (_weapon != "") then { + [_unit, _carriedObject] call FUNC(dropObject_carry); + }; - [_unit, _carriedObject] call FUNC(dropObject_carry); }; - }; diff --git a/addons/dragging/functions/fnc_handleScrollWheel.sqf b/addons/dragging/functions/fnc_handleScrollWheel.sqf index ce100abf50..0782e64db7 100644 --- a/addons/dragging/functions/fnc_handleScrollWheel.sqf +++ b/addons/dragging/functions/fnc_handleScrollWheel.sqf @@ -28,7 +28,10 @@ _scrollAmount = _this select 0; _scrollAmount = _scrollAmount * 0.15; private "_carriedItem"; -_carriedItem = _unit getVariable [QGVAR(carriedObject),objNull]; +_carriedItem = _unit getVariable [QGVAR(carriedObject), objNull]; + +//disabled for persons +if (_carriedItem isKindOf "CAManBase") exitWith {false}; private ["_position", "_maxHeight"]; diff --git a/addons/dragging/functions/fnc_handleUnconscious.sqf b/addons/dragging/functions/fnc_handleUnconscious.sqf index ac774f9c68..6ca9609b63 100644 --- a/addons/dragging/functions/fnc_handleUnconscious.sqf +++ b/addons/dragging/functions/fnc_handleUnconscious.sqf @@ -9,17 +9,36 @@ _isUnconscious = _this select 1; private "_player"; _player = ACE_player; -if !(_player getVariable [QGVAR(isDragging), false]) exitWith {}; +if (_player getVariable [QGVAR(isDragging), false]) then { -private "_draggedObject"; -_draggedObject = _player getVariable [QGVAR(draggedObject), objNull]; + private "_draggedObject"; + _draggedObject = _player getVariable [QGVAR(draggedObject), objNull]; + + // handle falling unconscious + if (_unit == _player) then { + [_unit, _draggedObject] call FUNC(dropObject); + }; + + // handle waking up dragged unit + if (_unit == _draggedObject) then { + [_player, _draggedObject] call FUNC(dropObject); + }; -// handle falling unconscious -if (_unit == _player) then { - [_unit, _draggedObject] call FUNC(dropObject); }; -// handle waking up dragged unit -if (_unit == _draggedObject) then { - [_player, _draggedObject] call FUNC(dropObject); +if (_player getVariable [QGVAR(isCarrying), false]) then { + + private "_carriedObject"; + _carriedObject = _player getVariable [QGVAR(carriedObject), objNull]; + + // handle falling unconscious + if (_unit == _player) then { + [_unit, _carriedObject] call FUNC(dropObject_carry); + }; + + // handle waking up dragged unit + if (_unit == _carriedObject) then { + [_player, _carriedObject] call FUNC(dropObject_carry); + }; + }; diff --git a/addons/dragging/functions/fnc_setCarryable.sqf b/addons/dragging/functions/fnc_setCarryable.sqf index 56bfa5bd7a..bc6da1f04d 100644 --- a/addons/dragging/functions/fnc_setCarryable.sqf +++ b/addons/dragging/functions/fnc_setCarryable.sqf @@ -48,7 +48,7 @@ if (_type in _initializedClasses) exitWith {}; _initializedClasses pushBack _type; GVAR(initializedClasses_carry) = _initializedClasses; -_carryAction = [QGVAR(carry), localize "STR_ACE_Dragging_Carry", "", {[_player, _target] call FUNC(carryObject)}, {[_player, _target] call FUNC(canCarry)}] call EFUNC(interact_menu,createAction); +_carryAction = [QGVAR(carry), localize "STR_ACE_Dragging_Carry", "", {[_player, _target] call FUNC(startCarry)}, {[_player, _target] call FUNC(canCarry)}] call EFUNC(interact_menu,createAction); _dropAction = [QGVAR(drop_carry), localize "STR_ACE_Dragging_Drop", "", {[_player, _target] call FUNC(dropObject_carry)}, {[_player, _target] call FUNC(canDrop_carry)}] call EFUNC(interact_menu,createAction); [_type, 0, ["ACE_MainActions"], _carryAction] call EFUNC(interact_menu,addActionToClass); diff --git a/addons/dragging/functions/fnc_startCarry.sqf b/addons/dragging/functions/fnc_startCarry.sqf index ca73805b61..c9f6cbd718 100644 --- a/addons/dragging/functions/fnc_startCarry.sqf +++ b/addons/dragging/functions/fnc_startCarry.sqf @@ -25,33 +25,46 @@ if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith { [localize "STR_ACE_Dragging_UnableToDrag"] call EFUNC(common,displayTextStructured); }; -// select no weapon and stop sprinting -_unit action ["SwitchWeapon", _unit, _unit, 99]; - -[_unit, "isDragging", true] call EFUNC(common,setforceWalkStatus); - -// prevent multiple players from accessing the same object -[_unit, _target, true] call EFUNC(common,claim); - private "_timer"; -_timer = 2; +_timer = time + 2; -// can't play action that depends on weapon if it was added the same frame -/*[{_this playActionNow "grabDrag";}, _unit] call EFUNC(common,execNextFrame);*/ //@todo - -// move a bit closer and adjust direction when trying to pick up a person +// handle objects vs persons if (_target isKindOf "CAManBase") then { - /*[_target, "AinjPpneMrunSnonWnonDb_grab", 2, true] call EFUNC(common,doAnimation); + + // add a primary weapon if the unit has none. + if (primaryWeapon _unit == "") then { + _unit addWeapon "ACE_FakePrimaryWeapon"; + }; + + // select primary, otherwise the drag animation actions don't work. + _unit selectWeapon primaryWeapon _unit; + + // move a bit closer and adjust direction when trying to pick up a person _target setDir (getDir _unit + 180); - _target setPos (getPos _unit vectorAdd (vectorDir _unit vectorMultiply 1.5));*/ + _target setPos (getPos _unit vectorAdd vectorDir _unit); - _timer = 15; + [_unit, "AcinPknlMstpSnonWnonDnon_AcinPercMrunSnonWnonDnon", 2, true] call EFUNC(common,doAnimation); + [_target, "AinjPfalMstpSnonWrflDnon_carried_Up", 2, true] call EFUNC(common,doAnimation); + _timer = time + 15; + +} else { + + // select no weapon and stop sprinting + _unit action ["SwitchWeapon", _unit, _unit, 99]; + [_unit, "AmovPercMstpSnonWnonDnon", 0] call EFUNC(common,doAnimation); + + [_unit, "isDragging", true] call EFUNC(common,setforceWalkStatus); + + // prevent multiple players from accessing the same object + [_unit, _target, true] call EFUNC(common,claim); -//@todo }; // prevents draging and carrying at the same time _unit setVariable [QGVAR(isCarrying), true, true]; -[FUNC(startCarryPFH), 0.2, [_unit, _target], _timer] call CBA_fnc_addPerFrameHandler; +// required for aborting animation +_unit setVariable [QGVAR(carriedObject), _target, true]; + +[FUNC(startCarryPFH), 0.2, [_unit, _target, _timer]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf index b9cfd06d0c..b3ece63bc2 100644 --- a/addons/dragging/functions/fnc_startCarryPFH.sqf +++ b/addons/dragging/functions/fnc_startCarryPFH.sqf @@ -7,17 +7,20 @@ _unit = _this select 0 select 0; _target = _this select 0 select 1; _timeOut = _this select 0 select 2; +// same as dragObjectPFH, checks if object is deleted or dead. +if !([_target] call EFUNC(common,isAlive)) then { + [_unit, _target] call FUNC(dropObject); + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; + // timeout. Done with lifting object. Start carrying process. if (time > _timeOut) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; - - // drop if in timeout - private "_carriedObject"; - _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; - - if (!isNull _carriedObject) exitWith { - [_unit, _carriedObject] call FUNC(dropObject); + // handles aborting carry + if (_unit getVariable [QGVAR(isCarrying), false]) then { + [_unit, _target] call FUNC(carryObject); }; - [_unit, _target] call FUNC(carryObject); + [_this select 1] call CBA_fnc_removePerFrameHandler; }; + +// @todo, wait for stance _unit == "STAND" diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index d98a9f8eaa..fbf0f4608c 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -42,9 +42,10 @@ _unit selectWeapon primaryWeapon _unit; // move a bit closer and adjust direction when trying to pick up a person if (_target isKindOf "CAManBase") then { - [_target, "AinjPpneMrunSnonWnonDb_grab", 2, true] call EFUNC(common,doAnimation); _target setDir (getDir _unit + 180); _target setPos (getPos _unit vectorAdd (vectorDir _unit vectorMultiply 1.5)); + + [_target, "AinjPpneMrunSnonWnonDb_grab", 2, true] call EFUNC(common,doAnimation); }; // prevents draging and carrying at the same time diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index 1d8c6f89f1..f1204cebd6 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -7,6 +7,12 @@ _unit = _this select 0 select 0; _target = _this select 0 select 1; _timeOut = _this select 0 select 2; +// same as dragObjectPFH, checks if object is deleted or dead. +if !([_target] call EFUNC(common,isAlive)) then { + [_unit, _target] call FUNC(dropObject); + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; + // timeout. Do nothing. Quit. time, because anim length is linked to ingame time. if (time > _timeOut) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; @@ -15,17 +21,15 @@ if (time > _timeOut) exitWith { private "_draggedObject"; _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull]; - if (!isNull _draggedObject) exitWith { - [_unit, _draggedObject] call FUNC(dropObject); - }; - - // re-enable everything - _unit setVariable [QGVAR(isDragging), false, true]; + [_unit, _draggedObject] call FUNC(dropObject); }; // unit is ready to start dragging if (animationState _unit in DRAG_ANIMATIONS) exitWith { - [_unit, _target] call FUNC(dragObject); + // handles aborting dragging + if (_unit getVariable [QGVAR(isDragging), false]) then { + [_unit, _target] call FUNC(dragObject); + }; [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/script_component.hpp b/addons/dragging/script_component.hpp index 0f601ae8d9..7ba0013309 100644 --- a/addons/dragging/script_component.hpp +++ b/addons/dragging/script_component.hpp @@ -12,3 +12,4 @@ #include "\z\ace\addons\main\script_macros.hpp" #define DRAG_ANIMATIONS ["amovpercmstpslowwrfldnon_acinpknlmwlkslowwrfldb_2", "amovpercmstpsraswpstdnon_acinpknlmwlksnonwpstdb_2", "amovpercmstpsnonwnondnon_acinpknlmwlksnonwnondb_2", "acinpknlmstpsraswrfldnon", "acinpknlmstpsnonwpstdnon", "acinpknlmstpsnonwnondnon", "acinpknlmwlksraswrfldb", "acinpknlmwlksnonwnondb"] +#define CARRY_ANIMATIONS ["acinpercmstpsnonwnondnon", "acinpknlmstpsnonwnondnon_acinpercmrunsnonwnondnon"] From 20882ed694acbd6784ef4e5df453caf0ff78d48e Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 25 Mar 2015 14:07:50 +0100 Subject: [PATCH 08/14] properly remove fake weapon after carrying persons --- addons/dragging/functions/fnc_dropObject.sqf | 2 +- addons/dragging/functions/fnc_dropObject_carry.sqf | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 489457bfbc..30b6fbf21b 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -33,7 +33,7 @@ _unit playAction "released"; // release object detach _target; -if (_target isKindOf "CAManBase") then { +if (_target isKindOf "CAManBase" || {animationState _unit in CARRY_ANIMATIONS}) then { if (_target getVariable ["ACE_isUnconscious", false]) then { [_target, "unconscious", 2, true] call EFUNC(common,doAnimation); } else { diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index b8d90a2c22..1808c1cb81 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -30,6 +30,7 @@ _inBuilding = [_unit] call FUNC(isObjectOnObject); // release object detach _target; +// fix anim when aborting carrying persons if (_target isKindOf "CAManBase") then { [_unit, "", 2, true] call EFUNC(common,doAnimation); @@ -40,16 +41,8 @@ if (_target isKindOf "CAManBase") then { }; }; -// fix anim when aborting carrying persons -if (animationState _unit in CARRY_ANIMATIONS) then { - [_unit, "", 2, true] call EFUNC(common,doAnimation); - - if (_target getVariable ["ACE_isUnconscious", false]) then { - [_target, "unconscious", 2, true] call EFUNC(common,doAnimation); - } else { - [_target, "", 2, true] call EFUNC(common,doAnimation); - }; -}; +// properly remove fake weapon +_unit removeWeapon "ACE_FakePrimaryWeapon"; // reselect weapon and re-enable sprint _unit selectWeapon primaryWeapon _unit; From e1b5b96a7e8ba917ae94ab200623d4825bd38b56 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 25 Mar 2015 14:09:49 +0100 Subject: [PATCH 09/14] derped the file --- addons/dragging/functions/fnc_dropObject.sqf | 2 +- addons/dragging/functions/fnc_dropObject_carry.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 30b6fbf21b..489457bfbc 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -33,7 +33,7 @@ _unit playAction "released"; // release object detach _target; -if (_target isKindOf "CAManBase" || {animationState _unit in CARRY_ANIMATIONS}) then { +if (_target isKindOf "CAManBase") then { if (_target getVariable ["ACE_isUnconscious", false]) then { [_target, "unconscious", 2, true] call EFUNC(common,doAnimation); } else { diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index 1808c1cb81..aaaacb1be2 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -31,7 +31,7 @@ _inBuilding = [_unit] call FUNC(isObjectOnObject); detach _target; // fix anim when aborting carrying persons -if (_target isKindOf "CAManBase") then { +if (_target isKindOf "CAManBase" || {animationState _unit in CARRY_ANIMATIONS}) then { [_unit, "", 2, true] call EFUNC(common,doAnimation); if (_target getVariable ["ACE_isUnconscious", false]) then { From 0c8e8236dd439e1ed79f9432b4b41d3917c80156 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 25 Mar 2015 14:32:36 +0100 Subject: [PATCH 10/14] logic --- addons/dragging/functions/fnc_startCarryPFH.sqf | 10 ++++++---- addons/dragging/functions/fnc_startDragPFH.sqf | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf index b3ece63bc2..9d4f0d4653 100644 --- a/addons/dragging/functions/fnc_startCarryPFH.sqf +++ b/addons/dragging/functions/fnc_startCarryPFH.sqf @@ -7,6 +7,11 @@ _unit = _this select 0 select 0; _target = _this select 0 select 1; _timeOut = _this select 0 select 2; +// handle aborting carry +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 { [_unit, _target] call FUNC(dropObject); @@ -15,10 +20,7 @@ if !([_target] call EFUNC(common,isAlive)) then { // timeout. Done with lifting object. Start carrying process. if (time > _timeOut) exitWith { - // handles aborting carry - if (_unit getVariable [QGVAR(isCarrying), false]) then { - [_unit, _target] call FUNC(carryObject); - }; + [_unit, _target] call FUNC(carryObject); [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index f1204cebd6..50bf18b3c2 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -7,6 +7,11 @@ _unit = _this select 0 select 0; _target = _this select 0 select 1; _timeOut = _this select 0 select 2; +// handle aborting drag +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 { [_unit, _target] call FUNC(dropObject); @@ -26,10 +31,7 @@ if (time > _timeOut) exitWith { // unit is ready to start dragging if (animationState _unit in DRAG_ANIMATIONS) exitWith { - // handles aborting dragging - if (_unit getVariable [QGVAR(isDragging), false]) then { - [_unit, _target] call FUNC(dragObject); - }; + [_unit, _target] call FUNC(dragObject); [_this select 1] call CBA_fnc_removePerFrameHandler; }; From 569a77d41bda73753847e0dbfbd012841ca9c34f Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 25 Mar 2015 14:34:19 +0100 Subject: [PATCH 11/14] logic --- addons/dragging/functions/fnc_startCarryPFH.sqf | 2 +- addons/dragging/functions/fnc_startDragPFH.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf index 9d4f0d4653..a49d879631 100644 --- a/addons/dragging/functions/fnc_startCarryPFH.sqf +++ b/addons/dragging/functions/fnc_startCarryPFH.sqf @@ -8,7 +8,7 @@ _target = _this select 0 select 1; _timeOut = _this select 0 select 2; // handle aborting carry -if (_unit getVariable [QGVAR(isCarrying), false]) exitWith { +if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index 50bf18b3c2..87c82f3e18 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -8,7 +8,7 @@ _target = _this select 0 select 1; _timeOut = _this select 0 select 2; // handle aborting drag -if (_unit getVariable [QGVAR(isDragging), false]) exitWith { +if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; From 3634eaf568af0c33d961e778dfa2382e6901c3da Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 25 Mar 2015 20:18:23 +0100 Subject: [PATCH 12/14] tweak carry stance req., timeout certain PFH, exit PFH, debug --- addons/dragging/functions/fnc_carryObject.sqf | 2 +- .../dragging/functions/fnc_carryObjectPFH.sqf | 8 +++++ addons/dragging/functions/fnc_dragObject.sqf | 2 +- .../dragging/functions/fnc_dragObjectPFH.sqf | 8 +++++ addons/dragging/functions/fnc_startCarry.sqf | 2 +- .../dragging/functions/fnc_startCarryPFH.sqf | 33 +++++++++++++++---- .../dragging/functions/fnc_startDragPFH.sqf | 5 ++- addons/dragging/script_component.hpp | 2 ++ 8 files changed, 52 insertions(+), 10 deletions(-) diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index 5d8be3af9b..338782351f 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -71,7 +71,7 @@ _actionID = _unit addAction [ _unit setVariable [QGVAR(ReleaseActionID), _actionID]; // check everything -[FUNC(carryObjectPFH), 0, [_unit, _target]] call CBA_fnc_addPerFrameHandler; +[FUNC(carryObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler; // reset current dragging height. GVAR(currentHeightChange) = 0; diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index 81b2369624..8afa0f541a 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -1,11 +1,19 @@ // by commy2 #include "script_component.hpp" +#ifdef DEBUG_ENABLED_DRAGGING + systemChat format ["%1 carryObjectPFH running", time]; +#endif + private ["_unit", "_target"]; _unit = _this select 0 select 0; _target = _this select 0 select 1; +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 { [_unit, _target] call FUNC(dropObject_carry); diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index bd27524fc6..9707eef64d 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -62,7 +62,7 @@ _actionID = _unit addAction [ _unit setVariable [QGVAR(ReleaseActionID), _actionID]; // check everything -[FUNC(dragObjectPFH), 0, [_unit, _target]] call CBA_fnc_addPerFrameHandler; +[FUNC(dragObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler; // reset current dragging height. GVAR(currentHeightChange) = 0; diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index e741b01f17..2290c65e9d 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -1,11 +1,19 @@ // by commy2 #include "script_component.hpp" +#ifdef DEBUG_ENABLED_DRAGGING + systemChat format ["%1 dragObjectPFH running", time]; +#endif + private ["_unit", "_target"]; _unit = _this select 0 select 0; _target = _this select 0 select 1; +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 { [_unit, _target] call FUNC(dropObject); diff --git a/addons/dragging/functions/fnc_startCarry.sqf b/addons/dragging/functions/fnc_startCarry.sqf index c9f6cbd718..9f1c0bca23 100644 --- a/addons/dragging/functions/fnc_startCarry.sqf +++ b/addons/dragging/functions/fnc_startCarry.sqf @@ -26,7 +26,7 @@ if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith { }; private "_timer"; -_timer = time + 2; +_timer = time + 5; // handle objects vs persons if (_target isKindOf "CAManBase") then { diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf index a49d879631..a932d4e189 100644 --- a/addons/dragging/functions/fnc_startCarryPFH.sqf +++ b/addons/dragging/functions/fnc_startCarryPFH.sqf @@ -1,6 +1,10 @@ // by commy2 #include "script_component.hpp" +#ifdef DEBUG_ENABLED_DRAGGING + systemChat format ["%1 startCarryPFH running", time]; +#endif + private ["_unit", "_target", "_timeOut"]; _unit = _this select 0 select 0; @@ -18,11 +22,28 @@ if !([_target] call EFUNC(common,isAlive)) then { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -// timeout. Done with lifting object. Start carrying process. -if (time > _timeOut) exitWith { - [_unit, _target] call FUNC(carryObject); +// handle persons vs objects +if (_target isKindOf "CAManBase") then { + if (time > _timeOut) exitWith { + [_unit, _target] call FUNC(carryObject); + + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; +} else { + if (time > _timeOut) exitWith { + [_this select 1] call CBA_fnc_removePerFrameHandler; + + // drop if in timeout + private "_draggedObject"; + _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull]; + [_unit, _draggedObject] call FUNC(dropObject); + }; + + // wait for the unit to stand up + if (stance _unit == "STAND") exitWith { + [_unit, _target] call FUNC(carryObject); + + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; - [_this select 1] call CBA_fnc_removePerFrameHandler; }; - -// @todo, wait for stance _unit == "STAND" diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index 87c82f3e18..10d9d896a8 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -1,6 +1,10 @@ // by commy2 #include "script_component.hpp" +#ifdef DEBUG_ENABLED_DRAGGING + systemChat format ["%1 startDragPFH running", time]; +#endif + private ["_unit", "_target", "_timeOut"]; _unit = _this select 0 select 0; @@ -25,7 +29,6 @@ if (time > _timeOut) exitWith { // drop if in timeout private "_draggedObject"; _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull]; - [_unit, _draggedObject] call FUNC(dropObject); }; diff --git a/addons/dragging/script_component.hpp b/addons/dragging/script_component.hpp index 7ba0013309..2427f89739 100644 --- a/addons/dragging/script_component.hpp +++ b/addons/dragging/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT dragging #include "\z\ace\addons\main\script_mod.hpp" +//#define DEBUG_ENABLED_DRAGGING + #ifdef DEBUG_ENABLED_DRAGGING #define DEBUG_MODE_FULL #endif From 01b7d3b213b32f7d434d9d34ec004e0f05369f41 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 25 Mar 2015 20:45:47 +0100 Subject: [PATCH 13/14] global setDir on attachTo --- addons/dragging/functions/fnc_carryObject.sqf | 2 +- addons/dragging/functions/fnc_dragObject.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index 338782351f..2037dfc3f0 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -44,7 +44,7 @@ if (_target isKindOf "CAManBase") then { _target attachTo [_unit, _position]; }; -_target setDir _direction; +["setDir", _target, [_target, _direction]] call EFUNC(common,targetEvent); _unit setVariable [QGVAR(isCarrying), true, true]; _unit setVariable [QGVAR(carriedObject), _target, true]; diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index 9707eef64d..f614af9548 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -31,7 +31,7 @@ _position = _position vectorAdd [0, 0, _offset]; // attach object _target attachTo [_unit, _position]; -_target setDir _direction; +["setDir", _target, [_target, _direction]] call EFUNC(common,targetEvent); if (_target isKindOf "CAManBase") then { [_target, "AinjPpneMrunSnonWnonDb_still", 0, true] call EFUNC(common,doAnimation); From e007a247d89636b1ec328462adbdf1711d668bc4 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 25 Mar 2015 21:51:50 +0100 Subject: [PATCH 14/14] detach when entering a vehicle, don't mess up animation insidea vehicle --- addons/dragging/XEH_clientInit.sqf | 1 + addons/dragging/functions/fnc_dropObject_carry.sqf | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/dragging/XEH_clientInit.sqf b/addons/dragging/XEH_clientInit.sqf index b87e4890d1..21d699c688 100644 --- a/addons/dragging/XEH_clientInit.sqf +++ b/addons/dragging/XEH_clientInit.sqf @@ -16,6 +16,7 @@ if (isNil "ACE_maxWeightCarry") then { // release object on player change. This does work when returning to lobby, but not when hard disconnecting. ["playerChanged", {_this call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); +["playerVehicleChanged", {[ACE_player, objNull] call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); ["playerWeaponChanged", {_this call DFUNC(handlePlayerWeaponChanged)}] call EFUNC(common,addEventhandler); // handle waking up dragged unit and falling unconscious while dragging diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index aaaacb1be2..5e2ea8b8c1 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -32,7 +32,9 @@ detach _target; // fix anim when aborting carrying persons if (_target isKindOf "CAManBase" || {animationState _unit in CARRY_ANIMATIONS}) then { - [_unit, "", 2, true] call EFUNC(common,doAnimation); + if (vehicle _unit == _unit) then { + [_unit, "", 2, true] call EFUNC(common,doAnimation); + }; if (_target getVariable ["ACE_isUnconscious", false]) then { [_target, "unconscious", 2, true] call EFUNC(common,doAnimation);