old LTN discussion thread

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by Optera »

exofact wrote:I just installed 0.4.5 and am getting this error on loading my save:

"Error while running the on_init: __LogisticTrainNetwork__/control.lua:32: attempt to concatenate field '?' (a nil value)"

I am running Factorio 0.14.21.

Is there any easy way to get an export of what mods are installed?
Yes, attach the log file, all loaded mods and version are listed there.
Maglay
Inserter
Inserter
Posts: 30
Joined: Tue Dec 06, 2016 7:52 am
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by Maglay »

Greetings, first of all awesome mod :)

I have also a problem with provider stations when I use short L-CC-L trains and long L-CCCC-L trains at the same time:
I have a mine for ore with a provider station for L-CCCC-L trains, each wagon has 6 inserters - chest - inserter combos, the incoming ore is split by 4 so each wagon has the same amount of ore available. All chests are connected to the input lamp. The ore goes to my forge with a L-CCCC-L station as input and a L-CC-L station as output. Now it can happen that the L-CC-L train is used to pick up the ore when no other long train is available, even if I set the min_delivery_size greater than the cargo of two wagons. I also set best_effort to false. The problem is that the two inserter groups after the train stop get used more often than the other two. When the ore is depleted the short train gets stuck at some point in the future because it wants to pick up the ore which is in the wrong chests.

Is there an easy solution or do I need to rebuild the provider station so that all wagons are loaded directly from a belt to ensure that at any time all wagons have some ore available?
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by Optera »

Maglay wrote:Greetings, first of all awesome mod :)

I have also a problem with provider stations when I use short L-CC-L trains and long L-CCCC-L trains at the same time:
I have a mine for ore with a provider station for L-CCCC-L trains, each wagon has 6 inserters - chest - inserter combos, the incoming ore is split by 4 so each wagon has the same amount of ore available. All chests are connected to the input lamp. The ore goes to my forge with a L-CCCC-L station as input and a L-CC-L station as output. Now it can happen that the L-CC-L train is used to pick up the ore when no other long train is available, even if I set the min_delivery_size greater than the cargo of two wagons. I also set best_effort to false. The problem is that the two inserter groups after the train stop get used more often than the other two. When the ore is depleted the short train gets stuck at some point in the future because it wants to pick up the ore which is in the wrong chests.

Is there an easy solution or do I need to rebuild the provider station so that all wagons are loaded directly from a belt to ensure that at any time all wagons have some ore available?
Your settings are correct except that Best Effort has no effect on used train size.
Solution is to either make sure there's always a L-4C-L in depot or make your mine outposts capable of handling multiple sizes.
I feed loading stations with only 1 blue belt with MadZuri's loading design so all chests are balanced.
It only becomes a slight problem when too small trains constantly run to that station.
Maglay
Inserter
Inserter
Posts: 30
Joined: Tue Dec 06, 2016 7:52 am
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by Maglay »

Optera wrote: Your settings are correct except that Best Effort has no effect on used train size.
Solution is to either make sure there's always a L-4C-L in depot or make your mine outposts capable of handling multiple sizes.
I feed loading stations with only 1 blue belt with MadZuri's loading design so all chests are balanced.
It only becomes a slight problem when too small trains constantly run to that station.
Would it be easy to implement a Minimum_Train_Length signal to limit the train length from both sides?
This would solve my problem and has another benifit. When a L-4C-L coal requester station is supplied by a L-CC-L train one needs to deactive the inserters infront of the locomitve by using some combinators in order to avoid unloading the fuel - coal. This overhead logic can be avoided by a min_train_length signal.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by Optera »

Maglay wrote:
Optera wrote: Your settings are correct except that Best Effort has no effect on used train size.
Solution is to either make sure there's always a L-4C-L in depot or make your mine outposts capable of handling multiple sizes.
I feed loading stations with only 1 blue belt with MadZuri's loading design so all chests are balanced.
It only becomes a slight problem when too small trains constantly run to that station.
Would it be easy to implement a Minimum_Train_Length signal to limit the train length from both sides?
This would solve my problem and has another benifit. When a L-4C-L coal requester station is supplied by a L-CC-L train one needs to deactive the inserters infront of the locomitve by using some combinators in order to avoid unloading the fuel - coal. This overhead logic can be avoided by a min_train_length signal.
Having the fall back to smaller trains was a deliberate design choice.
  • It makes sure shipments are made when trains are available.
  • Together with max Train size it's a very dead lock prone system. Imagine a mine set to min length 6 and a smelter set to max length 4.
    It's very hard finding that bug yourself, let alone for me to deal with bug reports for it. Especially when the simple solutions, use more trains or use min delivery size without best effort, work just as well.
You can already easily discern between L-2C-L and L-4C-L by reading the combinator signals.
nosferato
Inserter
Inserter
Posts: 27
Joined: Sat Aug 02, 2014 11:11 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by nosferato »

Hi Optera, I am trying out your mod, and I have noticed a couple of things
Liquid cargo seems to ignore level requests and keep creating orders, so i set up combinators to hide the amounts in supplied tanks until it reached its level, then after the order is created, more orders are created as the tanks continue to fill .. i.e tanks reaches 1000, amount is shown to network, order is created, then i assume when time is reached to check for new orders, it creates a new order for the difference in tank from when last order was created, and so on until the amount is hidden again when the first train arrives
also I am trying out yuoki trains, and there is a tender car which i am using to hold coal and refuel itself, it would be nice if there was the option to use a logistic signal to send on a train, this only affects shipping fuel for trains, but i have noticed that it would be nice as a captcha, when the wrong train is sent to a providing station and just sits there
exofact
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Dec 06, 2016 1:09 am
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by exofact »

Optera wrote:
exofact wrote:I just installed 0.4.5 and am getting this error on loading my save:

"Error while running the on_init: __LogisticTrainNetwork__/control.lua:32: attempt to concatenate field '?' (a nil value)"

I am running Factorio 0.14.21.

Is there any easy way to get an export of what mods are installed?
Yes, attach the log file, all loaded mods and version are listed there.
Where's the log file? nevermind, found it.
Attachments
factorio-current.log
(8.78 KiB) Downloaded 148 times
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by Optera »

nosferato wrote:Hi Optera, I am trying out your mod, and I have noticed a couple of things
Liquid cargo seems to ignore level requests and keep creating orders, so i set up combinators to hide the amounts in supplied tanks until it reached its level, then after the order is created, more orders are created as the tanks continue to fill .. i.e tanks reaches 1000, amount is shown to network, order is created, then i assume when time is reached to check for new orders, it creates a new order for the difference in tank from when last order was created, and so on until the amount is hidden again when the first train arrives
Sorry, I can't replicate that behavior.
also I am trying out yuoki trains, and there is a tender car which i am using to hold coal and refuel itself, it would be nice if there was the option to use a logistic signal to send on a train, this only affects shipping fuel for trains, but i have noticed that it would be nice as a captcha, when the wrong train is sent to a providing station and just sits there
Fuel shipping signal only for Yuoki Trains tender what?
I'm not going to include any functionality that requires other mods, with the exception of Rail Tanker.
exofact wrote:
Optera wrote:
exofact wrote:I just installed 0.4.5 and am getting this error on loading my save:

"Error while running the on_init: __LogisticTrainNetwork__/control.lua:32: attempt to concatenate field '?' (a nil value)"

I am running Factorio 0.14.21.

Is there any easy way to get an export of what mods are installed?
Yes, attach the log file, all loaded mods and version are listed there.
Where's the log file? nevermind, found it.
Did you edit MOD_NAME in control.lua? That's the only possible way line32 could have a nil value.
nosferato
Inserter
Inserter
Posts: 27
Joined: Sat Aug 02, 2014 11:11 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by nosferato »

Optera wrote:
nosferato wrote:Hi Optera, I am trying out your mod, and I have noticed a couple of things
Liquid cargo seems to ignore level requests and keep creating orders, so i set up combinators to hide the amounts in supplied tanks until it reached its level, then after the order is created, more orders are created as the tanks continue to fill .. i.e tanks reaches 1000, amount is shown to network, order is created, then i assume when time is reached to check for new orders, it creates a new order for the difference in tank from when last order was created, and so on until the amount is hidden again when the first train arrives
Sorry, I can't replicate that behavior.
also I am trying out yuoki trains, and there is a tender car which i am using to hold coal and refuel itself, it would be nice if there was the option to use a logistic signal to send on a train, this only affects shipping fuel for trains, but i have noticed that it would be nice as a captcha, when the wrong train is sent to a providing station and just sits there
Fuel shipping signal only for Yuoki Trains tender what?
I'm not going to include any functionality that requires other mods, with the exception of Rail Tanker.
I'm sorry if i wasn't clear, lack of sleep ;)
if there isn't enough wagons of type liquid or dry cargo available, orders are created and sent to which ever train has been sitting longest, sometimes liquid wagons arrive at ore mines and the items are loaded and voided, (voided items not your issue as that is rail tanker mod) i have created a captcha to check the wagon being loaded, but the train will just sit there trying to complete its order. also a coal train that has extra inventory not to be delivered will sit there trying to empty, this led to thinking if the schedule had a (item count > x or signal green = 1) (item count = 0 or signal green = 1) you could check the train type and send the signal for it to move on, eventually making it's way back to the depot.

I know the first issue is to add more trains, however my base is just starting and resources are scarce.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by Optera »

nosferato wrote:I'm sorry if i wasn't clear, lack of sleep ;)
if there isn't enough wagons of type liquid or dry cargo available, orders are created and sent to which ever train has been sitting longest, sometimes liquid wagons arrive at ore mines and the items are loaded and voided, (voided items not your issue as that is rail tanker mod) i have created a captcha to check the wagon being loaded, but the train will just sit there trying to complete its order. also a coal train that has extra inventory not to be delivered will sit there trying to empty, this led to thinking if the schedule had a (item count > x or signal green = 1) (item count = 0 or signal green = 1) you could check the train type and send the signal for it to move on, eventually making it's way back to the depot.

I know the first issue is to add more trains, however my base is just starting and resources are scarce.
Using only railtanker with base locos i can't replicate any of it. My Tanker trains just sat by themself in the depot for 10 minutes while item orders piled up.
Perhaps yuoki adds inventory to some locos making them eligible to transport items as well.
nosferato
Inserter
Inserter
Posts: 27
Joined: Sat Aug 02, 2014 11:11 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by nosferato »

Optera wrote:
nosferato wrote:I'm sorry if i wasn't clear, lack of sleep ;)
if there isn't enough wagons of type liquid or dry cargo available, orders are created and sent to which ever train has been sitting longest, sometimes liquid wagons arrive at ore mines and the items are loaded and voided, (voided items not your issue as that is rail tanker mod) i have created a captcha to check the wagon being loaded, but the train will just sit there trying to complete its order. also a coal train that has extra inventory not to be delivered will sit there trying to empty, this led to thinking if the schedule had a (item count > x or signal green = 1) (item count = 0 or signal green = 1) you could check the train type and send the signal for it to move on, eventually making it's way back to the depot.

I know the first issue is to add more trains, however my base is just starting and resources are scarce.
Using only railtanker with base locos i can't replicate any of it. My Tanker trains just sat by themself in the depot for 10 minutes while item orders piled up.
Perhaps yuoki adds inventory to some locos making them eligible to transport items as well.
i forgot to mention, at the moment my trains all have tenders which are of course regarded as just cargo wagons, its probably registering the tenders as available loading space and sending the tankers to pick up dry goods, trying to keep the steam asthetic :)

i guess a work around would be to edit the tenders to not have an invetory.

is there a way to blacklist a certain train? i saw in the signals that you list all train items, not sure how they work
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by steinio »

nosferato wrote:
Optera wrote:
nosferato wrote:I'm sorry if i wasn't clear, lack of sleep ;)
if there isn't enough wagons of type liquid or dry cargo available, orders are created and sent to which ever train has been sitting longest, sometimes liquid wagons arrive at ore mines and the items are loaded and voided, (voided items not your issue as that is rail tanker mod) i have created a captcha to check the wagon being loaded, but the train will just sit there trying to complete its order. also a coal train that has extra inventory not to be delivered will sit there trying to empty, this led to thinking if the schedule had a (item count > x or signal green = 1) (item count = 0 or signal green = 1) you could check the train type and send the signal for it to move on, eventually making it's way back to the depot.

I know the first issue is to add more trains, however my base is just starting and resources are scarce.
Using only railtanker with base locos i can't replicate any of it. My Tanker trains just sat by themself in the depot for 10 minutes while item orders piled up.
Perhaps yuoki adds inventory to some locos making them eligible to transport items as well.
i forgot to mention, at the moment my trains all have tenders which are of course regarded as just cargo wagons, its probably registering the tenders as available loading space and sending the tankers to pick up dry goods, trying to keep the steam asthetic :)

i guess a work around would be to edit the tenders to not have an invetory.

is there a way to blacklist a certain train? i saw in the signals that you list all train items, not sure how they work
Ah the Yuoki trains?

Maybe it helps to lock all slots with the red x of the tender?

Greetings steinio
Image

Transport Belt Repair Man

View unread Posts
nosferato
Inserter
Inserter
Posts: 27
Joined: Sat Aug 02, 2014 11:11 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by nosferato »

Nope, after the coal incident, I locked out all the slots on the tenders
brandonvd
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Dec 07, 2016 10:18 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by brandonvd »

hey Optera, i also suffered from the "Error while running the on_init: __LogisticTrainNetwork__/control.lua:32: attempt to concatenate field '?' (a nil value)" that was mentioned before by other.
After poking around the code and the forums a bit i think i might have found what could be the problem, when you use "game.active_mods[MOD_NAME]" this gets the mods that are saved to that savegame at the time of creation.
This means that if you have a savegame from before you installed the mod, using game.active_mods[MOD_NAME] looks in the game list for a mod that doesn't exsist and so it returns a nill value, that's why you can create/use savegames that had the mod enabled, before creation, but not run the mod on a save that didn't have the mod before.

i first realized this when removing the log line completely would fix the error entirely. you should look into this!.. i hope i was right and that this is actually helpfull! :lol:
nosferato
Inserter
Inserter
Posts: 27
Joined: Sat Aug 02, 2014 11:11 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by nosferato »

nosferato wrote:
steinio wrote:
nosferato wrote:
Optera wrote:
nosferato wrote:I'm sorry if i wasn't clear, lack of sleep ;)
if there isn't enough wagons of type liquid or dry cargo available, orders are created and sent to which ever train has been sitting longest, sometimes liquid wagons arrive at ore mines and the items are loaded and voided, (voided items not your issue as that is rail tanker mod) i have created a captcha to check the wagon being loaded, but the train will just sit there trying to complete its order. also a coal train that has extra inventory not to be delivered will sit there trying to empty, this led to thinking if the schedule had a (item count > x or signal green = 1) (item count = 0 or signal green = 1) you could check the train type and send the signal for it to move on, eventually making it's way back to the depot.

I know the first issue is to add more trains, however my base is just starting and resources are scarce.
Using only railtanker with base locos i can't replicate any of it. My Tanker trains just sat by themself in the depot for 10 minutes while item orders piled up.
Perhaps yuoki adds inventory to some locos making them eligible to transport items as well.
i forgot to mention, at the moment my trains all have tenders which are of course regarded as just cargo wagons, its probably registering the tenders as available loading space and sending the tankers to pick up dry goods, trying to keep the steam asthetic :)

i guess a work around would be to edit the tenders to not have an invetory.

is there a way to blacklist a certain train? i saw in the signals that you list all train items, not sure how they work
Ah the Yuoki trains?

Maybe it helps to lock all slots with the red x of the tender?

Greetings steinio
Nope, after the coal incident, I locked out all the slots on the tenders
so I went ahead and removed the inventory from the tender, and all is working fine, so as is, you cant mix liquid and solid goods wagons in a single train, with multiple train setups, i.e. you have to take into account the tanker may turn up at solid goods and during loading getting voided

Update:
Not all is fine, now the liquid trains just sit there doing nothing

after letting it run awhile, it figured itself out
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by Nexela »

brandonvd wrote:hey Optera, i also suffered from the "Error while running the on_init: __LogisticTrainNetwork__/control.lua:32: attempt to concatenate field '?' (a nil value)" that was mentioned before by other.
After poking around the code and the forums a bit i think i might have found what could be the problem, when you use "game.active_mods[MOD_NAME]" this gets the mods that are saved to that savegame at the time of creation.
This means that if you have a savegame from before you installed the mod, using game.active_mods[MOD_NAME] looks in the game list for a mod that doesn't exsist and so it returns a nill value, that's why you can create/use savegames that had the mod enabled, before creation, but not run the mod on a save that didn't have the mod before.

i first realized this when removing the log line completely would fix the error entirely. you should look into this!.. i hope i was right and that this is actually helpfull! :lol:
The easiest way to get around this would be to change "game.active_mods[MOD_NAME]" to "game.active_mods[MOD_NAME] or 0"

Alternatively you could define MOD_VERSION and do "game.active_mods[MOD_NAME] or MOD_VERSION"
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by Optera »

Yuoki Trains & mixed Cargo trains
Thanks for the reports. If Yuoki tenders have a normal inventory instead of a fuel inventory they indeed do count as cargo wagons and LTN will try to use them as such. Going through every possible mod abusing "defines.inventory.cargo_wagon" for something other than inventory would be impractical.
I'll add a 30s inactivity timeout to each stop so you don't have to manually send those trains back to depot.

Generally, liquid/item mixed trains are possible, but require very carefully constructed (un-)loading stations and will always only transport one or the other.
So i don't recommend doing it.
Nexela wrote:
brandonvd wrote:hey Optera, i also suffered from the "Error while running the on_init: __LogisticTrainNetwork__/control.lua:32: attempt to concatenate field '?' (a nil value)" that was mentioned before by other.
After poking around the code and the forums a bit i think i might have found what could be the problem, when you use "game.active_mods[MOD_NAME]" this gets the mods that are saved to that savegame at the time of creation.
This means that if you have a savegame from before you installed the mod, using game.active_mods[MOD_NAME] looks in the game list for a mod that doesn't exsist and so it returns a nill value, that's why you can create/use savegames that had the mod enabled, before creation, but not run the mod on a save that didn't have the mod before.

i first realized this when removing the log line completely would fix the error entirely. you should look into this!.. i hope i was right and that this is actually helpfull! :lol:
The easiest way to get around this would be to change "game.active_mods[MOD_NAME]" to "game.active_mods[MOD_NAME] or 0"

Alternatively you could define MOD_VERSION and do "game.active_mods[MOD_NAME] or MOD_VERSION"
Thanks a lot. That's one odd design choice.
According to game.active_mods and this bug report it should hold the currently loaded mods.
I'll do some more testing and open another bug report on this.

Edit: Added a bug report for this inconsistent behavior.
Last edited by Optera on Thu Dec 08, 2016 7:02 am, edited 1 time in total.
nosferato
Inserter
Inserter
Posts: 27
Joined: Sat Aug 02, 2014 11:11 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.5

Post by nosferato »

Optera wrote:
Yuoki Trains & mixed Cargo trains
Thanks for the reports. If Yuoki tenders have a normal inventory instead of a fuel inventory they indeed do count as cargo wagons and LTN will try to use them as such. Going through every possible mod abusing "defines.inventory.cargo_wagon" for something other than inventory would be impractical.
I'll add a 30s inactivity timeout to each stop so you don't have to manually send those trains back to depot.

Generally, liquid/item mixed trains are possible, but require very carefully constructed (un-)loading stations and will always only transport one or the other.
So i don't recommend doing it.
no problems, I usually don't use mixed trains, but i am experimenting with yuoki's trains, they are adding a new level of complexity with different length loco's and wagons, i also usually use smart trains, but i don't want a tanker sat along way from base during early base building, so your mod looked enticing, loving what you have done so far, after a little modding and compromise, my trains are running sweet, maybe in future we can have huge mixed train networks with smart automation
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.6

Post by Optera »

After some tests with Yuoki Industries Railways, tenders seem not worth getting any special treatment in LTN.
I was under the impression they where additional fuel storage for locomotives, but they are just plain normal cargo wagons with no code attached to them. So I will treat them as normal cargo wagons in LTN.
nosferato
Inserter
Inserter
Posts: 27
Joined: Sat Aug 02, 2014 11:11 pm
Contact:

Re: [Mod 0.14] Logistic Train Network 0.4.6

Post by nosferato »

Optera wrote:After some tests with Yuoki Industries Railways, tenders seem not worth getting any special treatment in LTN.
I was under the impression they where additional fuel storage for locomotives, but they are just plain normal cargo wagons with no code attached to them. So I will treat them as normal cargo wagons in LTN.
I was under the same impression, so for asthetics, i was loading the tenders with coal, then having them unload to the loco at every stop, would have been nice if they would act as extra storage :roll:
Locked

Return to “Logistic Train Network”