Editing .lng files
Moderator: OpenTTD Developers
Editing .lng files
Hey i'm new!
Since you can't save your custom vehicle names in OTTD i wanted to change them in the .lng file. How can you edit them? which tools are needed?
Yeah i know there's an original vehicle name.lng file but it's in english and i'd like to have german language with the real vehicle names.
I'd also like to use the original models instead of sets. Can anyone help me with this?
Since you can't save your custom vehicle names in OTTD i wanted to change them in the .lng file. How can you edit them? which tools are needed?
Yeah i know there's an original vehicle name.lng file but it's in english and i'd like to have german language with the real vehicle names.
I'd also like to use the original models instead of sets. Can anyone help me with this?
Re: Editing .lng files
You can't actually change the .lng files, but if you get the source instead of a precompiled, you can edit the .txt files that get turned into the .lng ones.
Re: Editing .lng files
Or you can create a GRF; then you don't have to keep updating it and/or make sure it never gets overwritten.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Re: Editing .lng files
thx for your answers...but what's the easiest way to create a grf just for vehicle names? all that grf stuff looks complicated just for changing names.
thought that grf was for graphics only
thought that grf was for graphics only
Re: Editing .lng files
Same way you'd create any other GRF. Read the tutorial, read the relevant spec pages, download grfcodec and nforenum, open Notepad, and go for it.Rocketz wrote:thx for your answers...but what's the easiest way to create a grf just for vehicle names?
Not necessarily in that order, though.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Re: Editing .lng files
unfortunately the "nameyourvehicle" tutorial isn't ready yet
isn't there an easy way like creating a txt file:
[VehicleID] [VehicleName]
00 Train1
01 Train2
then some nice tool with which you can select the txt file and convert it to .grf or something.
or does anyone know if the save custom vehicle name feature will be fixed in the next ottd version?
isn't there an easy way like creating a txt file:
[VehicleID] [VehicleName]
00 Train1
01 Train2
then some nice tool with which you can select the txt file and convert it to .grf or something.
or does anyone know if the save custom vehicle name feature will be fixed in the next ottd version?
-
- Tycoon
- Posts: 1656
- Joined: 08 Jun 2007 08:00
Re: Editing .lng files
It can't be fixed because the saving of custom vehicle names is not implemented..
The buttons that give that option are only for legacy I guess.. Anyway, it's pretty easy to do it via newGRF.
-1 is the sprite number.. Renum will put it correct..
* shows that it's a pseudosprite
00 shows the count of bytes in the sprite.. it's actually a lot more, but Renum will fix that too
04 shows that it's Action4
00 shows that the it's changing a train name
7f shows that it changes the name for all languages. Unless you want to make it language specific, I think it's good to use 7f.. Not sure
01 means that we want to change only one string.
17 is the ID of the train so it knows what to substitute
and the last one is the string itself..
@DaleStan, Does the string need 00 added too to end? And if I made some mistakes explaining, please correct them Or anyone else
The buttons that give that option are only for legacy I guess.. Anyway, it's pretty easy to do it via newGRF.
So for a SH '30', it would beTTDPatch wiki, Action4 wrote: <Sprite-number> * <Length> 04 <feature> <language-id> <num-ent> <offset> <text>
Code: Select all
-1 * 00 04 00 7f 01 17 "My new awesome train"
* shows that it's a pseudosprite
00 shows the count of bytes in the sprite.. it's actually a lot more, but Renum will fix that too
04 shows that it's Action4
00 shows that the it's changing a train name
7f shows that it changes the name for all languages. Unless you want to make it language specific, I think it's good to use 7f.. Not sure
01 means that we want to change only one string.
17 is the ID of the train so it knows what to substitute
and the last one is the string itself..
@DaleStan, Does the string need 00 added too to end? And if I made some mistakes explaining, please correct them Or anyone else
Re: Editing .lng files
i would assume the 00 is missing at the end.
Re: Editing .lng files
What does NFORenum say?LordAzamath wrote:@DaleStan, Does the string need 00 added too to end?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
-
- Tycoon
- Posts: 1656
- Joined: 08 Jun 2007 08:00
Re: Editing .lng files
I just pulled it out of TTDP wiki and a bit from my memories.. Don't even have any [*]TTD[*] installed atm. Nor I had any renum downloaded..
Generally I could of just got them too, but I really don't think I'd do any coding in next few months (even not lua scripting), so I just wrote what I knew without making too big investments into backing it up.
Generally I could of just got them too, but I really don't think I'd do any coding in next few months (even not lua scripting), so I just wrote what I knew without making too big investments into backing it up.
Re: Editing .lng files
ty very much it worked
i just had to add
0 * 4 0D 00 00 00
1 * 8 08 06 "TW" 03 05 00 00
in the nfo file also to be able to activate the .grf i hope no graphics will be messed up using the first line...but it doesn't work without it
now i just have to change the names
i just had to add
0 * 4 0D 00 00 00
1 * 8 08 06 "TW" 03 05 00 00
in the nfo file also to be able to activate the .grf i hope no graphics will be messed up using the first line...but it doesn't work without it
now i just have to change the names
Re: Editing .lng files
the first line tells how many lines you have in your NFO file (you can leave that on 00 00 00 00 and grfcodec will tell you what it thinks it should add there), in the second line you can give a name and a description for your grf. none of these "mess up" anything
-
- Engineer
- Posts: 2
- Joined: 27 Jan 2021 13:33
Re: Editing .lng files
I want to create a lang file in my mother language and generate to the game. is there have any ways to do it? pls
Re: Editing .lng files
Please see this thread: viewtopic.php?t=86894mohomed imam wrote: ↑24 Jan 2022 07:51 I want to create a lang file in my mother language and generate to the game. is there have any ways to do it? pls
Short answer: It's a lot of work starting a new language translation up. It can be done, but on your own it's hard.
Who is online
Users browsing this forum: No registered users and 27 guests