Crafters won't put finished items directly into crates

Started up a new game, crafted some crates. Placed those crates and removed the stockpile I had so everything would be put into crates.

Sometime later I observed that my carpenter was just throwing his goods on the ground around his workshop after he made them. I can only assume he does not see a crate as a valid stockpile target.


what is your version number.

I’m on develop-2513. Always on the very newest.

It sounded like a bug that was changed in the last version of the game to me, but I guess you have the most recent one, so it is likely a new bug.

No. Someone complained about this before. The crafter might be doing priorities.

@sdee, is this AI related or really a bug with the crates?

I think it’s a bug with the way crafters search for an available stockpile to put their stuff into after they have crafted.

Crafters use the AI Pack crafting_AI_pack.json. The actions it has for dropping stuff are:


drop_item_near_workshop is what they do when no stockpile is available. move_item_to_available_stockpile is what they do when they can find a stockpile. So wait_for_closest_stockpile_space is the important action here. This is defined in ai/actions/wait_for_closest_stockpile_space.luac.

In that file, they define stockpile in this fashion:

local stockpile_component=stockpile_entity:get_component('stonehearth:stockpile')

So it’s only looking for components of type stonehearth:stockpile. If you use the Debug Tools mod to examine an actual stockpile object on the ground, you will see it has that component. If you examine a crate/container, it does not have that component.

Therefore, the crafter AI for putting a finished item into storage cannot consider a crate to be a valid stockpile for placing an item.

Edit: The code for regular stockpile filling uses ai/actions/wait_for_storage_space.lua. that file looks for the stonehearth:storage component, which is on both containers and stockpiles.

1 Like

Nice sleuthing!
Paging @not_owen_wilson , since he implemented the crates… Maybe the bug should be fixed by another dev, but we’ll let him know anyway.

Thanks! :smile:

1 Like

Yeah, I’ve run into this too.

This bug is still present in develop-2521.


This bug is still present in Develop-2534.

I noticed the carpenter was preferring to drop crafted items in the general stockpile which was further away than the crates I had placed for him. I then removed the stockpile and watched the carpenter drop items on the ground near the crafting table.


in develop 2534 or R 447?

1 Like

Sorry, R 447 was what I was playing!