Picklocks Inserter


This mod prevents Inserters to get stuck holding Items.

Utilities
a month ago
0.17 - 1.1
1.28K

g Please kindly enable returning items to locked cargo wagons. (or tell me where to send pull requests)

1 year, 6 months ago

Right now the game will refuse to unlock cargo wagon slots or delete items that have been removed from cargo wagons, I can see the later being dangerous, but the former behavior is a bit baffling.

I made a local change to move cargo wagons into the same match arm as chests and it doesn't seem to have any ill effects as far as I can tell, if there is something here then maybe a setting which changes which arm wagons are considered to be a part of would be appropriate?

This is especially relevant If you are experimenting with the filtered cargo wagon mall you will have have a lot of high parallel capacity cargo wagon -> cargo wagon inserters with locked slots, this obviously is a perfect storm of circumstances to get stuck inserters, previously I was managing this with recursive blueprints+ deleting and re-placing the inserters, but obviously your mod appears to be a much nicer solution.

I am happy to make the changes myself if you are willing to take PRs and can point me to a git repo.

1 year, 6 months ago
(updated 1 year, 6 months ago)

Screenshots of the wagon mall, the wagons receiving items correctly after local edits to the mod, the relevant bits of code pre-modification.
https://imgur.com/a/S8lQYEm

1 year, 6 months ago

Hi Djehngo!

Thank you for your message.

I hope I understand you correctly. You want to cleanup inserters that remove items from cargo wagons and get stuck.

If you want to use the option Clean up inserters at train stops then it will not work. The cleaning process will start only after the train left the train station. So the target to put items back is no longer reachable.

But you can mark the inserters for the cleanup planner and enable the option to delete items.

In my mod the cleanup is done in the function PI_PutStackBack.

I hope I was able to help you

1 year, 6 months ago

Ah, now you explain it I understand why the case is unusual, It's more having an inserter removing an item from a cargo wagon and putting it elsewhere when the cargo wagon isn't going to move in the immediate future, if you do decide to implement this or accept a pull request it should definitely be a setting I guess.

If you look at the screenshots it shows the relevant code, the sitation involved and the mod's behavior after being edited.

1 year, 6 months ago

I was already thinking about adding cargo wagons to the cleanup targets after your first message. I will integrate this into the next update of my mod.

New response