LTN Combat outpost resupply?
Posted: Wed Mar 08, 2023 12:33 pm
Complex issue, don't bother reading unless you have time 
None of the designs I found on factorioprints, youtube or google quite do what I'm looking for. The closest I found is by Nilaus but it uses vanilla train stops. I would really like to do it with LTN.
I am not worried about the trains to "build the outpost", recycle materials once I deconstruct the outpost to push the biters further out, or turning the artillery on/off depending on supplies availability. I am certain I can figure those out.
The resupply problem:
- Certain resources (like artillery rounds, bots, replacement walls, laser turrets, flamethrower turrets, repair kits, etc) are consumed randomly.
- Besides the initial supply, a small reserve is needed, with a minimum and a maximum level.
- When the reserve drops below a certain level for even one item, a resupply train is called and it tops off all of the items. Individual trains per material might be possible, but it is inefficient and it would cause a lot of unnecessary rail traffic. A single train with all of the resupply materials is best.
- It would be ideal if the train could come out of the Depot empty, load exactly what it needs, deliver it and leave the outpost empty... heading back to the depot. QUESTION: Is this even possible? If yes, how? (keeping in mind that there might be multiple such outposts at one time)
This is the only solution I could think of, but it feels dirty:
- Use a dedicated LTN network ID for combat outpost resupplies.
- The dedicated trains/wagons might use stack assignments to avoid excess quantities of each material.
- Provider loads a train with enough materials to go from zero to maximum level of each resupply material. Provider "material" is something unique, like an artillery wagon, quantity 1, once the train is fully loaded by the use of logic.
- When any material at the outpost goes below the minimum level, logic enables the request for the request "material".
- Filters and logic are used to unload near the exact amount needed to reach the max level of each resource. (probably only one is below the minimum, but the others might have dropped from the max and can use replenishing)
- At inactivity... the train returns to the specific network ID depot. It likely still contains a lot of resources.
- At this point one of two approaches is possible: (A) Recycle the unused materials back to the Provider station. Concern... loading after new request *might* be slow. On the other hand, this would eliminate the need for a special LTN Network ID. (B) Let the train sit with its materials, and it will just get replenished to the right level at the provider when the next request is made.
FINAL QUESTION: Is there a cleaner approach? Or am stuck with solution A or B as described?

None of the designs I found on factorioprints, youtube or google quite do what I'm looking for. The closest I found is by Nilaus but it uses vanilla train stops. I would really like to do it with LTN.
I am not worried about the trains to "build the outpost", recycle materials once I deconstruct the outpost to push the biters further out, or turning the artillery on/off depending on supplies availability. I am certain I can figure those out.
The resupply problem:
- Certain resources (like artillery rounds, bots, replacement walls, laser turrets, flamethrower turrets, repair kits, etc) are consumed randomly.
- Besides the initial supply, a small reserve is needed, with a minimum and a maximum level.
- When the reserve drops below a certain level for even one item, a resupply train is called and it tops off all of the items. Individual trains per material might be possible, but it is inefficient and it would cause a lot of unnecessary rail traffic. A single train with all of the resupply materials is best.
- It would be ideal if the train could come out of the Depot empty, load exactly what it needs, deliver it and leave the outpost empty... heading back to the depot. QUESTION: Is this even possible? If yes, how? (keeping in mind that there might be multiple such outposts at one time)
This is the only solution I could think of, but it feels dirty:
- Use a dedicated LTN network ID for combat outpost resupplies.
- The dedicated trains/wagons might use stack assignments to avoid excess quantities of each material.
- Provider loads a train with enough materials to go from zero to maximum level of each resupply material. Provider "material" is something unique, like an artillery wagon, quantity 1, once the train is fully loaded by the use of logic.
- When any material at the outpost goes below the minimum level, logic enables the request for the request "material".
- Filters and logic are used to unload near the exact amount needed to reach the max level of each resource. (probably only one is below the minimum, but the others might have dropped from the max and can use replenishing)
- At inactivity... the train returns to the specific network ID depot. It likely still contains a lot of resources.
- At this point one of two approaches is possible: (A) Recycle the unused materials back to the Provider station. Concern... loading after new request *might* be slow. On the other hand, this would eliminate the need for a special LTN Network ID. (B) Let the train sit with its materials, and it will just get replenished to the right level at the provider when the next request is made.
FINAL QUESTION: Is there a cleaner approach? Or am stuck with solution A or B as described?