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

Bug: Pressing Special2 or COM_MenuEnterAll does not activate all items in house if hand is empty #116

Open
fritzw opened this issue Mar 26, 2024 · 6 comments

Comments

@fritzw
Copy link

fritzw commented Mar 26, 2024

When pressing Special2 in the contents menu of a building, I would expect the whole stack of material to be placed in front of the door, maybe keeping one item in hand. Instead, the clonk will take each item in the stack into its hand and then put it back, keeping the last one.

Steps to reproduce:

  1. Select a Clonk
  2. Go into house
  3. Make sure your hand is empty
  4. Buy a stack of wood (more than one)
  5. Go to the "Contents" menu
  6. Move to the wood
  7. Press the Special2 key
  8. Instead of dumping the wood in front of the house, the clonk will take each wood into its hand and then put it back, keeping the last one
  9. Press Special2 again
  10. The remaining wood is put in front of the door as expected
@Danghorx
Copy link

I think there are some reasons why this works this way:

  1. Maybe it is there as a failsafe. When someone has 100 Coal in the hut and wants to sell it but instead goes to contents and presses special 2. Then he doesn't have to load all 100 Coal back into the hut but instead has to press special 2 a second time to confirm this action. This also applies to submarines or other containers that you can enter. Maybe you only want to drop 1 flint instead of 10 but you pressed special 2 instead of throw.

  2. If you have a clonk with more than 1 inventory space like the hydroclonk. You can grab 3 flints of the same type in an instant, instead of pressing throw 3 times. So it is great if you don't want to place all 10 flints that you have in your home on the ground outside. Maybe the homebase is on uneven terrain or above the ground like a submarine and all flints that you eject explode.

So to remember the first press with special 2 when the inventory is empty or not full is: Take everything i can take, but if im full drop the object in the container that it is in until i taken every item that is this type of item.
And the second press is: A new order, that overwrites the first step, to the clonk to eject everything, because he is already full.
These two steps work the same way with throw.

@fritzw
Copy link
Author

fritzw commented Mar 26, 2024

Okay, that makes sense, except that the failsafe will fail if you accidentally press Special2 when your hand is full.

The only part I that feels a bit annoying to me is that the clonk will take the item and put it back multiple times, if you press Special2 when the hand is empty. That takes unnecessary time and makes the menu title flicker, so I'd consider that worth fixing.

@Danghorx
Copy link

Danghorx commented Mar 26, 2024

Hm when i normally settle i put everything into the hut, including my inventory and sell everything that i want so sell. Then i start fresh with buying and then placing everything in front of the hut and put it into a lory.

Yeah it takes an extra press to put everything out of the hut, but most of the time you just spam the key anyway because you have more than one kind of material to move outside.

If you know how it works you develop a habbit of how you have to handle specific things in clonk. There are so much things that can go wrong in clonk, so you think of things to prevent accidents. When you have a sandbox game like clonk with so much posibilities that you can't think of everything.

@maxmitti
Copy link
Member

maxmitti commented Mar 27, 2024

Although I haven’t checked the code, I am fairly certain that it is a bug and not intended behavior.

It’s funny how I am totally used to it and never thought of fixing it until now.

According to my knowledge the behavior is simply due to Clonk’s commands (as also used by C4Script SetCommand and co.).
Many interactions are implemented via these commands.
They can be shown by the Debug Tools (press F1 ingame).

Of course there is also a command to pick up an object from a container. If the command execution leads to the situation that the inventory is full, it lets the Clonk put an object back into the container. This would explain the behavior.
I think the root cause is, that with a non-full inventory pressing Throw or Special2 triggers the “Pick up” command, while with a full-inventory it triggers the “Put in Front of Building” command.

So, in theory it should be enough to extend the “Pick up” command to fall back to putting in front. However we must be careful to not break compatibility.

@maxmitti
Copy link
Member

So, in theory it should be enough to extend the “Pick up” command to fall back to putting in front. However we must be careful to not break compatibility.

I found a different possible solution for the problem.
Instead of just putting all items into inventory that fit, and ejecting the rest, the [Special 2] behavior with non-full inventory could change to only put into inventory what fits and leave the rest.

This variant would allow a useful distinction for behavior between non-full and full inventory, keeping it close to the current broken behavior (keeping the kind of failsafe), while also fixing the confusing useless behavior.

I think I prefer this variant over always ejecting what doesn’t fit.

Optionally, it might be possible to map a second [Special 2] press while putting items into inventory to change to the “eject the rest” behavior, to also allow to quickly eject everything, without having to wait for the inventory to fill up.

@fritzw
Copy link
Author

fritzw commented Mar 30, 2024 via email

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

No branches or pull requests

3 participants