Train ID should not change

Post your ideas and suggestions how to improve the game.
Post Reply
Skeletpiece
Inserter
Inserter
Posts: 45
Joined: Sat Jul 08, 2017 6:26 pm

Train ID should not change

Post by Skeletpiece » Wed Nov 28, 2018 10:17 pm

As title says, train id (More specific, Locomotive ID) should not change.

The main reason is with circuit networks setup stop working using T as signal (From train)

It changes sequentially if you add/remove a wagon (not locomotive). Locomotive ID should remain the same

Tekky
Filter Inserter
Filter Inserter
Posts: 858
Joined: Sun Jul 31, 2016 10:53 am

Re: Train ID should not change

Post by Tekky » Thu Nov 29, 2018 1:04 am

I think the best solution to this problem would be that every locomotives acts as a constant combinator, which effectively allows the player to set the train/locomotive ID himself.

This has been suggested in the following threads:
viewtopic.php?f=6&t=46969 Constant Combinator for Locomotive
viewtopic.php?f=6&t=56302 Train ID as Constant Combinator

ggrnd0
Burner Inserter
Burner Inserter
Posts: 16
Joined: Thu Nov 01, 2018 9:48 am

Re: Train ID should not change

Post by ggrnd0 » Thu Nov 29, 2018 3:24 pm

Tekky wrote:
Thu Nov 29, 2018 1:04 am
I think the best solution to this problem would be that every locomotives acts as a constant combinator, which effectively allows the player to set the train/locomotive ID himself.
+1

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

Re: Train ID should not change

Post by Optera » Thu Nov 29, 2018 5:59 pm

On one hand it would make tracking trains through train id a lot simpler as we no longer have to listen to on_train_changed to update all id references.

On the other hand though it's not so easy to come up with a usable way of having static id's that are unique to one train.
I can think of two ways to make train id unique.
  1. find the main locomotive and use its unique entity.unit_number to identify a train.
    That's what I used in LTN before train.id existed.
  2. Concat entity.unit_number of all carriages into one massive string.
    Sending that into circuit network would very likely be unreadable for players.
My Mods:

Tekky
Filter Inserter
Filter Inserter
Posts: 858
Joined: Sun Jul 31, 2016 10:53 am

Re: Train ID should not change

Post by Tekky » Thu Nov 29, 2018 6:12 pm

I'm not sure if I want my Train IDs to be unique. If I want two trains to be treated the same way by the circuit network, it would make more sense to set both trains to the same ID.

Having custom Train IDs would also allow grouping and assigning properties to trains. For example, I could assign all my iron ore trains an ID between 1000 and 1999 and all my copper trains an ID between 2000 and 2999. In other words, the first digit would define the type of train (1 = iron, 2 = copper). Also, I could, for example, assign the length of the train to the second digit. That way, a train with an ID of 2348 would be a copper train with a length of 3. All of this information could easily be extracted by the circuit network simply by reading the ID of the train. The possibilities would be endless.

JimBarracus
Fast Inserter
Fast Inserter
Posts: 130
Joined: Mon Jul 03, 2017 9:14 am

Re: Train ID should not change

Post by JimBarracus » Fri Nov 30, 2018 9:13 am

as a workaround you can use copper wire as an alternative for the train id
why copper wire?
-stack size 200
-usually not transported by train

just put a certain amount in the train to identify it and use circuit condtitions working with the amount of copper wire
advantages
-not fixed train id
-multiple trains can have the same id
-doesnt change when you change the train setup
downside:
-cant be used on fluid trains
-needs one slot
-requires cargo filters and inserters

Post Reply

Return to “Ideas and Suggestions”