Arsenal - Fix animations not playing properly (#9705)

* Make arsenal animations play properly

* Update addons/arsenal/functions/fnc_showItem.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Moved to common

* Update CfgMoves.hpp

* move to function, add reload safeguard

* selectWeapon immediately

* open left panel on current weapon

* VR mission poses + fix removing vests

* cAsInG

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
Co-authored-by: LinkIsGrim <salluci.lovi@gmail.com>
This commit is contained in:
johnb432 2024-01-01 23:22:53 +01:00 committed by GitHub
parent aedb5169d3
commit 0f08ba2fdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 70 additions and 14 deletions

View File

@ -51,13 +51,6 @@ if (is3DEN) then {
["ShowInterface", true] call BIS_fnc_3DENInterface;
GVAR(visionMode) call BIS_fnc_3DENVisionMode;
} else {
// Select correct weapon
switch (GVAR(selectedWeaponType)) do {
case 0: {GVAR(center) selectWeapon (primaryWeapon GVAR(center))};
case 1: {GVAR(center) selectWeapon (secondaryWeapon GVAR(center))};
case 2: {GVAR(center) selectWeapon (handgunWeapon GVAR(center))};
};
if (!isNull curatorCamera && {ACE_player == player}) then {
curatorCamera cameraEffect ["Internal", "BACK"];
} else {

View File

@ -243,7 +243,15 @@ GVAR(refreshing) = false;
_panel ctrlCommit 0;
} forEach [IDC_leftTabContent, IDC_rightTabContent, IDC_rightTabContentListnBox];
[_display, _display displayCtrl IDC_buttonPrimaryWeapon] call FUNC(fillLeftPanel);
// Open left panel for current weapon, do some math
GVAR(selectedWeaponType) = [primaryWeapon GVAR(center), secondaryWeapon GVAR(center), handgunWeapon GVAR(center), binocular GVAR(center)] find (currentWeapon GVAR(center));
if (GVAR(selectedWeaponType) == -1) then {
GVAR(selectedWeaponType) = 0; // default to primary
};
private _leftPanelIDC = [IDC_buttonPrimaryWeapon, IDC_buttonSecondaryWeapon, IDC_buttonHandgun, IDC_buttonBinoculars] select GVAR(selectedWeaponType);
[_display, _display displayCtrl _leftPanelIDC] call FUNC(fillLeftPanel);
//--------------- Init camera
if (isNil QGVAR(cameraPosition)) then {

View File

@ -15,6 +15,10 @@
if (GVAR(centerNotPlayer)) exitWith {};
if (EGVAR(common,isReloading)) exitWith { // if player is reloading then wait until it's done so we don't send magazines to the shadow realm
[{!EGVAR(common,isReloading)}, FUNC(showItem)] call CBA_fnc_waitUntilAndExecute;
};
// Determine action to play based on current category selection
private _nextAction = switch (GVAR(currentLeftPanel)) do {
// Primary weapon
@ -54,10 +58,12 @@ if (_nextAction != GVAR(currentAction)) then {
case "PrimaryWeapon": {0};
case "SecondaryWeapon": {1};
case "HandGunOn": {2};
case "Binoculars": {3};
default {GVAR(selectedWeaponType)};
};
if (simulationEnabled GVAR(center)) then {
GVAR(center) call EFUNC(common,stopGesture); // reset gesture state (if arsenal is opened on animation transition, animations played whilst in the arsenal break)
GVAR(center) playActionNow _nextAction;
} else {
GVAR(center) switchAction _nextAction;
@ -65,3 +71,7 @@ if (_nextAction != GVAR(currentAction)) then {
GVAR(currentAction) = _nextAction;
};
if (!(GVAR(currentAction) in ["Civil", "Salute"])) then {
GVAR(center) selectWeapon ([primaryWeapon GVAR(center), secondaryWeapon GVAR(center), handgunWeapon GVAR(center), binocular GVAR(center)] select GVAR(selectedWeaponType)); // select correct weapon, prevents floating weapons
};

View File

@ -10,13 +10,15 @@ cba_diagnostic_projectileMaxLines = 10;
// Player pose
[{
switch (true) do {
case (primaryWeapon _this != ""): {
switch (currentWeapon _this) do {
case (primaryWeapon _this): {
_this switchMove "amovpercmstpslowwrfldnon";
};
case (handgunWeapon _this != ""): {
case (handgunWeapon _this): {
_this switchMove "amovpercmstpslowwpstdnon";
};
case (binocular _this);
case (secondaryWeapon _this): {}; // deliberately nothing
default {
_this switchMove "amovpercmstpsnonwnondnon";
};
@ -88,6 +90,7 @@ cba_diagnostic_projectileMaxLines = 10;
{
_unit = _x;
removeVest _unit;
if (vest _player != "") then { _unit addVest vest _player; };
removeBackpack _unit;

View File

@ -0,0 +1,14 @@
// From ACRE
class CfgGesturesMale {
skeletonName = "OFP2_ManSkeleton";
class States {
class GestureNod;
class GVAR(stop): GestureNod {
file = "a3\anims_f\data\anim\sdr\gst\gestureEmpty.rtm";
disableWeapons = 0;
disableWeaponsLong = 0;
enableOptics = 1;
mask = "empty";
};
};
};

View File

@ -1,9 +1,15 @@
class CfgMovesBasic {
class Default;
// From ACRE
class ManActions {
GVAR(stop) = QGVAR(stop);
};
class Actions {
class NoActions: ManActions {
GVAR(stop)[] = {QGVAR(stop), "Gesture"};
};
// fixes grab animation with equipped pistol
class NoActions;
class PistolStandActions: NoActions {
grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2";
};

View File

@ -181,6 +181,7 @@ PREP(statusEffect_resetVariables);
PREP(statusEffect_respawnEH);
PREP(statusEffect_sendEffects);
PREP(statusEffect_set);
PREP(stopGesture);
PREP(stringCompare);
PREP(stringToColoredText);
PREP(swayLoop);

View File

@ -4,7 +4,7 @@ class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {"ACE_Box_Misc", "ACE_bananaItem", "ACE_Flag_Black", "ACE_Flag_White"};
weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon", "ACE_Banana"};
weapons[] = {"ACE_ItemCore", "ACE_FakePrimaryWeapon", "ACE_Banana"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_main","ace_modules"};
author = CSTRING(ACETeam);
@ -17,6 +17,7 @@ class CfgPatches {
#include "CfgEden.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgLocationTypes.hpp"
#include "CfgGesturesMale.hpp"
#include "CfgMagazines.hpp"
#include "CfgMoves.hpp"
#include "CfgSounds.hpp"

View File

@ -0,0 +1,20 @@
#include "..\script_component.hpp"
/*
* Author: ACRE2Team
* Stops a unit's gesture.
*
* Arguments:
* 0: Target <OBJECT>
*
* Return Value:
* None
*
* Example:
* [bob] call ace_common_fnc_stopGesture
*
* Public: Yes
*/
params ["_unit"];
[QGVAR(playActionNow), [_unit, QGVAR(stop)], _unit] call CBA_fnc_targetEvent