Page 1 of 1

Incompetent Programmer...

Posted: 27 Dec 2019 01:25
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),
}
}

Re: Incompetent Programmer...

Posted: 27 Dec 2019 06:08
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

Re: Incompetent Programmer...

Posted: 27 Dec 2019 19:56
by vietgnome
Nope.

If I cut and paste that and toss into a python file, that should do the trick?

Re: Incompetent Programmer...

Posted: 27 Dec 2019 20:21
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.)

Re: Incompetent Programmer...

Posted: 28 Dec 2019 00:48
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

Re: Incompetent Programmer...

Posted: 28 Dec 2019 17:50
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.

Re: Incompetent Programmer...

Posted: 23 Jun 2021 13:00
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

Re: Incompetent Programmer...

Posted: 23 Jun 2021 13:05
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.

Re: Incompetent Programmer...

Posted: 23 Jun 2021 14:45
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

Re: Incompetent Programmer...

Posted: 23 Jun 2021 14:48
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.

Re: Incompetent Programmer...

Posted: 23 Jun 2021 23:21
by kamnet
Why are we digging up an old topic where the OP gave up two years ago?

Re: Incompetent Programmer...

Posted: 06 Jul 2021 17:14
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