[0.17.43] train.carriages order

Bugs that are actually features.
User avatar
_Attila_
Long Handed Inserter
Long Handed Inserter
Posts: 75
Joined: Sun Jan 06, 2019 2:46 pm
Contact:

[0.17.43] train.carriages order

Post by _Attila_ »

I am not sure if this is a bug, but it sure seems that way to me.

A train L1-C-L2 pulls up to a station with L1 pulling - train was built in same order.

train.carriages has order L2-C-L1
train.locomotives.front_movers is L2
train.back_stock is L1

It seems to me the front of the train should be at the stop and the data in the above tables should reflect that. The way it is, a mod cannot reliably tell what locomotive is at the stop - at least not very easily.

The train has just this stop in its schedule with no conditions.
Attila's QuickBar Mod - Auto-links hand crafted item to first free quickbar slot if not already linked.
Attila's Signals Mod - Alternate signals to use in same circuit as standard signals.
Attila's Zoom Mod - Modifies zoom functionality.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14679
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.43] train.carriages order

Post by Rseding91 »

Thanks for the report however the order of the carriages is irrelevant to the train. The order they show up when iterating doesn't really matter and isn't a bug if it's not the order you expect.
If you want to get ahold of me I'm almost always on Discord.
User avatar
_Attila_
Long Handed Inserter
Long Handed Inserter
Posts: 75
Joined: Sun Jan 06, 2019 2:46 pm
Contact:

Re: [0.17.43] train.carriages order

Post by _Attila_ »

So, what is the point of calling a locomotive a front_mover when it is in the back of the train?
Or front_stock, for that matter?
Attila's QuickBar Mod - Auto-links hand crafted item to first free quickbar slot if not already linked.
Attila's Signals Mod - Alternate signals to use in same circuit as standard signals.
Attila's Zoom Mod - Modifies zoom functionality.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14679
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.43] train.carriages order

Post by Rseding91 »

_Attila_ wrote: Wed May 29, 2019 9:24 pm So, what is the point of calling a locomotive a front_mover when it is in the back of the train?
Or front_stock, for that matter?
You're seeing the internal name that the game uses to store all of the locomotives that face one direction and the rest that face the other direction.

"front" is meaningless and unrelated to the current direction of a train since a train doesn't drive "forward" but "this speed on the current rail". It could be called "a_movers" and "b_movers". It's just a name so when the train goes to move a given speed it knows which set of locomotives to use.

When speed is positive "front_movers" are used to power the train. When speed is negative "back_movers" are used to power the train.
If you want to get ahold of me I'm almost always on Discord.
User avatar
_Attila_
Long Handed Inserter
Long Handed Inserter
Posts: 75
Joined: Sun Jan 06, 2019 2:46 pm
Contact:

Re: [0.17.43] train.carriages order

Post by _Attila_ »

Thanks for the explanation.
I solved the problem by finding the shorter distance between the stop and the locos at the ends.
Not the most elegant solution, but I do need to know which loco is actually at the stop.
Attila's QuickBar Mod - Auto-links hand crafted item to first free quickbar slot if not already linked.
Attila's Signals Mod - Alternate signals to use in same circuit as standard signals.
Attila's Zoom Mod - Modifies zoom functionality.
Post Reply

Return to “Not a bug”