Cloned vehicle naming

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
hempa
Engineer
Engineer
Posts: 21
Joined: 15 Oct 2008 16:30

Cloned vehicle naming

Post by hempa »

Hello,

I usually name my vehicles for their purpose. For instance, if I have a bus going between city A and B, the name will probably be like "A - B Ps 1". Of course, there is a LOT of renaming to be done when I make a route. 8 or so vehicles servicing a certain set of stations would have numbers from 1-8. This makes it possible for me to, when I click a vehicle, quickly see what route it's on or what the purpose for it is.

Now I'm sure you've all guessed what I'm going for - a patch that will increment the number of the cloned number by 1, taking the name in account. I did some forum crawling and found an old patch for this. It's back to revision 5000 something though, so I doubt it will work. It can be found here.

They mention there are limitations on the naming, but since this was 2006 something, I'm curious if it has been changed. Is there an upper limit on how many named vehicles one can have in a company? If not, anyone know if there's a new patch for this purpose that my searching missed?
User avatar
Nite Owl
Tycoon
Tycoon
Posts: 1889
Joined: 06 Mar 2007 19:32
Location: In The Dark

Re: Cloned vehicle naming

Post by Nite Owl »

The answer to both questions is no.

No - there is no longer a limit on the amount of renaming you can do in the game. I forget the exact revision (it was a while back) but (re)names are no longer held in an array but are attached to the object that has been (re)named.

No - there is no one (to my knowledge) that is working on a patch that allows automatic naming and incremental numbering of cloned vehicles in the game. I am a bit obsessive when it comes to naming vehicles so I do keep an eye out for such things.
Humor is the second most subjective thing on the planet
------------------------------------------------------------
Brevity is the soul of wit and obscenity is its downfall
--------------------------------------------------------
Good Night And Good Luck - Read You Soon
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Cloned vehicle naming

Post by Zutty »

Its a bit of a round-about way of doing it, but you could write an AI that automatically names things for you. Then when you want to play simply start that AI and then using the cheat menu switch to the same team as that AI player. You'll still have control over everything, but the AI will continue in the background.

In my opinion at least, Squirrel is easier to write than C++, AND you won't need to patch anything.

You'll need at least a nightly build or 0.7.0-beta1 for this functionality.
PathZilla - A networking AI - Now with tram support.
hempa
Engineer
Engineer
Posts: 21
Joined: 15 Oct 2008 16:30

Re: Cloned vehicle naming

Post by hempa »

Thanks for the suggestion, I will look into squirrel. No clue how it works though. Any pointers to where I could start learning squirrel? I do know a fair deal of C++, so if I can't figure squirrel out I'll just have to make a new patch of my own :D

edit: Looked at the examples on the Wiki, seems interesting. Managed to make the sample AI there, so I will have to explore this. A patch might actually be possible though, and perhaps it'd be simpler in the end..
Conditional Zenith
Chief Executive
Chief Executive
Posts: 697
Joined: 10 Jun 2003 00:19
Location: Australia

Re: Cloned vehicle naming

Post by Conditional Zenith »

A patch will have to be constantly reapplied and kept up to date with changes in the source. Having said that, the AI API has been getting some backwards incompatible changes recently. Anyway, once the API has settled a bit, doing it as an AI will be write and forget, doing it as a source code patch will require more keeping up to date.
User avatar
SirXavius
Transport Coordinator
Transport Coordinator
Posts: 302
Joined: 28 Jun 2006 18:25
Location: Florida

Re: Cloned vehicle naming

Post by SirXavius »

I agree with the concept of an automatic naming style. I usually name my vehicles to hold easily retrieved info to help keep up with them, such as "Truck 1401Vh" which to me means that this RV gets too old in January 2014 and it hauls Vehicles. Or a train i might name "#5412 CDC - Lvp", which means this train needs to be replaced in December 1954 and it travels between the station at Central Distribution Complex and the one at Liverpool.

I didn't realize others also used their own naming styles to suit their own purposes. Perhaps if there was a configurable naming/numbering style that a player could customize, such as "Train "[mm][yy][ID], which would use a literal, the year and month in 2-digit form, and the Cargo ID. Or something like this. Of course, i have no clue how hard it would be to implement this, but it would provide some kind of configurable standard.
hempa
Engineer
Engineer
Posts: 21
Joined: 15 Oct 2008 16:30

Re: Cloned vehicle naming

Post by hempa »

I'm glad I'm not the only one who's like this with naming :P I've started poking around a bit with squirrel, but writing an AI like this is still ages away. If it only was LUA, I'd have it done faster :P I'll keep you posted on my progress.
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: Cloned vehicle naming

Post by Ammler »

Did you try to play with groups?
Wowi
Engineer
Engineer
Posts: 8
Joined: 22 Feb 2009 02:39

Re: Cloned vehicle naming

Post by Wowi »

Like Ammler said groups does a bit of the same - you wont be able to instantly see what route a vehicle when you click it, but when you list all vehicles theyll be nicely organized. Itll be easy to find a vehicle running on a specific route if you want to clone it and itll be easy to see how many vehicles you have on a specific route.
Hypolite
Engineer
Engineer
Posts: 126
Joined: 10 Jan 2009 07:20
Location: Paris, france

Re: Cloned vehicle naming

Post by Hypolite »

Is the group belonging cloned when you (Ctrl-)copy a vehicle ?
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Cloned vehicle naming

Post by Eddi »

i think yes.
User avatar
Roest
Traffic Manager
Traffic Manager
Posts: 215
Joined: 03 Apr 2008 08:18

Re: Cloned vehicle naming

Post by Roest »

Hypolite wrote:Is the group belonging cloned when you (Ctrl-)copy a vehicle ?
i know yes
Hypolite
Engineer
Engineer
Posts: 126
Joined: 10 Jan 2009 07:20
Location: Paris, france

Re: Cloned vehicle naming

Post by Hypolite »

Yeeepeeee !

*runs naked in the grass*

Hem :oops:

Thanks for the hint, I would have tried myself but it's more enjoyable to know before trying that it's gonna work :mrgreen:
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 6 guests