mspielberg / factorio-railloader

Rapidly load and unload trains of bulk materials.
GNU Lesser General Public License v3.0
9 stars 19 forks source link

change: put back mode of inserters #46

Closed hahoyer closed 1 year ago

hahoyer commented 1 year ago

The new LTN-like mod Cybersyn (https://mods.factorio.com/mod/cybersyn) has a nifty wagon inventory filter mode. This is especially cool when you need to haul away "dirty" ores - ores that are made of different substances, such as in mixed patches or in the Hardcrafting (https://mods.factorio.com/mod/hardCrafting) mod. The Railloader would be a key element in this interaction. However, this does not work because of known problems: When one kind of material has been picked up, there are still leftovers in the hands of the inserters. The next time they are then unusable, because very likely another resource will be picked up.

This patch should fix the problem as much as possible. The idea is that the inserters, who shovel from the loader into the train, are simply turned around after their work is done. Now they put everything they have in their hands back into the loader chest (which of course has to have room for it, hence "as much as possible"). With the next train coming in, they are turned back to normal. For this I set the inserter prototype to "allow_custom_vectors". The logic for bending the inserters back and forth was built in minimally invasive and may not be 100% performant. I've also left out configurability for now, but if you want it, I'll add it in (I don't really need it. I see no reason not to have that feature ;-) ).

mspielberg commented 1 year ago

By concept, BRLs do not use "shovels." They are gravity feed devices, and the use of inserters is merely an implementation detail. The player needs to use separate BRLs for each resource, sorting at either the loading or unloading point to prevent clogging. I will not be adding any smarts to the BRL.