Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPCs inappropriately drop weapon to wield another, weaker weapon. #79050

Open
terribleperson opened this issue Jan 10, 2025 · 2 comments
Open
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility

Comments

@terribleperson
Copy link
Contributor

Describe the bug

An NPC equipped with a strong weapon (e.g. tempered steel battle axe) and a bayonet (e.g. USMC bayonet) in a sheath may occasionally drop their main weapon to wield the bayonet when they choose to attack.

Attach save file

N/A

Steps to reproduce

This bug is difficult to reproduce in a 100% reliable manner, owing to the complexity of NPCs.

  1. Have a party of NPCs, armed with good weapons that rate higher than a bayonet (most tempered weapons, e.g. tempered battle axes, will suffice).
  2. Equip the NPCs with USMC bayonets in sheaths.
  3. Clear a small town with your party.
  4. Observe that your NPCs sometimes drop their weapons to wield a bayonet when they see an enemy.

Expected behavior

I expect that NPCs will not drop their weapons for weapons that are worse, especially not if they're drastically worse and the NPCs themselves evaluate them as being worse. They'll accept a tempered battle axe to wield over a bayonet, and their own rating of the axe seen with debug mode is drastically higher than their rating of the bayonet.

Screenshots

image
image2
image3

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.22631.4602 (23H2)
  • Game Version: 92f70f2 [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Portal Storms Ignore NPCs [personal_portal_storms],
    Slowdown Fungal Growth [no_fungal_growth],
    Bionic Professions [package_bionic_professions]
    ]

Additional context

I believe this is related to the NPC_THROWN/NPC_ALT_ATTACK flags. I can't say for sure, because this is a guess, not based on the code.
I believe that they're choosing the attack action, then (not sure why, possibly because they're at range from their target?) decide to wield the combat knife to throw it. In the process, they drop the weapon they're wielding (they don't seem to reliably store it, even if they have a scabbard/sheath/axe ring holster).
However, removing NPC_THROWN from the USMC made this issue stop happening for me, and giving them F-S fighting knives instead of bayonets works as well.
I believe the short-term solution might be to prevent the NPC from considering other attacks if they're current wielding their highest-rated weapon. Ideally, they would holster weapons to perform alt attacks and would only consider alt attacks if they're able to holster their weapon.

@terribleperson terribleperson added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Jan 10, 2025
@RenechCDDA
Copy link
Member

RenechCDDA commented Jan 10, 2025

Please provide a save file for this issue. This is not trivially reproducible.

@terribleperson
Copy link
Contributor Author

It's not trivially reproducible with a save file, either, nor is the save particularly useful, but I will see what I can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility
Projects
None yet
Development

No branches or pull requests

2 participants