Threshold and Stack Threshold
Moderator: Optera
Re: Threshold and Stack Threshold
Ive made a picture to show what i mean. sorry for my paint skills.
Would it possible for LTN to strip the [itemname blablabla] and just show the items like vanilla does?
maybe as an option atleast? ---->
Would it possible for LTN to strip the [itemname blablabla] and just show the items like vanilla does?
maybe as an option atleast? ---->
Re: Threshold and Stack Threshold
Thanks.
So i guess i have to manually write and know the english names of the items instead of picking it from the "image" selector on the right... I always selected the items there.
edit:
youre right that works. As always as complicated as possible.
So i guess i have to manually write and know the english names of the items instead of picking it from the "image" selector on the right... I always selected the items there.
edit:
youre right that works. As always as complicated as possible.
Re: Threshold and Stack Threshold
As always, there's a mod for that: https://mods.factorio.com/mod/Rich_Text_Helper
However i just used a script to replace all item= with img=item/ : viewtopic.php?p=537888#p537888
However i just used a script to replace all item= with img=item/ : viewtopic.php?p=537888#p537888
My Mods: mods.factorio.com
Re: Threshold and Stack Threshold
I can't remember but is there an event when a station gets named that could do that replacement automatically?Optera wrote: βMon Jun 21, 2021 2:01 pm As always, there's a mod for that: https://mods.factorio.com/mod/Rich_Text_Helper
However i just used a script to replace all item= with img=item/ : viewtopic.php?p=537888#p537888
Re: Threshold and Stack Threshold
To work properly a script would have to hook into all build events and on_entity_renamedmrvn wrote: βMon Aug 23, 2021 11:27 pmI can't remember but is there an event when a station gets named that could do that replacement automatically?Optera wrote: βMon Jun 21, 2021 2:01 pm As always, there's a mod for that: https://mods.factorio.com/mod/Rich_Text_Helper
However i just used a script to replace all item= with img=item/ : viewtopic.php?p=537888#p537888
My Mods: mods.factorio.com
Re: Threshold and Stack Threshold
Why build events actually? Building a new station from scratch will never get icons in the name. And when blueprinting the name in the blueprint should already be fixed (ignoring migration issues). I think I will try adding an on_entity_renamed later tonight with your replace script and see how well that works. Anyway, getting off-topic here.Optera wrote: βSat Aug 28, 2021 11:39 amTo work properly a script would have to hook into all build events and on_entity_renamedmrvn wrote: βMon Aug 23, 2021 11:27 pmI can't remember but is there an event when a station gets named that could do that replacement automatically?Optera wrote: βMon Jun 21, 2021 2:01 pm As always, there's a mod for that: https://mods.factorio.com/mod/Rich_Text_Helper
However i just used a script to replace all item= with img=item/ : viewtopic.php?p=537888#p537888
Re: Threshold and Stack Threshold
It will get icons, if you - for example - just copy a station. Station name is copied, if that had icons in its name it will have icons, too.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Threshold and Stack Threshold
Sure. but assuming you always played with the script hooked into on_entity_renamed then the name you copy will already have the icons renamed properly. So on copy you don't have to fix them again. That's all I'm saying.
Re: Threshold and Stack Threshold
Feature request: is it possible to make global mod setting for default stack threshold instead of default item threshold?
Or even better, if the default (stack) theshold could be set to full train capacity, so by default only ever move full trains of cargo, and whoever wherever needs something different can set circuit signals accordingly.
Or even better, if the default (stack) theshold could be set to full train capacity, so by default only ever move full trains of cargo, and whoever wherever needs something different can set circuit signals accordingly.
Re: Threshold and Stack Threshold
What's a full train? You can't decide that from the train stop itself. You could check depots for possible trains but that could change from tick to tick. And then the stop would flicker between active and passive states. Maybe you could take all trains with a depot in the schedule, filter for network_id, min_carriages, max_carriages and then use that. You would have to update that over time but it shouldn't change often.chugin_iv wrote: βFri Nov 05, 2021 10:22 pm Feature request: is it possible to make global mod setting for default stack threshold instead of default item threshold?
Or even better, if the default (stack) theshold could be set to full train capacity, so by default only ever move full trains of cargo, and whoever wherever needs something different can set circuit signals accordingly.
Unless you want it to never use a partial train. For that you could change scripts/dispatcher.lua: getFreeTrains to only return trains where "inventorySize <= size". You would still want a minimum threshold for the smallest train the station allows so the dispatcher doesn't run every tick.
Re: Threshold and Stack Threshold
Why? Train station is designed with specific train composition in mind. If the train station is designed for N cargo wagons then full train = N * 40 stacks or N * 25000 (liters?) for liquid trains.
Yes, that's the idea.
That seems to be backwards. I don't want to run shorter train, especially when my chests are (hopefully) properly balanced - shorter train will either not get filled to the same proportion as longer train (if provider station is not yet ready), or will not get fully unloaded (if consumer station is too full), creating imbalance as the result.
I want the train to be the exact composition the station was designed for, just later, when it can carry a full load.
Re: Threshold and Stack Threshold
But there is no N signal in the train stop. At most you have the min/max train size signal but that includes locomotives. And the train could have 1, 2, 3, 4... locomotives. So how do you determine N?
If your station has min train size == max train size and those trains all have the same number of locomotives then you would get full trains or none at all. Only when min train size < max train size can you get shorter trains and for that you have to design your stations to handle different train sizes. It's a corner case but one that makes your idea hard to implement.chugin_iv wrote: βSat Nov 06, 2021 8:47 amYes, that's the idea.
That seems to be backwards. I don't want to run shorter train, especially when my chests are (hopefully) properly balanced - shorter train will either not get filled to the same proportion as longer train (if provider station is not yet ready), or will not get fully unloaded (if consumer station is too full), creating imbalance as the result.
I want the train to be the exact composition the station was designed for, just later, when it can carry a full load.
Re: Threshold and Stack Threshold
I'd guess most train systems have at most 2 train lengths/compositions: default (long) and short (1 locomotive + 1 wagon). Personal and/or builder trains are possible exceptions, but they are not managed by LTN. I'd suggest global setting "default train wagon count", that automatically determines default stack and liquid thresholds. With possible addition of "default minimum load %" (relative to full train of default length) or "default minimum stack count per cargo wagon" (ditto). If that's inconvenient or conflicts with some different-wagon-capacity mods, my first suggestion of adding "default stack threshold" setting is still valid.mrvn wrote: βSat Nov 06, 2021 11:42 amBut there is no N signal in the train stop. At most you have the min/max train size signal but that includes locomotives. And the train could have 1, 2, 3, 4... locomotives. So how do you determine N?
That check would cause additional work per tick and spam "no trains found" message, wouldn't it?mrvn wrote: βSat Nov 06, 2021 11:42 amIf your station has min train size == max train size and those trains all have the same number of locomotives then you would get full trains or none at all. Only when min train size < max train size can you get shorter trains and for that you have to design your stations to handle different train sizes. It's a corner case but one that makes your idea hard to implement.chugin_iv wrote: βSat Nov 06, 2021 8:47 amYes, that's the idea.
That seems to be backwards. I don't want to run shorter train, especially when my chests are (hopefully) properly balanced - shorter train will either not get filled to the same proportion as longer train (if provider station is not yet ready), or will not get fully unloaded (if consumer station is too full), creating imbalance as the result.
I want the train to be the exact composition the station was designed for, just later, when it can carry a full load.
If it wouldn't, this could be used to add option "minimum train load %". It could use similar check and only return trains where "inventorySize * minimumLoad <= size".
Re: Threshold and Stack Threshold
If it's just a global setting then it's equivalent with the default threshold, just a different unit.chugin_iv wrote: βMon Nov 08, 2021 1:32 pm I'd guess most train systems have at most 2 train lengths/compositions: default (long) and short (1 locomotive + 1 wagon). Personal and/or builder trains are possible exceptions, but they are not managed by LTN. I'd suggest global setting "default train wagon count", that automatically determines default stack and liquid thresholds. With possible addition of "default minimum load %" (relative to full train of default length) or "default minimum stack count per cargo wagon" (ditto). If that's inconvenient or conflicts with some different-wagon-capacity mods, my first suggestion of adding "default stack threshold" setting is still valid.
So is you suggestion to just have a default threshold and default stack threshold in settings?
Re: Threshold and Stack Threshold
Essentially yes. But that different unit is important - if all (or most) of your trains are the same length then you can use it to default to full trains. You can't do that with default threshold 'cause of different stack sizes of different items.mrvn wrote: βMon Nov 08, 2021 3:34 pmIf it's just a global setting then it's equivalent with the default threshold, just a different unit.chugin_iv wrote: βMon Nov 08, 2021 1:32 pm I'd guess most train systems have at most 2 train lengths/compositions: default (long) and short (1 locomotive + 1 wagon). Personal and/or builder trains are possible exceptions, but they are not managed by LTN. I'd suggest global setting "default train wagon count", that automatically determines default stack and liquid thresholds. With possible addition of "default minimum load %" (relative to full train of default length) or "default minimum stack count per cargo wagon" (ditto). If that's inconvenient or conflicts with some different-wagon-capacity mods, my first suggestion of adding "default stack threshold" setting is still valid.
So is you suggestion to just have a default threshold and default stack threshold in settings?
Default threshold then would be used (only) for liquids, so you can't replace the setting, it has to be both.
Re: Threshold and Stack Threshold
There might be one problem with this. Not with having stack and non-stack threshold. But with using this to request/provide goods:
It will provide goods.
If you have a stop and it has more goods than requested, maybe because you send a train there manually to unload left over goods, then it will suddenly provide those goods. I have the request/provide threshold at 1_000_000_000 so this never happens. Because when it does you will have a train stuck at a requester station waiting to get loaded and never leaving. And after the delivery timeout a second train. Then a third. Eventually your factory is shut down with a massive traffic jam.
This might be better suited for the ltn-combinator. It could set default threshold/stack-threshold values for provider or requester when you choose which type the station is going to be.
It will provide goods.
If you have a stop and it has more goods than requested, maybe because you send a train there manually to unload left over goods, then it will suddenly provide those goods. I have the request/provide threshold at 1_000_000_000 so this never happens. Because when it does you will have a train stuck at a requester station waiting to get loaded and never leaving. And after the delivery timeout a second train. Then a third. Eventually your factory is shut down with a massive traffic jam.
This might be better suited for the ltn-combinator. It could set default threshold/stack-threshold values for provider or requester when you choose which type the station is going to be.
Re: Threshold and Stack Threshold
Why yes, that's another problem with LTN - requester stations being able to suddenly be counted as provider stations. TSM has separate Supplier and Requester stations so that never happens. While LTN requires I either always request exactly full containers or rely on hacks like setting threshold to 1_000_000_000. Why is there no clear non-hacky way to tell LTN that this station is a requester and will never provide any goods?mrvn wrote: βSun Nov 14, 2021 3:51 pm There might be one problem with this. Not with having stack and non-stack threshold. But with using this to request/provide goods:
It will provide goods.
If you have a stop and it has more goods than requested, maybe because you send a train there manually to unload left over goods, then it will suddenly provide those goods. I have the request/provide threshold at 1_000_000_000 so this never happens. Because when it does you will have a train stuck at a requester station waiting to get loaded and never leaving. And after the delivery timeout a second train. Then a third. Eventually your factory is shut down with a massive traffic jam.
This might be better suited for the ltn-combinator. It could set default threshold/stack-threshold values for provider or requester when you choose which type the station is going to be.
Re: Threshold and Stack Threshold
LTN is a lot more flexible than TSM, for example one stop may request iron ore AND provide iron plates.chugin_iv wrote: βTue Nov 16, 2021 8:49 pmWhy yes, that's another problem with LTN - requester stations being able to suddenly be counted as provider stations. TSM has separate Supplier and Requester stations so that never happens. While LTN requires I either always request exactly full containers or rely on hacks like setting threshold to 1_000_000_000. Why is there no clear non-hacky way to tell LTN that this station is a requester and will never provide any goods?mrvn wrote: βSun Nov 14, 2021 3:51 pm There might be one problem with this. Not with having stack and non-stack threshold. But with using this to request/provide goods:
It will provide goods.
If you have a stop and it has more goods than requested, maybe because you send a train there manually to unload left over goods, then it will suddenly provide those goods. I have the request/provide threshold at 1_000_000_000 so this never happens. Because when it does you will have a train stuck at a requester station waiting to get loaded and never leaving. And after the delivery timeout a second train. Then a third. Eventually your factory is shut down with a massive traffic jam.
This might be better suited for the ltn-combinator. It could set default threshold/stack-threshold values for provider or requester when you choose which type the station is going to be.
Setting request threshold to 2^31 is the intended way of telling LTN a station is never a provider.
My Mods: mods.factorio.com
Re: Threshold and Stack Threshold
In regards to the OPs request you can't have both a default to 2^31 and to a full train worth of goods. Which of the two you need depends on what type the station is going to be. Hence my suggestion to put this into the ltn-combinator, as it has checkboxes for provider/requester and can then pick the right default.Optera wrote: βWed Nov 17, 2021 7:40 pmLTN is a lot more flexible than TSM, for example one stop may request iron ore AND provide iron plates.chugin_iv wrote: βTue Nov 16, 2021 8:49 pm Why yes, that's another problem with LTN - requester stations being able to suddenly be counted as provider stations. TSM has separate Supplier and Requester stations so that never happens. While LTN requires I either always request exactly full containers or rely on hacks like setting threshold to 1_000_000_000. Why is there no clear non-hacky way to tell LTN that this station is a requester and will never provide any goods?
Setting request threshold to 2^31 is the intended way of telling LTN a station is never a provider.