Various NML related questions

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

User avatar
Andrew350
Director
Director
Posts: 636
Joined: 19 Dec 2011 07:54
Location: Washington State, USA
Contact:

Re: Various NML related questions

Post by Andrew350 »

McZapkie wrote: 12 Dec 2020 10:06 Is it possible to define default track type in menu (not the first one)?
Let say I have 3 tracktype, Slow, Medium, Fast, they appear in menu in such order,
any means to force Medium to be first choice when track menu is opened?
No. Which rail type gets selected first depends on the user's settings, and NewGRF can't influence that.
User avatar
paritcl3s
Engineer
Engineer
Posts: 9
Joined: 15 Jun 2020 08:01

Re: Various NML related questions

Post by paritcl3s »

Am currently trying to make a town name .grf.
I'm fresh to the task and have never made an attempt at a graphics pack.
So far I've tried deriving an .nfo from the elder scrolls name .grf.
nmlc --nfo=<file>

It returned a copy

Code: Select all

// 2 * 98	 08 07 "JS" 0F 01 "The Elder Scrolls Town Names" 00
	 8A "Coded Together by Jan Skoch" 0D 93 "GNU "
	 "GPL v2" 0D 91 "Version # 2013.04.26" 00
    3 * 1630	 0F 00 01 90 00 08 01 "Alftand" 00 01 "Arkngthamz" 00 01 "Avanchnzel" 00
	 01 "Blackreach" 00 01 "Bthalft" 00 01 "Bthardamz" 00
	 01 "Fahlbtharz" 00 01 "Irkngthand" 00 01 "Kagrenzel" 00
	 01 "Kagrumez" 00 01 "Mzinchaleft" 00 01 "Mzulft" 00 01
	 "Nchardak" 00 01 "Nchuand-Zel" 00 01 "Raldbthar" 00
It goes on like that basically.

The --nml output states lang/english.lng doesn't exit so not sure where to turn. Is there any template to follow for folder hierarchy for proper compilation?
User avatar
2TallTyler
Traffic Manager
Traffic Manager
Posts: 249
Joined: 11 Aug 2019 18:15
Location: Massachusetts, USA
Contact:

Re: Various NML related questions

Post by 2TallTyler »

Here’s a link to my town names repository. Each state is a separate NewGRF and NML project and there’s a makefile to compile them all using nmlc. Using NML is much easier than NFO.

https://github.com/2TallTyler/town_names
User avatar
Greyfur
Engineer
Engineer
Posts: 61
Joined: 31 Oct 2004 12:43
Location: Slovakia - Bratislava
Contact:

Re: Various NML related questions

Post by Greyfur »

IHi guys,

is this because I am using old nmlc?

Code: Select all

H:\CSBusSet\!!!!!!!!!!!!!!!!!!!!>nmlc CSBusSetN4.5.5.nml
[Knmlc ERROR: nmlc: An internal error has occurred:
nmlc-version: v6379:afad0c76c40b from 2017-06-19
Error:    (IndexError) "pop from empty list".
Command:  ['nmlc', 'CSBusSetN4.5.5.nml']
Location: File "nml\actions\action4.py", line 170, in get_string_action4s 
My project: CS Bus Set viewtopic.php?f=26&t=87962

Škoda - Praga - Tatra - Karosa - Oasa - Prima TL - Zliner - TAM BUS - SOR - Novoplan - Granus - Slovbus - Tedom - Irisbus - Iveco

Woof !
Eddi
Tycoon
Tycoon
Posts: 7563
Joined: 17 Jan 2007 00:14

Re: Various NML related questions

Post by Eddi »

in any case, NML shouldn't be crashing with an "internal error" like that, but return a proper error message about what is actually wrong with your code, so you should probably update, and report it with the code that triggers it if the problem persists

the typical cause for this kind of error is that some kind of ID-pool ran out, which may be fixable by rearranging some code
You might not exactly be interested in Ferion, but if you are, have fun :)
User avatar
Greyfur
Engineer
Engineer
Posts: 61
Joined: 31 Oct 2004 12:43
Location: Slovakia - Bratislava
Contact:

Re: Various NML related questions

Post by Greyfur »

I am getting the same with the newest stable windows one I could find.

Code: Select all

C:\NML>nmlc CSBusSetN4.5.5.nml
 nmlc ERROR: nmlc: An internal error has occurred:
nmlc-version: 0.5.0
Error:    (IndexError) "pop from empty list".
Command:  ['nmlc', 'CSBusSetN4.5.5.nml']
Location: File "nml\actions\action4.py", line 170, in get_string_action4s
the only difference is the text is now in red.

Are there any limits on how many vehicles, lines of code, switches, text lines in language file, etc there could be?
My project: CS Bus Set viewtopic.php?f=26&t=87962

Škoda - Praga - Tatra - Karosa - Oasa - Prima TL - Zliner - TAM BUS - SOR - Novoplan - Granus - Slovbus - Tedom - Irisbus - Iveco

Woof !
Eddi
Tycoon
Tycoon
Posts: 7563
Joined: 17 Jan 2007 00:14

Re: Various NML related questions

Post by Eddi »

there are many such limits, and nmlc usually outputs a statistics of how close you are to any of these limits. (if it doesn't crash, that is)

if it crashes with action4, you're probably running out of StringIDs (any string that's not a vehicle name, and there's like 1024 IDs available)
You might not exactly be interested in Ferion, but if you are, have fun :)
User avatar
Greyfur
Engineer
Engineer
Posts: 61
Joined: 31 Oct 2004 12:43
Location: Slovakia - Bratislava
Contact:

Re: Various NML related questions

Post by Greyfur »

Eddi wrote: 06 Jan 2021 08:25 there are many such limits, and nmlc usually outputs a statistics of how close you are to any of these limits. (if it doesn't crash, that is)

if it crashes with action4, you're probably running out of StringIDs (any string that's not a vehicle name, and there's like 1024 IDs available)
Thank you! :bow:

I didn't know there was such a limit. I will most likely have to split my grf in two or three parts I guess. I plan to do a reduction of duplicates, but with how much I will still have to add, it would definitely not fit into a 1024 limit.
My project: CS Bus Set viewtopic.php?f=26&t=87962

Škoda - Praga - Tatra - Karosa - Oasa - Prima TL - Zliner - TAM BUS - SOR - Novoplan - Granus - Slovbus - Tedom - Irisbus - Iveco

Woof !
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 2 guests