mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Dragging - Add new dragging animations (#7950)
* New custom animation added * Adjusted CfgMoves and the script components * New drop animation and key handler * CBA settings and new ManActions added * Adjustments to the drop animation * Added translations and fixed some stuff * Update CfgMovesBasic.hpp * Fix translations Co-authored-by: Elgin675 <elgin675@hotmail.com> Co-authored-by: Blutze <37950828+Blutze@users.noreply.github.com> * Use the same key to drop object * Update addons/dragging/stringtable.xml Co-authored-by: Jo David <github@jonathandavid.de> * Fix French translation Co-authored-by: Elgin675 <elgin675@hotmail.com> * Lower the weapon accuracy of the drag animations * Removed auto-switch to handgun * Update fnc_startDrag.sqf - Holding a launcher breaks the firing animation. - Now the unit has to hold either a primary weapon or handgun. * Handle the unit's current weapon Co-authored-by: BaerMitUmlaut <BaerMitUmlaut@users.noreply.github.com> * Update addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com> * Update addons/dragging/initSettings.sqf Co-authored-by: Elgin675 <elgin675@hotmail.com> Co-authored-by: Blutze <37950828+Blutze@users.noreply.github.com> Co-authored-by: Jo David <github@jonathandavid.de> Co-authored-by: BaerMitUmlaut <BaerMitUmlaut@users.noreply.github.com> Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com> Co-authored-by: jonpas <jonpas33@gmail.com>
This commit is contained in:
parent
c7d4981329
commit
026b94903e
@ -1,8 +1,56 @@
|
||||
class CfgMovesBasic {
|
||||
class ManActions {
|
||||
ACE_dragWithPistol = "ace_dragging";
|
||||
ACE_dragWithRifle = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2";
|
||||
};
|
||||
|
||||
class Actions {
|
||||
class MoveWithInjuredManDragger;
|
||||
class MoveWithInjuredManDraggerRfl: MoveWithInjuredManDragger {
|
||||
Up = "amovpercmstpsraswrfldnon";
|
||||
};
|
||||
|
||||
class MoveWithInjuredManDraggerPst;
|
||||
class ACE_MoveWithInjuredManDraggerPst: MoveWithInjuredManDraggerPst {
|
||||
Default = "ace_dragging_static";
|
||||
FastB = "ace_dragging";
|
||||
FastLB = "ace_dragging";
|
||||
FastRB = "ace_dragging";
|
||||
grabDrag = "ace_dragging_static";
|
||||
grabCarry = "Helper_SwitchToCarrynon_pst";
|
||||
HandGunOn = "ace_dragging_static";
|
||||
PlayerSlowB = "ace_dragging";
|
||||
PlayerSlowLB = "ace_dragging";
|
||||
PlayerSlowRB = "ace_dragging";
|
||||
PlayerTactB = "AmovPknlMtacSrasWpstDb";
|
||||
PlayerTactF = "AmovPknlMtacSrasWpstDf";
|
||||
PlayerTactL = "AmovPknlMtacSrasWpstDl";
|
||||
PlayerTactLB = "AmovPknlMtacSrasWpstDbl";
|
||||
PlayerTactLF = "AmovPknlMtacSrasWpstDfl";
|
||||
PlayerTactR = "AmovPknlMtacSrasWpstDr";
|
||||
PlayerTactRB = "AmovPknlMtacSrasWpstDbr";
|
||||
PlayerTactRF = "AmovPknlMtacSrasWpstDfr";
|
||||
PlayerWalkB = "ace_dragging";
|
||||
PlayerWalkLB = "ace_dragging";
|
||||
PlayerWalkRB = "ace_dragging";
|
||||
released = "ace_dragging_drop";
|
||||
SlowB = "ace_dragging";
|
||||
SlowLB = "ace_dragging";
|
||||
SlowRB = "ace_dragging";
|
||||
Stop = "ace_dragging_static";
|
||||
StopRelaxed = "ace_dragging_static";
|
||||
TactB = "AmovPknlMtacSrasWpstDb";
|
||||
TactF = "AmovPknlMtacSrasWpstDf";
|
||||
TactL = "AmovPknlMtacSrasWpstDl";
|
||||
TactLB = "AmovPknlMtacSrasWpstDbl";
|
||||
TactLF = "AmovPknlMtacSrasWpstDfl";
|
||||
TactR = "AmovPknlMtacSrasWpstDr";
|
||||
TactRB = "AmovPknlMtacSrasWpstDbr";
|
||||
TactRF = "AmovPknlMtacSrasWpstDfr";
|
||||
Up = "ace_dragging_static";
|
||||
WalkB = "ace_dragging";
|
||||
WalkLB = "ace_dragging";
|
||||
WalkRB = "ace_dragging";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,13 +1,127 @@
|
||||
class CfgMovesMaleSdr: CfgMovesBasic {
|
||||
class InjuredMovedBase;
|
||||
class AgonyBaseRfl;
|
||||
class StandBase;
|
||||
class AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_1;
|
||||
class DraggerBase;
|
||||
|
||||
class States {
|
||||
class AcinPknlMstpSnonWnonDnon_AcinPercMrunSnonWnonDnon: InjuredMovedBase {
|
||||
speed = -10; // 1/10
|
||||
};
|
||||
|
||||
class AinjPfalMstpSnonWrflDnon_carried_Up: AgonyBaseRfl {
|
||||
speed = -10; // 1/10
|
||||
};
|
||||
|
||||
class AmovPercMstpSrasWpstDnon: StandBase {
|
||||
ConnectTo[] = {
|
||||
"AmovPercMstpSrasWpstDnon",
|
||||
0.02,
|
||||
"AovrPercMstpSrasWpstDf",
|
||||
0.025,
|
||||
"AmovPercMstpSrasWpstDnon_AidlPercMstpSlowWpstDnon",
|
||||
0.0099999998,
|
||||
"PistolMagazineReloadStand",
|
||||
0.1,
|
||||
"AmovPercMstpSrasWpstDnon_AmovPercMstpSlowWpstDnon",
|
||||
0.02,
|
||||
"AmovPercMstpSrasWpstDnon_AmovPercMstpSrasWrflDnon",
|
||||
0.02,
|
||||
"AmovPercMstpSrasWpstDnon_AwopPercMstpSoptWbinDnon",
|
||||
0.02,
|
||||
"AmovPercMstpSrasWpstDnon_AmovPercMstpSnonWnonDnon",
|
||||
0.02,
|
||||
"AmovPercMstpSrasWpstDnon_SaluteIn",
|
||||
0.02,
|
||||
"AwopPercMstpSgthWpstDnon_Part1",
|
||||
0.1,
|
||||
"AmovPercMstpSrasWpstDnon_AinvPknlMstpSnonWnonDnon",
|
||||
0.02,
|
||||
"AmovPercMstpSrasWpstDnon_AmovPercMstpSrasWlnrDnon",
|
||||
0.02,
|
||||
"AmovPercMstpSrasWpstDnon_AadjPercMstpSrasWpstDup",
|
||||
0.02,
|
||||
"AmovPercMstpSrasWpstDnon_AadjPercMstpSrasWpstDdown",
|
||||
0.02,
|
||||
"AmovPercMstpSrasWpstDnon_AadjPercMstpSrasWpstDleft",
|
||||
0.02,
|
||||
"AmovPercMstpSrasWpstDnon_AadjPercMstpSrasWpstDright",
|
||||
0.02,
|
||||
"AmovPercMstpSrasWpstDnon_AmovPercMstpSrasWpstDnon_gear",
|
||||
0.02,
|
||||
"Acts_starterPistol_in",
|
||||
0.001,
|
||||
"Acts_PistolRaisedStand_Default",
|
||||
1,
|
||||
"ace_dragging",
|
||||
0.1
|
||||
};
|
||||
};
|
||||
|
||||
class AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2: AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_1 {
|
||||
aiming = "aimingDefault";
|
||||
aimingBody = "aimingUpDefault";
|
||||
aimPrecision = 5; // default: 1
|
||||
};
|
||||
|
||||
class ace_dragging: DraggerBase {
|
||||
actions = "ace_MoveWithInjuredManDraggerPst";
|
||||
aiming = "aimingPistol";
|
||||
aimingBody = "aimingPistol";
|
||||
aimPrecision = 2; // default: 1
|
||||
canPullTrigger = 1;
|
||||
canReload = 0;
|
||||
ConnectTo[] = {
|
||||
"ace_dragging",
|
||||
0.1,
|
||||
"ace_dragging_drop",
|
||||
0.2
|
||||
};
|
||||
disableWeapons = 0;
|
||||
duty = 0.6;
|
||||
enableBinocular = 0;
|
||||
file = QPATHTO_T(anim\ace_dragging.rtm);
|
||||
InterpolateTo[] = {
|
||||
"ace_dragging_static",
|
||||
0.1
|
||||
};
|
||||
interpolationSpeed = 5;
|
||||
limitGunMovement = 0.2;
|
||||
looped = 1;
|
||||
showHandGun = 1;
|
||||
turnSpeed = 0.5;
|
||||
};
|
||||
|
||||
class ace_dragging_static: ace_dragging {
|
||||
ConnectTo[] = {
|
||||
"ace_dragging",
|
||||
0.1,
|
||||
"ace_dragging_drop",
|
||||
0.2
|
||||
};
|
||||
InterpolateTo[] = {
|
||||
"ace_dragging",
|
||||
0.1,
|
||||
"ace_dragging_drop",
|
||||
0.2
|
||||
};
|
||||
looped = 1;
|
||||
speed = 0;
|
||||
};
|
||||
|
||||
class ace_dragging_drop: ace_dragging {
|
||||
ConnectTo[] = {
|
||||
"AmovPknlMstpSrasWpstDnon",
|
||||
0.1
|
||||
};
|
||||
file = QPATHTO_T(anim\ace_dragging_drop.rtm);
|
||||
InterpolateTo[] = {
|
||||
"Unconscious",
|
||||
0.02
|
||||
};
|
||||
interpolationSpeed = 5;
|
||||
looped = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -6,4 +6,6 @@ PREP_RECOMPILE_START;
|
||||
#include "XEH_PREP.hpp"
|
||||
PREP_RECOMPILE_END;
|
||||
|
||||
#include "initSettings.sqf"
|
||||
|
||||
ADDON = true;
|
||||
|
BIN
addons/dragging/anim/ace_dragging.rtm
Normal file
BIN
addons/dragging/anim/ace_dragging.rtm
Normal file
Binary file not shown.
BIN
addons/dragging/anim/ace_dragging_drop.rtm
Normal file
BIN
addons/dragging/anim/ace_dragging_drop.rtm
Normal file
Binary file not shown.
@ -8,7 +8,7 @@ class CfgPatches {
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_interaction"};
|
||||
author = ECSTRING(common,ACETeam);
|
||||
authors[] = {"Garth 'L-H' de Wet", "commy2", "PiZZADOX"};
|
||||
authors[] = {"Garth 'L-H' de Wet", "commy2", "PiZZADOX", "Malbryn"};
|
||||
url = ECSTRING(main,URL);
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: commy2
|
||||
* Author: commy2, Malbryn
|
||||
* Drag an object. Called from ace_dragging_fnc_startDrag
|
||||
*
|
||||
* Arguments:
|
||||
@ -43,18 +43,27 @@ _unit setVariable [QGVAR(isDragging), true, true];
|
||||
_unit setVariable [QGVAR(draggedObject), _target, true];
|
||||
|
||||
// add drop action
|
||||
_unit setVariable [QGVAR(ReleaseActionID), [
|
||||
GVAR(unit) = _unit;
|
||||
|
||||
GVAR(releaseActionID) = [0xF1, [false, false, false], {
|
||||
[GVAR(unit), GVAR(unit) getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject);
|
||||
}, "keydown", "", false, 0] call CBA_fnc_addKeyHandler;
|
||||
|
||||
// show mouse hint
|
||||
["", localize LSTRING(Drop)] call EFUNC(interaction,showMouseHint);
|
||||
|
||||
// block firing
|
||||
if !(GVAR(dragAndFire)) then {
|
||||
_unit setVariable [QGVAR(blockFire), [
|
||||
_unit, "DefaultAction",
|
||||
{!isNull ((_this select 0) getVariable [QGVAR(draggedObject), objNull])},
|
||||
{[_this select 0, (_this select 0) getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject)}
|
||||
] call EFUNC(common,addActionEventHandler)];
|
||||
{true},
|
||||
{}
|
||||
] call EFUNC(common,addActionEventHandler)];
|
||||
};
|
||||
|
||||
// add anim changed EH
|
||||
[_unit, "AnimChanged", FUNC(handleAnimChanged), [_unit]] call CBA_fnc_addBISEventHandler;
|
||||
|
||||
// show mouse hint
|
||||
[localize LSTRING(Drop), ""] call EFUNC(interaction,showMouseHint);
|
||||
|
||||
// check everything
|
||||
[FUNC(dragObjectPFH), 0.5, [_unit, _target, CBA_missionTime]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: commy2
|
||||
* Author: commy2, Malbryn
|
||||
* Drop a dragged object.
|
||||
*
|
||||
* Arguments:
|
||||
@ -20,7 +20,12 @@ params ["_unit", "_target"];
|
||||
TRACE_2("params",_unit,_target);
|
||||
|
||||
// remove drop action
|
||||
[_unit, "DefaultAction", _unit getVariable [QGVAR(ReleaseActionID), -1]] call EFUNC(common,removeActionEventHandler);
|
||||
[QGVAR(releaseActionID), "keydown"] call CBA_fnc_removeKeyHandler;
|
||||
|
||||
// stop blocking
|
||||
if !(GVAR(dragAndFire)) then {
|
||||
[_unit, "DefaultAction", _unit getVariable [QGVAR(blockFire), -1]] call EFUNC(common,removeActionEventHandler);
|
||||
};
|
||||
|
||||
private _inBuilding = [_unit] call FUNC(isObjectOnObject);
|
||||
|
||||
|
@ -21,8 +21,8 @@ TRACE_2("params",_unit,_weapon);
|
||||
|
||||
if (_unit getVariable [QGVAR(isDragging), false]) then {
|
||||
|
||||
// drop dragged object when selecting a non-primary weapon
|
||||
if (_weapon != primaryWeapon _unit) then {
|
||||
// drop dragged object when changing weapon
|
||||
if (_weapon != _unit getVariable [QGVAR(currentWeapon), ""]) then {
|
||||
private _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
|
||||
|
||||
[_unit, _draggedObject] call FUNC(dropObject);
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: commy2, PiZZADOX
|
||||
* Author: commy2, PiZZADOX, Malbryn
|
||||
* Start the dragging process.
|
||||
*
|
||||
* Arguments:
|
||||
@ -28,14 +28,34 @@ if (!GETVAR(_target,GVAR(ignoreWeightDrag),false) && {
|
||||
[localize LSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured);
|
||||
};
|
||||
|
||||
// add a primary weapon if the unit has none.
|
||||
// @todo prevent opening inventory when equipped with a fake weapon
|
||||
if (primaryWeapon _unit isEqualto "") then {
|
||||
// Add a primary weapon if the unit has none
|
||||
if !(GVAR(dragAndFire)) then {
|
||||
if (primaryWeapon _unit isEqualto "") then {
|
||||
_unit addWeapon "ACE_FakePrimaryWeapon";
|
||||
_unit selectWeapon primaryWeapon _unit;
|
||||
} else {
|
||||
_unit selectWeapon primaryWeapon _unit;
|
||||
};
|
||||
} else { // Making sure the unit is holding a primary weapon or handgun
|
||||
if !(currentWeapon _unit in [primaryWeapon _unit, handgunWeapon _unit]) then {
|
||||
if (primaryWeapon _unit != "") then {
|
||||
// Use primary if possible
|
||||
_unit selectWeapon primaryWeapon _unit;
|
||||
} else {
|
||||
if (handgunWeapon _unit != "") then {
|
||||
// Use pistol if unit has no primary
|
||||
_unit selectWeapon handgunWeapon _unit;
|
||||
} else {
|
||||
// Add fake weapon if no weapons besides launcher are available
|
||||
_unit addWeapon "ACE_FakePrimaryWeapon";
|
||||
_unit selectWeapon primaryWeapon _unit;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// select primary, otherwise the drag animation actions don't work.
|
||||
_unit selectWeapon primaryWeapon _unit;
|
||||
// Save the weapon so we can monitor if it changes
|
||||
_unit setVariable [QGVAR(currentWeapon), currentWeapon _unit];
|
||||
|
||||
[_unit, "blockThrow", "ACE_dragging", true] call EFUNC(common,statusEffect_set);
|
||||
|
||||
@ -45,7 +65,13 @@ _unit selectWeapon primaryWeapon _unit;
|
||||
// can't play action that depends on weapon if it was added the same frame
|
||||
if !(_unit call EFUNC(common,isSwimming)) then {
|
||||
[{
|
||||
[_this, "grabDrag"] call EFUNC(common,doGesture);
|
||||
private _unitWeapon = _this getVariable [QGVAR(currentWeapon), ""];
|
||||
|
||||
if (_unitWeapon isKindOf ["Pistol", configFile >> "CfgWeapons"]) then {
|
||||
[_this, "ACE_dragWithPistol"] call EFUNC(common,doGesture);
|
||||
} else {
|
||||
[_this, "ACE_dragWithRifle"] call EFUNC(common,doGesture);
|
||||
};
|
||||
}, _unit] call CBA_fnc_execNextFrame;
|
||||
};
|
||||
|
||||
|
8
addons/dragging/initSettings.sqf
Normal file
8
addons/dragging/initSettings.sqf
Normal file
@ -0,0 +1,8 @@
|
||||
[
|
||||
QGVAR(dragAndFire),
|
||||
"CHECKBOX",
|
||||
[LSTRING(DragAndFire_DisplayName), LSTRING(DragAndFire_Description)],
|
||||
localize LSTRING(SettingsName),
|
||||
true,
|
||||
false
|
||||
] call CBA_fnc_addSetting;
|
@ -16,5 +16,5 @@
|
||||
|
||||
#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 DRAG_ANIMATIONS ["amovpercmstpslowwrfldnon_acinpknlmwlkslowwrfldb_2", "amovpercmstpsraswpstdnon_acinpknlmwlksnonwpstdb_2", "amovpercmstpsnonwnondnon_acinpknlmwlksnonwnondb_2", "acinpknlmstpsraswrfldnon", "acinpknlmstpsnonwpstdnon", "acinpknlmstpsnonwnondnon", "acinpknlmwlksraswrfldb", "acinpknlmwlksnonwnondb", "ace_dragging", "ace_dragging_static", "ace_dragging_drop"]
|
||||
#define CARRY_ANIMATIONS ["acinpercmstpsnonwnondnon", "acinpknlmstpsnonwnondnon_acinpercmrunsnonwnondnon"]
|
||||
|
@ -104,5 +104,26 @@
|
||||
<Polish>Wyżej/niżej | (Ctrl + Kółko myszy) obracanie</Polish>
|
||||
<Turkish>Yükselt/Alçalt | (Ctrl + Tekerlek) Döndür</Turkish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Dragging_SettingsName">
|
||||
<English>ACE Dragging</English>
|
||||
<French>ACE Traînage d'objets et d'unités</French>
|
||||
<German>ACE Ziehen</German>
|
||||
<Hungarian>ACE Húzás</Hungarian>
|
||||
<Russian>ACE Перетаскивание</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Dragging_DragAndFire_DisplayName">
|
||||
<English>Allow firing while dragging</English>
|
||||
<French>Arme utilisable durant le traînage</French>
|
||||
<German>Schießen während des Ziehens erlauben</German>
|
||||
<Hungarian>Húzás közbeni tüzelés engedélyezése</Hungarian>
|
||||
<Russian>Стрельба во время перетаскивания</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Dragging_DragAndFire_Description">
|
||||
<English>Allow the player to fire their gun while dragging.</English>
|
||||
<French>Cette option permet aux joueurs de faire usage de leur arme pendant qu'ils traînent un objet ou une unité.\nL'arme secondaire est utilisée si le joueur en est équipé.</French>
|
||||
<German>Erlaubt dem Spieler während des Ziehens das Abfeuern der Waffe.</German>
|
||||
<Hungarian>Húzás közben a játékos elsütheti a fegyverét.</Hungarian>
|
||||
<Russian>Позволяет игроку стрелять во время перетаскивания</Russian>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
Loading…
Reference in New Issue
Block a user