mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #243 from KoffeinFlummi/mediccarry
refining carrying injured persons
This commit is contained in:
@ -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;
|
@ -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)};);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
76
addons/common/CfgMoves.hpp
Normal file
76
addons/common/CfgMoves.hpp
Normal file
@ -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[] = {};
|
||||
};
|
||||
};
|
||||
};
|
@ -218,6 +218,7 @@ class CfgVoice {
|
||||
displayName = "$STR_ACE_Common_NoVoice";
|
||||
};
|
||||
};
|
||||
|
||||
class CfgVoiceTypes {
|
||||
class ACE_NoVoice {
|
||||
name = "$STR_ACE_Common_NoVoice";
|
File diff suppressed because it is too large
Load Diff
@ -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;
|
||||
};
|
||||
};
|
||||
};
|
@ -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 {
|
||||
@ -171,8 +173,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);
|
||||
|
@ -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);
|
||||
|
@ -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 <ProgressScreen.hpp>
|
||||
#include <HintConfig.hpp>
|
||||
#include <RscInfoType.hpp>
|
||||
#include <FixPickup.hpp>
|
||||
#include <FixAnimations.hpp>
|
||||
#include <NoVoice.hpp>
|
||||
|
||||
class CfgUIGrids {
|
||||
class IGUI {
|
||||
|
@ -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)));
|
@ -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));
|
@ -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
|
@ -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]);
|
@ -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]);
|
@ -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;
|
@ -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
|
@ -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
|
Reference in New Issue
Block a user