Change Name train?

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
User avatar
Rocker
Engineer
Engineer
Posts: 14
Joined: 22 Jul 2009 09:38
Location: Slovakia

Change Name train?

Post by Rocker »

Hello All !
I have a question about the "Name Train", but from another sight...
Window in every "Name Train" has a just 25 places for letters. Is possible to expand and have more places ? (for example 40) ?

Thanks
Name Train
Name Train
Screen.png (419.89 KiB) Viewed 4431 times
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: Change Name train?

Post by belugas »

Well... as proven by this picture, you have in fact a limit of 30 characters.
Problem with raising limits is that it will never be good enough for everyone.
So it's a matter of stating at one point: Here's what we believe is good enough for everyone.

Ho... and here is a little code snipset...

Code: Select all

enum {
	MAX_LENGTH_VEHICLE_NAME_BYTES  =  31, ///< The maximum length of a vehicle name in bytes including '\0'
	MAX_LENGTH_VEHICLE_NAME_PIXELS = 150, ///< The maximum length of a vehicle name in pixels
};
Attachments
HoLook_30Chars.png
HoLook_30Chars.png (25.95 KiB) Viewed 4384 times
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Wasila
Tycoon
Tycoon
Posts: 1498
Joined: 15 Mar 2008 07:02

Re: Change Name train?

Post by Wasila »

I never knew you could change the name of a train! Is that just for an individual train or a whole model?
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Change Name train?

Post by Yexo »

Wasila wrote:I never knew you could change the name of a train! Is that just for an individual train or a whole model?
You can change both.
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: Change Name train?

Post by belugas »

Yes, both, indeed. As BOTH screenshots have shown :roll:
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
Rocker
Engineer
Engineer
Posts: 14
Joined: 22 Jul 2009 09:38
Location: Slovakia

Re: Change Name train?

Post by Rocker »

Wasila wrote:I never knew you could change the name of a train! Is that just for an individual train or a whole model?
Wasila, I have every train named by real train names of Europe, cos I don't like just simple Train 1,Train 2,Train 3... For me is it very opacity.
belugas wrote:Ho... and here is a little code snipset...

Code: Select all

enum {
MAX_LENGTH_VEHICLE_NAME_BYTES = 31, ///< The maximum length of a vehicle name in bytes including '\0'
MAX_LENGTH_VEHICLE_NAME_PIXELS = 150, ///< The maximum length of a vehicle name in pixels
};
Where can I find this items ? I've opened openttd.cfg but it wasn't there...Thanks
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Change Name train?

Post by Yexo »

Rocker wrote:
belugas wrote:Ho... and here is a little code snipset...
Where can I find this items ? I've opened openttd.cfg but it wasn't there...Thanks
You'll find it in some code-file, meaning you'll have to recompile the game to use it.
User avatar
Rocker
Engineer
Engineer
Posts: 14
Joined: 22 Jul 2009 09:38
Location: Slovakia

Re: Change Name train?

Post by Rocker »

Yexo wrote:You'll find it in some code-file, meaning you'll have to recompile the game to use it.
And do you know the name of the code file ? or something further about him...(download...)

I think I should start the google... :mrgreen:
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: Change Name train?

Post by TrueBrain »

Split topic from where Rocker had replied, as it had NOTHING to do with it. Rocker, please make sure next time you post a reply it is related to the topic ;)
The only thing necessary for the triumph of evil is for good men to do nothing.
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Change Name train?

Post by Roujin »

Rocker wrote:
Yexo wrote:You'll find it in some code-file, meaning you'll have to recompile the game to use it.
And do you know the name of the code file ? or something further about him...(download...)

I think I should start the google... :mrgreen:
Come on, just do a search on the src folder for files containing "MAX_LENGTH_VEHICLE_NAME_BYTES". I don't know what kind of OS you're using, but it should be possible..
Information on downloading the source and compiling the game is found here: http://wiki.openttd.org/FAQ_development
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: Change Name train?

Post by belugas »

It's incredible how much stuff Googles knows about OpenTTD.

Yes, believe me...
Just do a search for that MAX_LENGTH_VEHICLE_NAME_BYTES string, and check the results...
Man...

that reminds me....
http://2.bp.blogspot.com/_n4mb9JPongU/S ... 0074_2.JPG

Not the one I had in mind... but still...
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
Rocker
Engineer
Engineer
Posts: 14
Joined: 22 Jul 2009 09:38
Location: Slovakia

Re: Change Name train?

Post by Rocker »

Alright,
I have OpenTTD 0.7.2 source, OpenTTD 0.7.2 windows-win32 but the name of the train is still 25 characters...
I overwrote numbers in MAX_LENGTH_VEHICLE_NAME_BYTES ,PIXELS but it still without changes...
Can someone help please ? Thanks
Last edited by Rocker on 01 Aug 2009 14:16, edited 1 time in total.
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: Change Name train?

Post by CommanderZ »

Rocker wrote:Alright,
I have OpenTTD 0.7.2 source, OpenTTD 0.7.2 windows-win32 but the name of the train is still 25 characters...
I overwrote numbers in MAX_LENGTH_VEHICLE_NAME_BYTES ,PIXELS but is it still without changes...
Can someone help please ? Thanks
Did you compile the code? You have to build a custom exe file.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Change Name train?

Post by Alberth »

(in the same way that a hard-copy of a Word file does not change when you change the computer file, the compiled program of OpenTTD does not change when you change the source).

To make a new OpenTTD program with your changes in it, you'll have to compile the modified source yourself, there is a wiki page on how to do that.
(which is easy to find so don't bother asking).
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 1 guest