NML - a Newgrf Meta Language

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

Moderator: Graphics Moderators

frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: NML - a Newgrf Meta Language

Post by frosch »

Looks like you are using NML 0.2. Currently we are about to release 0.4.1.
Get a new NML from here: http://bundles.openttdcoop.org/nml/push/LATEST/
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NML - a Newgrf Meta Language

Post by planetmaker »

NML 0.4.1 released

This release is a bug-fix release aimed mostly for the package maintainers. Thanks goes mostly to frosch who did most of the fixes.

Code: Select all

0.4.1 (2015-04-12)
------------------------------------------------------------------------
- Add: second_rocky_tileset
- Add: Build-in function 'getbits'
- Change: Try to improve packaging by applying some in-built automatisms via find_package() (oberhumer) (issue #7540)
- Fix: Building source bundle was broken
- Fix: Version identification for tags
- Doc: Update readme with python version info
- Cleanup: Remove pre-OpenTTD-1.1 wrappers for SHIFT_LEFT, SHIFT_RIGHT and SHIFTU_RIGHT.
- Cleanup: Remove bootstrap
As usual, get it from the DevZone's bundle server:
This release: http://bundles.openttdcoop.org/nml/releases/0.4.1/
Latest development release: http://bundles.openttdcoop.org/nml/push/LATEST/
User avatar
MinchinWeb
Traffic Manager
Traffic Manager
Posts: 225
Joined: 01 Feb 2011 12:41
Contact:

Re: NML - a Newgrf Meta Language

Post by MinchinWeb »

Has the option of posting NML to pypi ever been considered? It seems you need a working Python installation to use NML anyway, so would not installation at that point via pip would be fairly simple?
Alberta Town Names - 1500+ real names from 'Acme' to 'Zama City'
MinchinWeb's Random Town Name Generator - providing 2 million plus names...
WmDOT v13 - An AI that doubles as your highway department
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NML - a Newgrf Meta Language

Post by planetmaker »

MinchinWeb wrote:Has the option of posting NML to pypi ever been considered? It seems you need a working Python installation to use NML anyway, so would not installation at that point via pip would be fairly simple?
Yes.
It's on my list of things to figure out. Mostly it seems to need some (not so trivial) changes to the build process.
And it needs figuring out the password to the nml account which obviously was created ages ago by people who are not around anymore.
abregado
Engineer
Engineer
Posts: 35
Joined: 02 Apr 2015 22:39

Re: NML - a Newgrf Meta Language

Post by abregado »

frosch wrote:Looks like you are using NML 0.2. Currently we are about to release 0.4.1.
Get a new NML from here: http://bundles.openttdcoop.org/nml/push/LATEST/
Yes it seems somehow I ended up with 0.2.0.
Install 0.4.1 and now Im back to python3 issues! haha

Also, you probably know this but the documentation in a lot of places still says NML is not python3 compatible
https://pythonhosted.org/nml/nml-language.html

Also, in the README it says that there is a setup.py but I couldnt find it in the tarball.
abregado
Engineer
Engineer
Posts: 35
Joined: 02 Apr 2015 22:39

Re: NML - a Newgrf Meta Language

Post by abregado »

actually I found it. I had the x86_64.tar which doesn't include the setup.py
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NML - a Newgrf Meta Language

Post by planetmaker »

abregado wrote:
frosch wrote:Looks like you are using NML 0.2. Currently we are about to release 0.4.1.
Get a new NML from here: http://bundles.openttdcoop.org/nml/push/LATEST/
Yes it seems somehow I ended up with 0.2.0.
Install 0.4.1 and now Im back to python3 issues! haha

Also, you probably know this but the documentation in a lot of places still says NML is not python3 compatible
https://pythonhosted.org/nml/nml-language.html

Also, in the README it says that there is a setup.py but I couldnt find it in the tarball.
The documentation you link is as old as the nml you seem to have gotten - an unmaintained old version. The official documentation is at our NewGRF wiki: http://newgrf-specs.tt-wiki.net/wiki/NML:Main and the one shipped with NML itself within the readme and man page. The official download location, the only one which is updated by us directly, is our DevZone's bundle server: http://bundles.openttdcoop.org/nml/releases/0.4.1/

As to setup.py, it is in the source release: http://bundles.openttdcoop.org/nml/rele ... 4.1.tar.gz and not needed for the other binary releases.
abregado
Engineer
Engineer
Posts: 35
Joined: 02 Apr 2015 22:39

Re: NML - a Newgrf Meta Language

Post by abregado »

Yeah I read through the old documentation and followed those steps before I started, which is where I was lead astray. Its all good now, I've gotten it working. Thanks for your help.
User avatar
3iff
Tycoon
Tycoon
Posts: 1094
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: NML - a Newgrf Meta Language

Post by 3iff »

I'm using NML 0.4.0 in a windows console.

When compiling, I always get lots of <[K (where the < is actually a left arrow).

Is this because the windows console can't handle the escape codes? I'm not worried because it compiles fine, it's just one thing that bugs me a bit...but I can live with it.
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: NML - a Newgrf Meta Language

Post by frosch »

Those are ANSI control characters, which make the output look nice on unixy systems. Noone bothered to make it look nice on windows. They cause no harm though.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Eddi
Tycoon
Tycoon
Posts: 8269
Joined: 17 Jan 2007 00:14

Re: NML - a Newgrf Meta Language

Post by Eddi »

i suppose windows at some point forgot the ability to interpret ANSI codes, and replaced it with their proprietary garbage.
User avatar
3iff
Tycoon
Tycoon
Posts: 1094
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: NML - a Newgrf Meta Language

Post by 3iff »

Eddi wrote:i suppose windows at some point forgot the ability to interpret ANSI codes, and replaced it with their proprietary garbage.
I think it's that exactly. I wasn't overly concerned, just curious... It's been churning out those characters for months and only my programming mistakes were throwing out errors.
TadeuszD
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 07 Nov 2011 19:32
Location: PL

Re: NML - a Newgrf Meta Language

Post by TadeuszD »

I'm using Windows console (cmd.exe) too. These ANSI codes looks strange...
The new parameter to disable colours in nml compiler output will be nice feature. ;)
Image
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NML - a Newgrf Meta Language

Post by planetmaker »

TadeuszD wrote:I'm using Windows console (cmd.exe) too. These ANSI codes looks strange...
The new parameter to disable colours in nml compiler output will be nice feature. ;)
I pushed a small change which checks for the presence of a posix platform when using the colour codes. Thus maybe it's solved with today's nightly
User avatar
3iff
Tycoon
Tycoon
Posts: 1094
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: NML - a Newgrf Meta Language

Post by 3iff »

Finally got around to trying this...NML version 5655.

←[K nmlc info: 0 sprites, 0 cached, 0 orphaned, 0 duplicates, 0 newly encoded (native)
←[K nmlc info: Town names: 22/128
←[Kting output ...←[KK

I'm still getting the control codes. It's NOT a problem but I thought I should update you.
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: NML - a Newgrf Meta Language

Post by Wahazar »

I have newgrf with many vehicles, vehicle own names are stored in separate strings and does not need to be translated and bug out translators.
Is it possible to make them 'invisible' for translation system?
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NML - a Newgrf Meta Language

Post by planetmaker »

McZapkie wrote:I have newgrf with many vehicles, vehicle own names are stored in separate strings and does not need to be translated and bug out translators.
Is it possible to make them 'invisible' for translation system?
No, that's not (easily) possible. Also it's easy for a translator to just click 'copy' and be done with it.
Eddi
Tycoon
Tycoon
Posts: 8269
Joined: 17 Jan 2007 00:14

Re: NML - a Newgrf Meta Language

Post by Eddi »

the not-easy way would be to split the lang file into two, one translatable and one not, and join them on compilation, then point the translator tool only to one of the files.
User avatar
GarryG
Tycoon
Tycoon
Posts: 5876
Joined: 14 Feb 2015 00:44
Location: Newcastle, Australia

Re: NML - a Newgrf Meta Language

Post by GarryG »

Wonder if this right place to ask. Been trying to learn how to use the NML. Managed to make a Town Names, but not having much luck learning to do any thing else. I like to try doing either Objects or a Industry.

I been trying to under stand the NML Tutorial, but afraid not having much luck. I tried months ago to make railway graphics but unsuccessful even with the image blown out 4 times it normal size as so pixelated.

So I thinking maybe try drawing building graphics be easier as they larger.

Wonder if anyone there could make me up a simple program to include a NML file, lang file and one or two sprites so I can try get the gist of it for Industry and Object.

Or if I make some graphics can someone code them for me?

Thank you kindly
Soot Happens
Screenshot Of The Month Winner March 2020
All my projects are GPLv2 License unless stated.
Auz Road Sets: viewtopic.php?f=29&t=87335
Auz Project Releases: viewtopic.php?f=67&t=84725
Auz Trains: http://www.tt-forums.net/viewtopic.php?f=26&t=74193
Auz Industry Sets: http://www.tt-forums.net/viewtopic.php?f=26&t=74471
Auz Objects: viewtopic.php?f=26&t=75657
Auz Bridges: viewtopic.php?f=26&t=75248
Auz Stations: viewtopic.php?f=26&t=76390
Auz Tracks: viewtopic.php?f=26&t=82691
Auz Subway Stations: viewtopic.php?f=26&t=85335
Auz Eyecandy TramTracks: viewtopic.php?t=89908
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NML - a Newgrf Meta Language

Post by planetmaker »

GarryG wrote:Wonder if this right place to ask. Been trying to learn how to use the NML. Managed to make a Town Names, but not having much luck learning to do any thing else. I like to try doing either Objects or a Industry.

I been trying to under stand the NML Tutorial, but afraid not having much luck. I tried months ago to make railway graphics but unsuccessful even with the image blown out 4 times it normal size as so pixelated.

So I thinking maybe try drawing building graphics be easier as they larger.

Wonder if anyone there could make me up a simple program to include a NML file, lang file and one or two sprites so I can try get the gist of it for Industry and Object.

Or if I make some graphics can someone code them for me?

Thank you kindly
This is the thread for asking questions on how to use NML specifically, about programming in NML or problems installing it - not a "looking for coder" or "how to create graphics". The make-nml repository on the DevZone contains a very simplistic one-sprite NewGRF, so you might want to checkout that repo. Alternatively get any other simple one. OpenGFX+Landscape is big, but has a few simple objects included as well, each in its own source file. Objects can, however, take many forms and shapes, so it highly depends on what you want to make. OpenGFX+Industries has many industries, but is not exactly complicated either, also well-structured.
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 20 guests