Incompetent Programmer...

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
vietgnome
Engineer
Engineer
Posts: 2
Joined: 27 Dec 2019 01:16

Incompetent Programmer...

Post by vietgnome »

Hello folks!

Well, after two days of trying to follow directions for NML and GRF and town creation, I have come to the conclusion (and probably 215 viruses from downloading every program to try and figger this out), I have to succumb to asking significant help in how to create a file so I can implement my original town names (from my fantasy world). I have downloaded python and have cut and pasted w.minchin's code, but I can't get it compiled as it has issues with line 10 probably because line 9 isn't right either. .... Sooo.. a huge favor to ask.. can someone cut and paste this into one of their already working town creation lists, rename it "Raden" so I can download it from the on-line catalog? I loved this game since it was released back in the day and was glad to stumble on this and wish I had some tech savvy.... Thanks in advance.

//
// Raden Town Names for OpenTTD
// Copyright 2019 by Thomas Caputo
// Wm = 57-6D (in Hex)
// Version 1, 2019-12-26
//

grf {
grfid: "\57\6D\AB\03";
name: string(STR_GRF_NAME);
desc: string(STR_GRF_DESCRIPTION);
version: 3;
min_compatible_version: 1;
}

town_names(A) {
styles: string(STR_GAME_OPTIONS_TOWN_NAME_RADEN);
{
text("Aluhs", 10),
text("Blackwood Springs", 1),
text("Dekoll", 1),
text("Northshore", 1),
text("Northwood Hamlet", 1),
text("Trall", 1),
text("Vestid", 1),
text("Woodwind Pass", 1),
text("Boledoon", 10),
text("Delgar", 10),
text("Arkrock", 1),
text("Crushstone", 1),
text("Deepforge", 1),
text("Dulagrar", 1),
text("Flintstock", 1),
text("Graniterock", 1),
text("Ironstone", 1),
text("Kamestone", 1),
text("Kevvelkor", 1),
text("Ronfrok", 1),
text("Silverhammer", 1),
text("Torok", 1),
text("Blackhammer", 1),
text("Breggid Rolk", 1),
text("Drunakal", 1),
text("Firehammer", 1),
text("Granitehome", 1),
text("Iron Ram", 1),
text("Sheerstone", 1),
text("Trukkanstone", 1),
text("Erenenlea", 10),
text("Glitterhome", 10),
text("Burrolan", 1),
text("Greenburrow", 1),
text("Isle of Laurren", 5),
text("Lakeshore", 10),
text("Blackstag", 1),
text("Madroo", 10),
text("Rantor", 1),
text("Sordren", 1),
text("Oran", 10),
text("Hill Home", 1),
text("Parrash", 1),
text("Vididar", 1),
text("Ulthorak", 10),
text("Bloodshade", 1),
text("Corisk's Bastion", 1),
text("Darkgate", 1),
text("Deddik Falls", 1),
text("Felkrax Drop", 1),
text("Frung Hall", 1),
text("Grimstone", 1),
text("Kusk", 1),
text("Lednar", 1),
text("Midpost", 1),
text("Rankwood", 1),
text("Rasp", 1),
text("Redwheat", 1),
text("Trulk", 1),
text("Walrin", 1),
text("Skorport", 10),
text("Illerdam", 1),
text("Lyone", 1),
text("Rintorin", 1),
text("Rional", 1),
text("Stockdale", 1),
text("Woodland", 1),
text("Naeth Everun", 1),
text("Benre Kroll", 1),
text("Hyacinth", 1),
text("Grellion Feryl", 1),
text("Fesceril", 1),
text("Uvae Laerith", 1),
text("Esperil Gala", 1),
text("Senterial", 1),
text("Davuth", 1),
text("Nuyutul", 1),
text("Duspis Perenth", 1),
text("Tuyil Rae", 1),
text("Alarantae", 1),
text("High Sigil", 1),
text("Crysalin", 1),
text("Lorimar Alista", 1),
text("Pillis Frea", 1),
text("Fallshaven", 1),
}
}
User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Incompetent Programmer...

Post by kamnet »

Did you also create a lang\english.lng file which defines the name and description strings? It should look like this:

Code: Select all

##grflangid 00

STR_GRF_NAME :Raven's Town Names
STR_GRF_DESCRIPTION :Description as seen in the NewGRF list 
STR_GAME_OPTIONS_TOWN_NAME_RAVEN :Raven's Town Names
vietgnome
Engineer
Engineer
Posts: 2
Joined: 27 Dec 2019 01:16

Re: Incompetent Programmer...

Post by vietgnome »

Nope.

If I cut and paste that and toss into a python file, that should do the trick?
User avatar
jfs
Tycoon
Tycoon
Posts: 1749
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Incompetent Programmer...

Post by jfs »

No, that goes into a file named "english.lng" in a subfolder named "lang". It's not Python code, it's an OTTD language definition file. (NML inherits the language file syntax from OTTD.)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Incompetent Programmer...

Post by planetmaker »

Grab the source of an existing NewGRF and adopt it for your purpose... (mind to use the same/appropriate license, if you do)

https://dev.openttdcoop.org/projects/townnames

Also checkout the tutorial / introduction: https://www.tt-wiki.net/wiki/NMLTutorial
User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Incompetent Programmer...

Post by kamnet »

vietgnome wrote: 27 Dec 2019 19:56 Nope.

If I cut and paste that and toss into a python file, that should do the trick?
You don't need any python scripting to do this. It's simple. Take your file (call it raven\raven.nml), and the code I just posted (raven\lang\english.lng). Run the NML compiler on the raven directory. Done.
audigex
Tycoon
Tycoon
Posts: 1997
Joined: 09 Dec 2007 21:28
Contact:

Re: Incompetent Programmer...

Post by audigex »

You don't even NEED to use an English.lng file - just put the strings directly into the NML code

It's not ideal in terms of the fact it doesn't allow for easy translation of the strings, but if you don't care about translations then it will work
Jon
Taschi
Route Supervisor
Route Supervisor
Posts: 425
Joined: 11 Oct 2014 22:58

Re: Incompetent Programmer...

Post by Taschi »

audigex wrote: 23 Jun 2021 13:00 You don't even NEED to use an English.lng file - just put the strings directly into the NML code

It's not ideal in terms of the fact it doesn't allow for easy translation of the strings, but if you don't care about translations then it will work
Yeah, that's not really good advice imo.
audigex
Tycoon
Tycoon
Posts: 1997
Joined: 09 Dec 2007 21:28
Contact:

Re: Incompetent Programmer...

Post by audigex »

Why not?

It's quick enough to change if anyone wants to provide a translation later, but saves OP some effort at this stage while they're starting out.

The vast majority of GRFs never receive any translations, as far as I can tell
Jon
Taschi
Route Supervisor
Route Supervisor
Posts: 425
Joined: 11 Oct 2014 22:58

Re: Incompetent Programmer...

Post by Taschi »

This may just be my futureproofing OCD talking but I feel like just ignoring i18n because it saves a bit of effort is not really a good practice.

And in order to enable it later the code would need to be available, as far as I understand it.
User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Incompetent Programmer...

Post by kamnet »

Why are we digging up an old topic where the OP gave up two years ago?
audigex
Tycoon
Tycoon
Posts: 1997
Joined: 09 Dec 2007 21:28
Contact:

Re: Incompetent Programmer...

Post by audigex »

Apologies, I think I found this thread in a search and then forgot I had it open, then replied later when browsing the forum more generally
Jon
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 11 guests