diff --git a/CHANGELOG.md b/CHANGELOG.md index e18045aeb5..af4b211ecc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,7 @@ Bug #8680: Dead ancestor ghosts stop being dust when you rest near them Bug #8686: openmw-cs: Crash when smoothing terrain of a not-yet-created cell. Bug #8710: Absorb Skill breaks on creatures + Bug #8734: Shield sheathing does not work properly Feature #2522: Support quick item transfer Feature #3740: Gamepad GUI Mode Feature #3769: Allow GetSpellEffects on enchantments diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index bd84776c00..cc424b2bc4 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -1072,23 +1072,17 @@ namespace MWMechanics std::string_view action = evt.substr(groupname.size() + 2); if (action == "equip attach") { - if (mUpperBodyState == UpperBodyState::Equipping) - { - if (groupname == "shield") - mAnimation->showCarriedLeft(true); - else - mAnimation->showWeapons(true); - } + if (groupname == "shield") + mAnimation->showCarriedLeft(true); + else if (mUpperBodyState == UpperBodyState::Equipping) + mAnimation->showWeapons(true); } else if (action == "unequip detach") { - if (mUpperBodyState == UpperBodyState::Unequipping) - { - if (groupname == "shield") - mAnimation->showCarriedLeft(false); - else - mAnimation->showWeapons(false); - } + if (groupname == "shield") + mAnimation->showCarriedLeft(false); + else if (mUpperBodyState == UpperBodyState::Unequipping) + mAnimation->showWeapons(false); } else if (action == "chop hit" || action == "slash hit" || action == "thrust hit" || action == "hit") { @@ -1392,7 +1386,7 @@ namespace MWMechanics // We can not play un-equip animation if weapon changed since last update if (!weaponChanged) { - // Note: we do not disable unequipping animation automatically to avoid body desync + // Note: we do not disable the weapon unequipping animation automatically to avoid body desync weapgroup = getWeaponAnimation(mWeaponType); int unequipMask = MWRender::BlendMask_All; mUpperBodyState = UpperBodyState::Unequipping; @@ -1401,6 +1395,7 @@ namespace MWMechanics && !(mWeaponType == ESM::Weapon::None && weaptype == ESM::Weapon::Spell)) { unequipMask = unequipMask | ~MWRender::BlendMask_LeftArm; + mAnimation->disable("shield"); playBlendedAnimation("shield", Priority_Block, MWRender::BlendMask_LeftArm, true, 1.0f, "unequip start", "unequip stop", 0.0f, 0); } @@ -1458,6 +1453,7 @@ namespace MWMechanics if (useShieldAnims && weaptype != ESM::Weapon::Spell) { equipMask = equipMask | ~MWRender::BlendMask_LeftArm; + mAnimation->disable("shield"); playBlendedAnimation("shield", Priority_Block, MWRender::BlendMask_LeftArm, true, 1.0f, "equip start", "equip stop", 0.0f, 0); } diff --git a/docs/source/reference/modding/extended.rst b/docs/source/reference/modding/extended.rst index 8b5c30fdd0..3746a9db70 100644 --- a/docs/source/reference/modding/extended.rst +++ b/docs/source/reference/modding/extended.rst @@ -165,6 +165,7 @@ The minimum you need is the ``xbase_anim_sh.nif`` file from the `Weapon Sheathin [Game] weapon sheathing = true + use additional anim sources = true The ``xbase_anim_sh.nif`` contains default placement points for different weapon types. That way you'll get Gothic-style weapon sheathing for all biped actors (without quivers and scabbards). @@ -204,6 +205,28 @@ It is important to make sure the names of empty nodes start with ``"Bip01 "``, o An example of a mod which uses this feature is `Weapon Sheathing`_. +Shield sheathing support +------------------------ + +The minimum you need is the ``xbase_anim_sh.nif`` file from the `Weapon Sheathing`_ mod and this line in your settings.cfg: + +.. code-block:: ini + :caption: settings.cfg + + [Game] + shield sheathing = true + use additional anim sources = true + +The ``xbase_anim_sh.nif`` contains default placement points for shields (a ``"Bip01 AttachShield"`` node). +You also may use meshes with ``_sh`` suffix (with ``Bip01 Sheath`` node) to tweak how particular shield looks in the sheathed mode. A stub sheath means that the shield should be excluded from this feature. +When a two-handed weapon is equipped, a shield is hidden when this feature is enabled. +This feature also supports shield equipping and unequipping animations. It is a ``Shield`` group (with ``Equip Start``, ``Equip Attach``, ``Equip Stop``, ``Unequip Start``, ``Unequip Attach`` and ``Unequip Stop`` keys). +Note that equip and unequip animation blocks should not overlap each other and weapon equip/unequip animations. +Basically, you need to avoid situations when you play an animation block where you need both to attach and detach the shield. + +An example of a mod which uses this feature is `Weapon Sheathing`_. + + Skeleton extensions -------------------