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

Ask to wield container if parent container is too small to insert items #79518

Merged

Conversation

marilynias
Copy link
Contributor

@marilynias marilynias commented Feb 3, 2025

Summary

Features "Ask to wield container if parent container is too small to insert items"

Purpose of change

It is quite annoying to try to insert items into a non-rigid container in your pocket, but it only inserts one because your pocket is too small. It would be handy to be able to wield the container first and then insert the items.

Describe the solution

In the insert activity actor, if the container could hold more items, but the parent cannot, query if you would like to wield the container first, then continue inserting.

Demo:

2025-02-04.08-34-42.mp4

Describe alternatives you've considered

Testing

searched where insert_item_activity_actor and unload_activity_actor is used and use those actions. They behaved as expected or never use that part of the code (check for space before inserting).

Additional context

Currently only works if the items would partially fit. To query if a single item is too large would require a bigger re-write.
Actions that use insert activity actor and are therefore have this feature:
AIM [u]nload
[I]nsert
Pour into container
AIM move stack/all
etc...

Actions that check for free space before inserting are not affected.

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Feb 3, 2025
Copy link
Contributor

@moxian moxian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change.

The demo in the OP does not actually demo the change (there is no y/n prompt featured anywhere, you are already wielding the garbage bag at the start).

The only thing i'm concerned about (i didn't read too much into the code) is that we might get spammed with the "do you want to wield it?" prompts when doing regular looting (i.e. not deliberate i>i insertion).
Can you please check if that happens? I.e. give high priority to a garbage bag, put it into a small-ish pocket (which might also need a >0 priority? i forget), and try grabbing (via g or perhaps AIM) a bunch of small items. The expectation is that they'd go to this new container first, but as it expands to the volume of the parent, new items would silently be inserted elsewhere and not prompt the player needlessly.

src/activity_actor.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 3, 2025
@marilynias
Copy link
Contributor Author

marilynias commented Feb 4, 2025

The demo in the OP does not actually demo the change (there is no y/n prompt featured anywhere, you are already wielding the garbage bag at the start).

oops, I've uploaded the wrong file :)
Updated.

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 4, 2025
@marilynias
Copy link
Contributor Author

marilynias commented Feb 4, 2025

The only thing i'm concerned about (i didn't read too much into the code) is that we might get spammed with the "do you want to wield it?" prompts when doing regular looting (i.e. not deliberate i>i insertion). Can you please check if that happens? I.e. give high priority to a garbage bag, put it into a small-ish pocket (which might also need a >0 priority? i forget), and try grabbing (via g or perhaps AIM) a bunch of small items. The expectation is that they'd go to this new container first, but as it expands to the volume of the parent, new items would silently be inserted elsewhere and not prompt the player needlessly.

tested, it puts as many items in the garbage bag, then other containers, without asking to wield.
They use the pickup_activity_actor instead of insert_item_activity_actor,.

@moxian
Copy link
Contributor

moxian commented Feb 4, 2025

Sorry for making bogus code suggestion. I assumed item::tname(123) would have 123 in the returned string (and I didn't check), but it evidently doesn't, as seen in your demo
20250204-012932-firefox

Please adjust as appropriate (via %i, as you did originally), and thank you!

@marilynias
Copy link
Contributor Author

marilynias commented Feb 4, 2025

Sorry for making bogus code suggestion. I assumed item::tname(123) would have 123 in the returned string (and I didn't check), but it evidently doesn't,

good catch, updated, updated (165bc68):
image

item::tname(123) seems to just use the plural version of the name

grammar question: Should there be a comma in Would you like to wield %s first, to fit more?? I believe so.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 4, 2025
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Feb 4, 2025
@ashGlaw
Copy link
Contributor

ashGlaw commented Feb 4, 2025

This is a big improvement! Thank you for implementing it

@Maleclypse Maleclypse merged commit 8796836 into CleverRaven:master Feb 5, 2025
28 checks passed
@Brambor Brambor added Info / User Interface Game - player communication, menus, etc. Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants