[0.13] Don't start unloading if wait-condition fulfilled
Posted: Mon Jul 25, 2016 9:32 pm
Hi,
tl;dr - Could locomotives evaluate their wait-condition once just before letting the train start unloading, such that no unloading happens if the wait-condition is fulfilled from the start?
I'd like to build a "generic unload station", supporting unloading copper ore, iron ore, coal, stone, and crude oil barrels, so I can share the unload stations for everything. One problem I have to solve for this is to make trains not unload if I already have too much of a particular resource in the system. For example, if there is back-push on coal, I'd like to make trains not unload. In 0.13 I can send the data from a circuit network to the locomotive and configure a condition there that should make it leave immediately (if I don't want to unload more). The problem is that even if that condition is true from the start, the train always goes through a single "unload cycle" of all inserters. This is obviously a small amount of resources, but it may accumulate over time, until my system gets stuck (unless I build something where I reload it later).
Another solution I was considering was that I could disable the inserters first and only enable them e.g. 1 second after the train arrived, but that means I'd need to detect when a train arrives, something the train station doesn't expose. I could build this in a hacky way by building a gate across the train tracks (using the gate as a "sensor"), but then I'd have to be super careful to never trigger that myself, which seems annoying ..
EDIT: This topic started out as a suggestion, but then in my post below I noticed that it seems to actually be non-deterministic behavior, so this became more of a bug. I also updated the subject of this thread to reflect this slightly better.
tl;dr - Could locomotives evaluate their wait-condition once just before letting the train start unloading, such that no unloading happens if the wait-condition is fulfilled from the start?
I'd like to build a "generic unload station", supporting unloading copper ore, iron ore, coal, stone, and crude oil barrels, so I can share the unload stations for everything. One problem I have to solve for this is to make trains not unload if I already have too much of a particular resource in the system. For example, if there is back-push on coal, I'd like to make trains not unload. In 0.13 I can send the data from a circuit network to the locomotive and configure a condition there that should make it leave immediately (if I don't want to unload more). The problem is that even if that condition is true from the start, the train always goes through a single "unload cycle" of all inserters. This is obviously a small amount of resources, but it may accumulate over time, until my system gets stuck (unless I build something where I reload it later).
Another solution I was considering was that I could disable the inserters first and only enable them e.g. 1 second after the train arrived, but that means I'd need to detect when a train arrives, something the train station doesn't expose. I could build this in a hacky way by building a gate across the train tracks (using the gate as a "sensor"), but then I'd have to be super careful to never trigger that myself, which seems annoying ..
EDIT: This topic started out as a suggestion, but then in my post below I noticed that it seems to actually be non-deterministic behavior, so this became more of a bug. I also updated the subject of this thread to reflect this slightly better.