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

Unable to complete trades with allied NPCs if only giving them items from my storage. #52088

Closed
ProfoundDarkness opened this issue Oct 3, 2021 · 3 comments · Fixed by #52261
Labels
NPC / Factions NPCs, AI, Speech, Factions, Ownership (S1 - Need confirmation) Report waiting on confirmation of reproducibility

Comments

@ProfoundDarkness
Copy link
Contributor

ProfoundDarkness commented Oct 3, 2021

Describe the bug

Formerly I could trade with an allied (my faction) NPC and give them an item from my storage (blue color on trade screen), the trade would complete. Now it cannot complete, they show a negative volume on the trade in red. Suggesting that's the reason the trade fails.

Steps To Reproduce

Test_NPC_Trade.zip
Included save is for convenience. It's a new world/game manipulated (with debug and save-scum) to get them to join up.

  1. Load save
  2. (e)xamine NPC
  3. Choose trade option (b).
  4. Try to give the NPC a small item like the matchbook or pocket knife. Must be from storage (should have a blue coloration).
  5. Observe that volume changes to a negative number and that the trade cannot complete.

NOTE: Items worn also fail to trade, that isn't new however.

Expected behavior

That the trade completes, assuming the NPC can carry the item.

Screenshots

No response

Versions and configuration

  • OS: Windows
    • OS Version: -MINGW-/CYGWIN/MSYS2 on unknown Windows version (7)
  • Game Version: 0.F-3142-g88c31dd8a5 [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    No Fungal Growth [no_fungal_growth]
    ]

Additional context

If it weren't for an NPC having an asthma attack I might not have noticed... well they also wouldn't take seeds having nearly empty cargo pants (1 item) but I worked around that without thinking.

While preparing to bisect I observed my test scenario was not specific enough. What used to work is that trades would complete if the item being given was blue, though I was testing with an item my character was wearing. Turns out the distinction is important as having gone back about a month in commits items worn fail to trade. It's blue items that DO work that far back. Something recently causes blue items NOT to trade to NPCs.

Some workarounds for the time being. One of which I've almost never used before so I don't know how it interacts with say telling them to drop items they aren't using...

workaround 1 - Hold onto this for me will you?

  1. Talk to the NPC, choose option d, option d (again)
  2. Select the item you want them to have.
  3. If they have room they'll take it - "Thanks, I'll carry that now."

workaround 2a - Let me put something in your bag for you....

  1. Trade with the NPC, choosing an item with storage they are wearing, ideally currently empty.
  2. use (i)nventory, select the item just gotten from NPC, then (i)nsert.
  3. In the dialog pick any items you want the NPC to have, possibly including the now loose items their clothing already had but now got emptied into your inventory instead of staying in the bag.
  4. Drop the clothing item at their feet
  5. Sort their armor and (e)quip (usually shows stuff at their feet as well as inventory).

Workaround 2b (variation) - take off that bag and hand it over so I can put something in it...
(benefit over 2a, the stuff stored in the bag is kept in the bag rather than merging with your inventory.)

  1. Sort NPC's armor, unequip the storage clothing you want to add something to.
  2. If the NPC had room for the item in their inventory, trade and take it. If not, pick it up off the ground.
  3. Use (i)nventory, select the item just gotten from NPC, then (i)nsert.
  4. Drop the clothing item at their feet.
  5. Sort their armor and equip it for them.

Workaround 3 - Read this book, no wait, let me have the book, you take this thing...

  1. Have the NPC start to read a nice voluminous tome (talk to NPC, option d, option h, option f)
  2. This causes them to pick the item up to start reading.
  3. Interrupt this reading (talk to NPC, option d, option h, option c)
  4. Enter trade (examine, trade), take the book and give them what you want.

Variations on a theme...
If you've got multiple items you want the NPC to use temporarily, stuff them in a bag and have them hang onto the bag. Got a bunch of seeds to plant? stuff them in a plastic bottle and then give them that. I could see this as handy to have items you'd like the NPC to have situationally stashed away somewhere.

There might be more but those are the ones I considered/tried, mostly in reverse order... Also yes I've just recently noticed that NPCs will plant seeds you've placed in a zone marked for seeds even without a faction camp.

@ProfoundDarkness ProfoundDarkness changed the title NPCs always have 0 available volume on starting a trade. Unable to complete trades with allied NPCs if only giving them items from my storage. Oct 4, 2021
@ProfoundDarkness
Copy link
Contributor Author

ProfoundDarkness commented Oct 4, 2021

Whew... stupid mistakes abounded but finally finished my bisect...
2a5baac is the first bad commit
part of "NPC trade - bugfixes and improvements (#51704)"

I haven't tried to find out if this is a problem with non-allied NPCs (ie merchants), I'll test tomorrow.

@ProfoundDarkness
Copy link
Contributor Author

This does also affects non-your faction non-merchant NPCs, you need to not only balance the trade in volume (they start at 0 available) but also in value (as usual).

Just did a quick test (using a magiclysm game) with a merchant and the merchants aren't really affected by this. They open up trades with plenty of volume available.

Technically the current state is a functional improvement in that some items weren't having their volume tracked in trades but the bug was also handy from usability since NPCs haven't been calculating their available volume for trades in a while.

I did stumble on one more handy workaround. With all of those, at least faction NPCs, should be less nuisance than I was expecting when I first noticed things were fixed/broke.

@Maleclypse Maleclypse added (S1 - Need confirmation) Report waiting on confirmation of reproducibility NPC / Factions NPCs, AI, Speech, Factions, Ownership labels Oct 9, 2021
@kevingranade
Copy link
Member

This issue has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/what-am-i-missing-to-get-an-npc-to-butcher-some-corpses/27151/3

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

Successfully merging a pull request may close this issue.

3 participants