No. Which rail type gets selected first depends on the user's settings, and NewGRF can't influence that.
Various NML related questions
Moderator: Graphics Moderators
Re: Various NML related questions
Re: Various NML related questions
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
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?
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
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?
- 2TallTyler
- Route Supervisor
- Posts: 505
- Joined: 11 Aug 2019 18:15
- Contact:
Re: Various NML related questions
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
https://github.com/2TallTyler/town_names
Re: Various NML related questions
IHi guys,
is this because I am using old nmlc?
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 !
Škoda - Praga - Tatra - Karosa - Oasa - Prima TL - Zliner - TAM BUS - SOR - Novoplan - Granus - Slovbus - Tedom - Irisbus - Iveco
Woof !
Re: Various NML related questions
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
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
Re: Various NML related questions
I am getting the same with the newest stable windows one I could find.
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?
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
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 !
Škoda - Praga - Tatra - Karosa - Oasa - Prima TL - Zliner - TAM BUS - SOR - Novoplan - Granus - Slovbus - Tedom - Irisbus - Iveco
Woof !
Re: Various NML related questions
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)
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)
Re: Various NML related questions
Thank you!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)
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 !
Škoda - Praga - Tatra - Karosa - Oasa - Prima TL - Zliner - TAM BUS - SOR - Novoplan - Granus - Slovbus - Tedom - Irisbus - Iveco
Woof !
Re: Various NML related questions
I'm having trouble figuring out how to set the size and position of bounding boxes in NML, particularly for catenary sprites. While the spritelayout page of the specs mentions x, y and z extents and offsets, road and railtypes do not use sprite layouts, and the other spec pages make no mention of how to set the size or position of the bounding box, and only mention the 2d height and width of pixels in the png.
In the below image, trolleywire from my GRF has a bounding box the size of the entire tile, while rails from Termite have a bounding box the size of the wire itself - just a few px wide and tall.
The template I use for my wires is as such:
For Unspooled this works ok, but for another GRF I am working on now, I really need to set the box to a smaller size, approx 6px wide and 5px tall. I have no idea how to do this...
In the below image, trolleywire from my GRF has a bounding box the size of the entire tile, while rails from Termite have a bounding box the size of the wire itself - just a few px wide and tall.
The template I use for my wires is as such:
Code: Select all
template tmpl_wire_normal() { //regular catenary sprites
[ 10, 10, 64, 31, -31, 0] // '\''
[ 80, 10, 64, 31, -31, 0] // '/'
Re: Various NML related questions
Afaik you can't make it smaller except in buildings, objects and vehicles. Bounding boxes are only used as a guide to avoid graphical glitches and for deciding the position of the sprite(s). It is independent of template and cannot be moved.
Railway and Tramway bounding boxes acts different, tramways have two wires a front and back while railways only have one.
I think there is no issue regarding how small you're drawing the wire, unless you're making very large sprite that overlaps bounding boxes that make graphical glitches.
Railway and Tramway bounding boxes acts different, tramways have two wires a front and back while railways only have one.
I think there is no issue regarding how small you're drawing the wire, unless you're making very large sprite that overlaps bounding boxes that make graphical glitches.
Fromerly known as Alon
Re: Various NML related questions
I wish to prevent players from building several industries of the same type in one city.
For this purpose I use callback location_check.
Is there any way to show the default error "only one allowed per town"?
If I return CB_RESULT_LOCATION_DISALLOW I got an error "site unsuitable"
For this purpose I use callback location_check.
Is there any way to show the default error "only one allowed per town"?
If I return CB_RESULT_LOCATION_DISALLOW I got an error "site unsuitable"
Re: Various NML related questions
as far as i can see on first glance, this is currently not possible, but it should be fairly straightforward to add to the specs and implement
Re: Various NML related questions
Just use string(STR_ERROR_ONLY_ONE_ALLOWED_PER_TOWN) as check location result, or add own string to the lang file.
Re: Various NML related questions
It looks like it's also a string in the lang file
Code: Select all
nmlc ERROR: "src/lifesupport.pnml", line 231: Unknown string "STR_ERROR_ONLY_ONE_ALLOWED_PER_TOWN"
Re: Various NML related questions
Can Nmlc extract a .grf file to it's original folder hierarchy? As in reverse compiling?
Re: Various NML related questions
Okay, In that case what I'm attempting to get at is that I'd like to have a base folder with everything ready for compiling through Nmlc. As in a template say for train sets or town set. The only thing that would need dynamic variation is the sprites for each tile.
Someone (2TallTyler) above was nice enough to provide Town-Name Set Template, which works great.
I have minimal coding know-how.
Someone (2TallTyler) above was nice enough to provide Town-Name Set Template, which works great.
I have minimal coding know-how.
What is the benefit of getting nfo/gfx data in relation to Nmlc?
Re: Various NML related questions
The only benefit is to retrieve images (if original source is not available).
But if you need some nml examples, most newgrfs are public domain and their source code is published.
See for example https://dev.openttdcoop.org/projects - rather obsolete city but there is lot of simple projects,
some might be helpful to understand nml for beginners.
- LaDoncella
- Traffic Manager
- Posts: 249
- Joined: 28 Sep 2004 16:01
- Contact:
Re: Various NML related questions
as i mentioned in this thread viewtopic.php?f=68&t=88956
Have vehicle animations been changed at some point, or they are broken in 0.5.3?
Have vehicle animations been changed at some point, or they are broken in 0.5.3?
Re: Various NML related questions
I'm quite sure animations are not broken in NML, and I don't think anything has changed recently in that department. It is likely the animation code in eGRVTS2 is wrong somehow and NML simply became more strict since whatever version it used before, I guess that might depend how ancient the NML version was which was used previously. I can't seem to find the NML source of eGRVTS2 anywhere with a quick search so I can't speculate what the actual issue may be. But unless a bug was introduced to NML somewhere and no one noticed yet, it's almost certainly an issue with the code in the set, not NML itself.LaDoncella wrote: ↑02 Jun 2021 16:03 as i mentioned in this thread viewtopic.php?f=68&t=88956
Have vehicle animations been changed at some point, or they are broken in 0.5.3?
Who is online
Users browsing this forum: No registered users and 23 guests