Hi,
I couldn't find an answer (neither in wiki nor forum) for a question - what is train IDs range? How is the ID set? Can somehow happen that two trains get the same id? (f.e. through number overflow or too many trains). These info would be useful for my circuit network. Thank you.
Train IDs
- husnikadam
- Long Handed Inserter
- Posts: 73
- Joined: Mon May 21, 2018 1:56 pm
- Contact:
Re: Train IDs
- train ID is unique
- gets set when train is created, reset when you change the train composition (adding/removing wagons or locomotives)
- Range: could not find any info on that, probably standard factorio integer range (2^31)
- gets set when train is created, reset when you change the train composition (adding/removing wagons or locomotives)
- Range: could not find any info on that, probably standard factorio integer range (2^31)
- husnikadam
- Long Handed Inserter
- Posts: 73
- Joined: Mon May 21, 2018 1:56 pm
- Contact:
Re: Train IDs
So IDs start at (zero/one)? and then every train update uses a next unused ID, right? Thanks
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Train IDs
It probably uses last_assigned_id+1, regardless of if there are currently unused ids before that. I.e. every ID should be unique for the duration of the whole game even if you destroy lots of trains.husnikadam wrote: ↑Sat Dec 21, 2019 10:56 pmSo IDs start at (zero/one)? and then every train update uses a next unused ID, right? Thanks
See also viewtopic.php?p=360137#p360137
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.