Train ID should not change

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
Skeletpiece
Long Handed Inserter
Long Handed Inserter
Posts: 82
Joined: Sat Jul 08, 2017 6:26 pm
Contact:

Train ID should not change

Post by Skeletpiece »

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
Smart Inserter
Smart Inserter
Posts: 1039
Joined: Sun Jul 31, 2016 10:53 am
Contact:

Re: Train ID should not change

Post by Tekky »

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
Inserter
Inserter
Posts: 48
Joined: Thu Nov 01, 2018 9:48 am
Contact:

Re: Train ID should not change

Post by ggrnd0 »

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: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Train ID should not change

Post by Optera »

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.

Tekky
Smart Inserter
Smart Inserter
Posts: 1039
Joined: Sun Jul 31, 2016 10:53 am
Contact:

Re: Train ID should not change

Post by Tekky »

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
Filter Inserter
Filter Inserter
Posts: 365
Joined: Mon Jul 03, 2017 9:14 am
Contact:

Re: Train ID should not change

Post by JimBarracus »

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”