Train Pause deprecated

by dorfl

A combinator to pause trains at stations until the next station is available.

Content
6 years ago
0.16
4
Circuit network

g Issue

6 years ago
(updated 6 years ago)

I found your mod interesting so I gave it a try.
I tested a simple setup however I have an issue, first I don't know what "train backlog" means (third setup step).
Second, as you can see on this pic : https://i62.servimg.com/u/f62/16/38/19/35/aad11.jpg
I have three trains with the same schedule, and both stations on left have the same name and are avaible. Yet your combinator doesn't seem to emit a signal.

Could you enlighten me ?

6 years ago

Backlog is the number of trains to release per target station name. Will try to think of a better term for it (or at least a better tool tip in settings panel).

May I see the schedule for your trains, or perhaps a save file to test?

I'm debugging some strange behaviour with multiple stations with the same name on my test base (think it's double-counting some trains), but have not seen an example of signals not firing at all.

6 years ago

A theory -- if you select the combinator is it operable? Does it popup the usual constant combinator style window or does nothing happen? It should not open the popup.

6 years ago
(updated 6 years ago)

Based on the above comment, I think 0.1.3 has broken event handling due to a PEBKAC bug of mine, which resulted in the train-pauser combinators reverting to regular constant combinators.

Version 0.1.4 has a fix for that, plus a fix for the train double-counting.

https://mods-data.factorio.com/assets/9c5d9ae35e93a99595fd0654059d9e7e2a33eae6.png

6 years ago

Ok so I configured the train dispatch number without knowing it was backlog hehe

Thanks a lot, version 0.1.4 actually fixed that issue, now my testing setup works. The combinator was still operable, its window appearing when clicking on it but now it's fine.
So I gonna give it a try on my real base, I'll keep you informed if there are issues and even if it works well :D

6 years ago

Thank you!

6 years ago
(updated 6 years ago)

So, I found an error https://i62.servimg.com/u/f62/16/38/19/35/qsdqsd10.jpg :D
I was gently placing train pause combinators with my drones, using a simple blueprint : the combinator connected to the train stop with a green wire. When suddenly I got this message.

Hopefuly an autosave brought me back 5 seconds before the events so I tried to check if it was train-related. I pressed the map button and there was only one train on the move, all others being waiting in my depot.

6 years ago

Ok, things become more precise
Now all my trains are sleeping in my depot. The error quickly appears (not immediatly) after the drone having placed the combinator on that particular train (and no other) : https://i62.servimg.com/u/f62/16/38/19/35/qsdqsd11.jpg
You can see its whole schedule. Even if I manually place the combinator and link it to the train stop, I have that error.

However, if I put the train in manual mode before laying the blueprint, the error doesn't pop up once the combinator placed. Yet it still appears if I turn the train back in automatic mode and apply the blueprint.

6 years ago

If this can ever help you : sending the train elsewhere then waiting for it to return at the same station and finally laying the combinator still gets this error.
Laying the combinator after the train left will also get the error once the train is back.

6 years ago

Thanks. The fix for that seems obvious -- an extra nil check -- but I admit I don't understand yet how it occurs. The fact I can't reproduce it, and you think it's time based... possibly a race condition?

Time for some research into get_train_stop_trains()

6 years ago
(updated 6 years ago)

In fact I don't really know what it was. Actually the train on the move had nothing to do with it, it was just when linking your combinator to the station of ONE particular train. Well, just had to remove the train and place it back, it doesn't matter.

SO, know I gonna write what I wanted to write thinking the mod would have worked on the first try, as NOW it seems to work : "YOU, YES, YOU, I LOVE YOU !"
For know I don't have any issue, either in the form of an error message ; or problem with train pathing. It works well. See : https://i62.servimg.com/u/f62/16/38/19/35/buu11.jpg

I have two trains taking care of iron plates supplying. They wait in the train depot until a loading station is full. When both loading stations are full, they dispatch themselves correctly, not taking the shortest path and ending blocked one behind the other.
Upon unloading, they also take their own correct path, so for now, IT WORKS.

Moreover it's a bit complex train system I'm using (homemade) with SR-latches, wide logic network with both red and green wires, so your mod is functionnal even on "not-so-simple" setups.
In fact there was only one flaw in my system : when more than one train are dispatched (several loading stations are activated), I don't have the slightest control on their route, so they end messing up.
Now it's fixed, thanks to you !
And I'll probably need a third train for iron plates, we gonna see what your mod is made of !

Stay tuned :D

6 years ago

Nice :)

As for the bug I still can't reproduce it either, so if you do see it again please consider posting a save file?

Thanks for all the testing!

6 years ago

I still have that save, eh https://drive.google.com/open?id=1AKl_WBsZaF9rSSBJOYlh4_WMEyqiTWlP
So it's in 0.16.39 because of the recent rail signals bug, yet full vanilla with only your mod.
Just connect the combinator to the station, it's the yellow train surrounded by lamps.
FYI, parts may be missing, I'm playing with mod so giving you the vanilla version changed a bit my base BUT I still was able to reproduce the error, so it should be fine.

6 years ago

Thanks for that, but still no go reproducing the error here I'm afraid (testing with precisely the same combination of Factorio 0.16.39, base mod +Train Pause 0.1.4).

In any case, if you see it again, retest with Train Pause 0.1.6. That version has a fix related to another bug to do with handling disabled stations -- since your save shows a lot of those, perhaps it's relevant...

</vague-guess>

New response