Transport Fever 2

Transport Fever 2

Auto-Rename: Vehicles
45 Comments
iProfessore 8 May, 2023 @ 5:39am 
tsilaicosneknurd is right, every time you add a vehicle any number of existing vehicles change their numbers
tsilaicosneknurd 7 May, 2023 @ 2:40am 
hm. just that vehicles change number all the time, when adding new vehicles. if it was sorted, they would keep their number.
Doesn't affect the age of vehicle the maintenance cost or/and the value of the vehicle, that's why I want to replace oldest vehicles first?
phobos2077  [author] 6 May, 2023 @ 6:47am 
Why do you care about the age of vehicles in the game where it doesn't affect anything?
tsilaicosneknurd 6 May, 2023 @ 12:53am 
I like that mod a lot.
Could you make it possible to enumerate the vehicles by age? so oldest vehicle gets vehicle 1 and the newest vehicle 27 (when having 27 vehicles on line).
iProfessore 29 Mar, 2023 @ 4:09am 
Hi, after the last major update your mod is misbehaving. Say i have 5 vehicles, i select the last one and duplicate. you would expect the new one to be 6 but it isnt, others has been shuffled around so the new vehicle ends up as 2 for instance and all the others move down. vary irritating
maculator 21 Nov, 2022 @ 1:01am 
This is a perfect mod.
Thank you very much.
lolic_lol 16 Sep, 2022 @ 1:11pm 
Удивительное совпадение, но именно сегодня кто то добавил мод Paint Ya Car, который делает именно это.
phobos2077  [author] 16 Sep, 2022 @ 12:24pm 
Когда-то планировал такую возможность добавить но стало лень и я забил :)
lolic_lol 16 Sep, 2022 @ 8:50am 
А нет возможности автоматически перекрашивать транспорт в цвет линии?
coenvijge 28 May, 2022 @ 11:27am 
First: Thank you for this mod. Got it a week ago. Just does it in the way I (name) number my vehicles, but now much faster and without errors!
Second: If you go on with this work: I prefer a big one; if there are functions for vehicles and stations in it you could call it just 'Automation' or 'Phobos Automation' or 'Automation by Phobos'. Imo it's more important to have a short list of the features of the mod on top of the description and then some detailled information following, then the name.
GSC20 22 May, 2022 @ 2:25pm 
one big mode would be good
DayWalker 19 May, 2022 @ 5:14am 
phobos2077
За вариант - одного большого мода с возможностью выбора настроек.
phobos2077  [author] 13 May, 2022 @ 7:04am 
I think I can just replace this mod via update. I initially planned to expand autorename to stations and rename the mod as needed, while keeping backward compatibility for previous users. Need a new name that makes sense like "Automation: Vehicles" and new way to configure the mod in-game, because I think regular mod options for combined mod like this might become messy.
RustyBucket 13 May, 2022 @ 6:53am 
I'd go for a big mod with options...
phobos2077  [author] 13 May, 2022 @ 1:39am 
Need some advice. I want to add a bunch of features like:
- Auto-rename stations based on their placement
- Auto-color vehicles based on line color
- Auto-set maintenance level based on other vehicles on the line

Do you think these should be several tiny mods or bundled together in a larger mod? From development POV, it's much easier for me to work on one bigger mod than several small ones. All features will be optional of course. It's just the "marketing" aspect I'm concerned about. If players would miss this mod because it does too many different things.
RustyBucket 10 May, 2022 @ 6:29am 
nevermind, I fucked up my settings
RustyBucket 10 May, 2022 @ 6:23am 
Works great, but when you put the vehicle type in, it doesn't put a space before the number... minor nitpick...

Love the update, tho
ŠKODA For City--- 9207 10 May, 2022 @ 6:06am 
Sehr interessant!
Ich würde mir Wünschen, wenn auf den Fahrzeugen außen die Fahrzeugnummer angeschrieben ist.
Grüße aus Dresden.
RustyBucket 9 May, 2022 @ 11:42am 
Ooh, looks great, I'm eagerly awaiting the update
phobos2077  [author] 9 May, 2022 @ 10:36am 
Never mind, I ended up rewriting the approach to renaming completely. Now it will be able to adapt number of digits to the current number of vehicles in group. Also no more higher numbers. Renaming will always affect entire line. I manager to keep performance another way. Expect update soon.
phobos2077  [author] 9 May, 2022 @ 7:59am 
Added a bunch of options for vehicle naming, check this out:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2805982984

> end up with higher numbers than the number of vehicles on the line... dunno if that's intentional.

Yes. The way the mod works is it only renames vehicles that don't already match the desired pattern, so it is as light as possible on game's performance. This is why I didn't do automatic number of digits (only manual selection). I'd like to keep things simple and fast.
RustyBucket 9 May, 2022 @ 6:15am 
Oh, and another thing I noticed, if you sell random vehicles, the others don't get renumbered and thus end up with higher numbers than the number of vehicles on the line... dunno if that's intentional.
RustyBucket 9 May, 2022 @ 6:13am 
True, none of this is a big deal, but it'd be a nice to have
phobos2077  [author] 9 May, 2022 @ 6:05am 
Regarding sorting, as far as I can see, the game uses natural sorting in all lists where vehicles names are shown. The only case where it "breaks" is when there are 2 numbers in the name (in that case only the last number is "naturally" sorted). So you can only really see this in lists of vehicles from more than 1 line. Doesn't seem like a big deal tbh :)
phobos2077  [author] 9 May, 2022 @ 4:26am 
I'm planning to expand this mod to other objects. First in line are stations connected to industries (almost done). As soon as I finish this feature, I'll go back to vehicle names and see what I can do based on your feedback. So you can either wait or try to implement it yourself if you're in a hurry. I'll still probably do my own implementation, so don't bother sending me code unless you really want to :)
RustyBucket 8 May, 2022 @ 3:28pm 
The name sorter is the vanilla thing that sorts by name, so that’s the easiest to test. LineManager uses [<CapitolLetter(s)> and up to two <:number>] like

or [R:100:200] in the title to read parameters. And one of the locos with number plates is:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2776534185

But there’s a bunch more with the same idea and potentially different implementation…

As for priority, I‘d try the one number per name idea first, that should knock out issues with vanilla and number plates, then I‘d try to add the removal of weird segments such as blocks designated by [].

I‘m currently stuck on mobile and can’t give better links, sry.

phobos2077  [author] 8 May, 2022 @ 9:56am 
That's a lot of info. Sounds like I would need to do this step by step. Could you send me the list of those other mods you're using so I can see what's what and prioritize possible compatibility changes?
RustyBucket 8 May, 2022 @ 8:27am 
Sorry, steam is being a pain with char limits
RustyBucket 8 May, 2022 @ 8:26am 
And why do I ask you to make these changes: I still need quite a bit of reading before I figure out what is where in your code and changes you upload are "permanent" while local changes get changed every time steam feels like checking for "errors".

But if/when I get time, I'll try and do those changes myself and see if I can send them to you for updating.
RustyBucket 8 May, 2022 @ 8:26am 
- the name sorter can't deal with numbers that aren't in the rear and sorts them weirdly (X1, X11, X2, X3, X4,...), so I thought to suggest something that would preserve the actual line sorting.
- Some mods need you to put stuff into the line name that imo has no business in the vehicle name like the lineManager mod that uses [], so it'd be nice if these things didn't make it into the vehicle name.
- Some mods try to read the vehicle number out of the vehicle name in order to display it on the Vehicle, and at least a subset of them is stupid enough to take the first number in the title instead of the last number where you'd expect the distinguishable numbers, so it'd improve compatibility if there were only one number in the title and that one being in the rear, there also are issues with that feature if there are weird signs in the title like [], so not having them in the vehicle name would be great imo.
RustyBucket 8 May, 2022 @ 8:26am 
The square brackets are for another mod that reads parameters out of the title.

The angled brackets are for "readability", so you can distinguish between fields and normal text, dunno why I chose angled brackets here.

Why would I love for this mod to do something with that: so it plays nicely with other mods and the name sorter.
phobos2077  [author] 8 May, 2022 @ 7:48am 
I didn't understand anything from your last comment. Why do you enclose all names in angled brackets? What's the deal with square brackets and numbers? And what this has to do with the mod? As it is, it just concatenates full line name according to selected naming pattern.

The hyphen idea was to make name less "weird" not to tailor for modded vehicles with non-standard logic.
RustyBucket 8 May, 2022 @ 5:55am 
Oh, and if we're already at the stage of doing something with the title, would it be possible to ignore stuff in brackets when titling vehicles? like the square brackets used for line manager leading to whacky names like <B A [R:800:1500] Train 1>
RustyBucket 8 May, 2022 @ 5:44am 
Tested it, hyphen doesn't do the trick
RustyBucket 8 May, 2022 @ 5:40am 
Take the number of the line as X, the number of vehicles on the line as Y, count the digits of Y as Z and the vehicle number as I, then the vehicle number is X*(10^(Z+1))+I.

As for the vehicle numbers, I meant other models that show custom road numbers on the side like the ones I noticed it not playing well: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2776534185

Their number boards seem to look for the first number in the title and since that's the line name, they all display a 1 since they run on the A 1 line. I doubt a hyphen will do the trick for all vehicles that implement such a number.
phobos2077  [author] 8 May, 2022 @ 5:23am 
I understand the idea now. There's an issue here: you need to decide on number of digits to allocate for both numbers, otherwise they will look weird. Maybe a simpler idea would be to separate numbers with a dash instead of space like this: "A 1-13" ?

About vehicles showing number, I thought they only show the name of the line, not vehicle name:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2805449477
RustyBucket 8 May, 2022 @ 5:02am 
Ok, I don't think I can do a quick and dirty modification of your code to give you a theoretically usable implementation
RustyBucket 8 May, 2022 @ 4:51am 
The line <A 1> is a train line with currently 13 vehicles, currently named <A 1 train 1> through to 1 train 13> as <A 1 1> through <A 1 13> looks whack. Now I thought to name the trains <A 101> through <A 113> or <A train 101> through <A train 113>.

Another example would be <L 1>, a lorry line, hopelessly overcrowded with 545 ish vehicles, which I'd like to name <L truck 1001> through <L truck 1545>

That way, certain vehicles that display the vehicle number on the model would have a unique number in their category, which would simulate separate "companies" running different vehicles like in one city, you'd have unique running numbers on all trams and all buses while another city has their pool of road numbers...
phobos2077  [author] 8 May, 2022 @ 4:14am 
@RustyBucket, yes it technically possible to do. Can you give a more clear example of your idea with concrete names so I can better understand it? I'm confused how you want to concatenate line and vehicle numbers.
RustyBucket 8 May, 2022 @ 3:54am 
Would it be possible to add a mode that embraces the line number and kinda uses it as a prefix? Like <line XX> vehicle <Y> to <YY> would become vehicle name <line XX0Y> to <line XXYY> or <line vehicle XX0Y> to <line vehicle XXYY>?

I'll try to muck around in the mod file to be able to give you a concrete implementation if I get around to do it..
phobos2077  [author] 8 May, 2022 @ 3:25am 
@MaxCheng95, well yes it's possible. Not sure when/if I'll do it. Also there's a feature that ignores lines that hasn't been renamed by player and follow standard "Line XX" pattern, although it works only in English localization no. In other languages it will always rename.
MaxCheng95 8 May, 2022 @ 3:03am 
This mod is amazing! Tho is it possible to make this a toggleable function in game since most of the time not all route needs such automatic renaming?
Exo_Atami_122 8 May, 2022 @ 12:31am 
Sometimes the best mods are the simpler ones!! Genius!! Thanks!!
GSC20 7 May, 2022 @ 3:32pm 
Tolle Idee - probiere ich gerne aus 👍🏼
Johno 7 May, 2022 @ 12:43pm 
Very Nice :)