Skip to content

NPCs wear their armor: chest, helm, boots, gauntlets; plate on the armored body - #47

Merged
codingncaffeine merged 2 commits into
codingncaffeine:mainfrom
qwerin:fix/npc-armor
Nov 9, 2026
Merged

codingncaffeine merged 2 commits into
codingncaffeine:mainfrom
qwerin:fix/npc-armor

Conversation

@qwerin

@qwerin qwerin commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Split out of #36 (one fix per PR, as suggested there).

ResolveNpcEquippedGear only handled es_weapon_hand / es_shield_hand, so a guard's [inventory][equipment] chest, helm, boots and gauntlets never showed and Legionnaire guards looked like townsfolk.

  • NPC slots (template merged with the map instance) now go through the same EquipmentResolver.Resolve as the hero: chest armor swaps body texture slot 1, helm/boots/gauntlets are shared skinned layers posed with the body's clip.
  • As in DS1, the chest item's armor_type also picks the body mesh: plate (a3) spawns on m_c_gah_fb_pos_a3 with b_c_pos_a3_*, instead of drawing the plate texture on the thin pos_a1 body where it reads as a shirt. The hero keeps his live texture swap.
  • Companions refresh their armor visuals when their paperdoll changes.
  • The armor layers draw before the ghost pass resets its blend state, so a ghost's armor is see-through too.

Checks: rebased on main (bef1f38); dotnet build SiegeFX.sln -c Release -warnaserror clean; dotnet test passes (new NpcArmorTests, data-free). Play-tested on multiplayer_world Elddim: the guards wear full plate.

🤖 Generated with Claude Code

qwerin and others added 2 commits November 8, 2026 19:37
NPCs only ever resolved es_weapon_hand/es_shield_hand; es_chest, es_head,
es_feet and es_forearms were ignored, so Elddim's Legionnaire guards (whose
[aspect][textures] authors just the skin) drew in the bare citizen body.
Feed the template + instance [inventory][equipment] slots through the
player's EquipmentResolver: chest armor swaps body slot 1 to b_c_pos_*,
helm/boots/gauntlets draw as shared skinned layers posed with the body's
clip. Companion paperdoll swaps refresh the armor too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 805ae51984439dfc24f72f6586eab95872f65fd6)
The first pass drew helm/boot/gauntlet layers and swapped body slot 1 to
b_c_pos_a1_<style>, but the chest texture was drawn on the template's thin
pos_a1 body, where Legionnaire plate (armor_type a3) reads as a plain
shirt - the guards still looked like townsfolk. DS1 picks the body mesh
from the chest item's armor_type: plate is drawn on m_c_gah_fb_pos_a3
with b_c_pos_a3_<style>.

ActorSpawner now spawns plain (non-hero) actors on the armored body when
their worn es_chest names another aN body type and that mesh ships;
the chest texture and boot/gauntlet subtypes resolve against the body
actually drawn. The hero spawn opts out (his armor stays a live texture
swap on the picked body).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 8a064a49bb0bfb15cd1a18b9be24f71fab02f53b)
@codingncaffeine
codingncaffeine merged commit 19604fb into codingncaffeine:main Nov 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants