Merging Chests

by Atria

Enables merging of multiple chests into one entity. Supports merging of arbitrary number of chests (configurable in mod settings). Version 5.0.0 introduced potentially breaking changes for old saves. If your have chests larger than 42 don't update to 5.0.0.

Content
a month ago
0.13 - 1.1
99.7K
Storage

g Use of the shortcut

5 years ago

Hi,
Using this mod for a long time in 0.16, now moving to 0.17.
Maybe caused by my inexperience with shortcuts, I cannot get it to work.

What I see : I can add the "merging tool" shortcut in the bar but it appears dimmed.
When I left click on the shortcut, I do not get the tool in my hand. -> cannot use it.

I have reset the "only show as shortcut" option. The I can access the tool from the blueprint area but still cannot get a version in the shortcut area for quick access.

What would be the right way to use ?

5 years ago

When you select the merging tool to shortcuts it will not cover entire area, that is normal. But when you click the icon you should get an merging tool into your hand. Are you playing sandbox (without player on the map)?

If you unset "Only show as shortcut" the mod will revert into 0.16 behaviour, with merging tool in blueprint library.

5 years ago

I am indeed playing without a player on the map.
Have got it working with "Only show as shortcut" reset (not on).

When "Only show as shortcut" is set, I do not get the tool i my hand when clicking on the shortcut.

5 years ago

Hmm, I thought being in sandbox could potentially break something, but it works for me even on sandbox maps. Would you be able to replace a shortcut handler in the mod code? If yes, replace entire MergingChests.OnShortCut handler in control.lua with following code and let me know what does it print when you click the shortcut:

function MergingChests.OnShortCut(event)
    if event.prototype_name == "merge-chest-selector" then
        local player = game.players[event.player_index]
        if player.clean_cursor() then
            local stack = player.cursor_stack
            if player.cursor_stack then
                if  stack.can_set_stack({ name = "merge-chest-selector" }) then
                    stack.set_stack({ name = "merge-chest-selector" })
                else
                    player.print("Couldn't insert tool item")
                end
            else
                player.print("Couldn't retrieve cursor stack")
            end
        else
            player.print("Couldn't clear the cursor")
        end
    else
        game.players[event.player_index].print("Different tool: "..event.prototype_name)
    end
end
5 years ago
(updated 5 years ago)

I updated the control.lua with the code above.
Result is that I get no printout when left clicking the shortcut, the event is not triggered.

I do see that the shortcut icon shows dimmed. Is there an option to enable/disable/activate a shortcut ?
I do have experience in mod creation, can do more tests if you point me into a direction to search.

Still not sure whether it is just my misunderstanding of shortcut usage.
When I place the merging tool in the "right part" shortcut area (where default the cut/paste/alt are). I can use the merge tool as expected.

5 years ago

Oh, the tools is greyed out when you have no free space for shortcuts. To be able to use the shortcut you first have to remove other shortcut from the bar by unchecking it.

5 years ago

I do have enough space in the shortcut bar and can add the tool to it. (left click an empty location, find the tool under production and left click that)
But when the tool is added, it dims in the quickbar location.

5 years ago

I can't seem to reproduce this behaviour. When I start new sandbox game and unlock all tech all shortcuts are selected. I have to manually deselect some other shortcut in order to have Merging tool selected and visible in shortcut bar.

You can click the merging tool shortcut at two places (terminology: shortcut list = list of shortcuts with checkboxes of selected shortcuts; shortcut bar = bar of selected shortcuts):
- If merging tool shortcut is not selected, you can click directly on in in shortcut list (left of checkbox). The shortcut is not visible in shortcut bar at all.
- If merging tool shortcut is selected you can only click on actual shortcut on shortcut bar. You can't directly click on shortcut left of checkbox in shortcut list.

Both of these work when I try them on my client. If it still doesn't work then I'd suggest trying start new map to see if it works there (if you are playing on older map). Turn off all other mods temporarily (if there are any). Try it in singleplayer/locally (if you are playing on dedicated server).

5 years ago

OK, Thanks for the detailed answer above. My issue is indeed the way I thought it would work.

I had included the shortcut in the "quickbar", as you can also select it there.
But having it there shows he behavior as I described -> in the quickbar but not usable.
Having it in the shortcut bar/list works.

Don't know if you can prevent to have the tool selectable for quickbar but if it can, probably better to do that.

Thanks for helping. sorry to bother you with "non widechest" issue.

New response