Difference between revisions of "NMLTutorial/Installation"

From TTWiki
Jump to navigationJump to search
(→‎Text editor: add a linux and osx editor)
 
(14 intermediate revisions by 9 users not shown)
Line 1: Line 1:
 
{{NMLTutorial}}
 
{{NMLTutorial}}
   
NML is written in Python and therefore can be made to run on every operating system that can run Python. This includes the popular operating sytems Linux, MacOS and Windows. Below you'll find a description on how to install NML and how to use the command-line NML program on your operating system (MacOS description currently missing, as I don't have that, but please add it).
+
NML is written in Python and therefore can be made to run on every operating system that can run Python. This includes the popular operating sytems Linux, Mac OS X and Windows. Below you will find a description on how to install NML and how to use the command-line NML program on your operating system.
   
 
{{Note|The NML Documentation reflects the latest state of the NML program. Make sure to update your NML regularly, especially if you find something not working that should work according to the documentation.}}
 
{{Note|The NML Documentation reflects the latest state of the NML program. Make sure to update your NML regularly, especially if you find something not working that should work according to the documentation.}}
Line 7: Line 7:
   
 
== Linux ==
 
== Linux ==
NML requires Python, the Python Image Library and PLY (Python Lex-Yacc). These three things are best installed from your package manager. If you're looking to compiling NML yourself, you also need the Python Setuptools. Note that NML currently only runs on Python 2.5 through 2.7, but not 3.x. Look for the following in your package manager:
+
NML requires Python, the Python Image Library and PLY (Python Lex-Yacc). These three things are best installed from your package manager. If you are looking to compiling NML yourself, you also need the Python Setuptools. Note that NML currently only runs on Python 2.5 through 2.7, but not 3.x. Look for the following in your package manager:
 
* python (you might already have this)
 
* python (you might already have this)
 
* python-imaging (pil)
 
* python-imaging (pil)
Line 13: Line 13:
 
* python-setuptools
 
* python-setuptools
   
=== Installing NML as precompiled binary (recommended) ===
+
=== Installing NML ===
  +
For Linux users, there are several ways to get NML. If you have Python 2.7, you can get it as precompiled binary. Otherwise you should be able to compile NML without too much effort. Pick the method of your choice below.
  +
  +
==== Installing NML as precompiled binary (recommended) ====
 
The latest version of NML is available as RPM package from the #openttdcoop DevZone. You can find it here: http://bundles.openttdcoop.org/nml/nightlies/LATEST/rpms/. This package is known to work on openSUSE and Red Hat (including Fedora and CentOS) distributions.
 
The latest version of NML is available as RPM package from the #openttdcoop DevZone. You can find it here: http://bundles.openttdcoop.org/nml/nightlies/LATEST/rpms/. This package is known to work on openSUSE and Red Hat (including Fedora and CentOS) distributions.
   
Line 21: Line 24:
 
yum install <nowiki>http://bundles.openttdcoop.org/nml/nightlies/LATEST/rpms/nml-rXXXX-suseYYYY.noarch.rpm</nowiki>
 
yum install <nowiki>http://bundles.openttdcoop.org/nml/nightlies/LATEST/rpms/nml-rXXXX-suseYYYY.noarch.rpm</nowiki>
   
Make sure to replace XXXX and YYYY in the url with the actual version numbers you found via the link above. Enter "y" when asked and when done don't forget to <code>exit</code> sudo again, preventing yourself from doing stupid things from this point.
+
Make sure to replace XXXX and YYYY in the url with the actual version numbers you found via the link above. Enter "y" when asked, and when done, do not forget to <code>exit</code> the root shell again, preventing yourself from doing stupid things from this point on.
   
=== Compiling NML yourself ===
+
==== Compiling NML yourself ====
The other option to get NML is to compile it yourself. First you need to get the source from http://bundles.openttdcoop.org/nml/nightlies/LATEST/ or via Mercurial checkout from http://hg.openttdcoop.org/nml (<code>hg clone <nowiki>http://hg.openttdcoop.org/nml</nowiki></code>).
+
The other option to get NML is to compile it yourself. First, you need to get the source from http://bundles.openttdcoop.org/nml/nightlies/LATEST/ or via Mercurial checkout from http://hg.openttdcoop.org/nml (<code>hg clone <nowiki>http://hg.openttdcoop.org/nml</nowiki></code>).
   
Also this time you need the terminal as superuser. Then change directory to the (extracted) NML source and run <code>python setup.py install</code>. For example:
+
Also, this time, you need the terminal as superuser. Then change directory to the (extracted) NML source and run <code>python setup.py install</code>. For example:
   
 
sudo bash
 
sudo bash
Line 34: Line 37:
   
 
=== Using NML ===
 
=== Using NML ===
As said before, NML is a command-line program and therefore doesn't have a GUI; much like GRFCodec in fact. That means you need to run it from a terminal window. The NML program itself is called <code>nmlc</code> and the general usage is <code>nmlc [options] <filename></code>. First change directory to the directory which has your nml file. Then run the nmlc program to compile your grf. For example:
+
As said before, NML is a command-line program and therefore does not have a GUI; much like GRFCodec, in fact. That means you need to run it from a terminal window. The NML program itself is called <code>nmlc</code> and the general usage is <code>nmlc [options] <filename></code>. First, change directory to the directory which has your nml file. Then run the nmlc program to compile your GRF. For example:
   
 
cd ~/grfs/mygrf
 
cd ~/grfs/mygrf
 
nmlc -c --grf mygrf.grf mygrf.nml
 
nmlc -c --grf mygrf.grf mygrf.nml
   
This will encode the nml file ~/grfs/mygrf/mygrf.nml into the grf file ~/grfs/mygrf/mygrf.grf. The -c option is not mandatory, but crops extraneous blue from sprites, reducing the filesize of the grf file.
+
This will encode the nml file ~/grfs/mygrf/mygrf.nml into the GRF file ~/grfs/mygrf/mygrf.grf. The <code>-c</code> option is not mandatory, but crops extraneous blue from sprites, reducing the filesize of the GRF file.
   
 
All command-line options available to NML are available via the <code>nmlc -h</code> command and are also [[#NML Command-line Options|listed]] on this page. Now that you have NML and know how to use it, you can continue this tutorial to learn how to create an actual grf file using NML.
 
All command-line options available to NML are available via the <code>nmlc -h</code> command and are also [[#NML Command-line Options|listed]] on this page. Now that you have NML and know how to use it, you can continue this tutorial to learn how to create an actual grf file using NML.
   
  +
== Windows ==
 
  +
== Mac OS X ==
NML is available as pre-built (32 bit) Windows executable from the #openttdcoop DevZone, so there is no need to compile it yourself.
 
  +
For Mac OS X, you are currently required to compile NML yourself, as there are no precompiled binaries available.
   
 
=== Installing NML ===
 
=== Installing NML ===
Go to http://bundles.openttdcoop.org/nml/nightlies/LATEST/ and download nml-rXXXX-windows-win32.zip, replacing XXXX with the actual version number of the package. The zip file contains a number of files that all need to stay together, so extract the zip file entirely into a single folder, for example D:\grfs\nml.
 
   
  +
Make sure you have python version 3.4 or higher and pip installed, as well as Setuptools.
If you leave it at this, you can already start to use NML, but only from that folder. This makes compiling grfs a bit more difficult as you have to write full paths when encoding a grf file. If you want to run NML from any directory, you need to add the directory containing the nmlc.exe executable to your PATH environment variable. As this can break Windows if you don't do this properly, we'll not be explaining this here and go for the long route instead. You're of course free to change your PATH yourself; if you do, you're probably also smart enough to know how to change the commands as explained in the section below.
 
  +
  +
After that, run these commands:
  +
  +
pip3 install ply
  +
pip3 install Pillow
  +
pip3 install nml
   
 
=== Using NML ===
 
=== Using NML ===
As said before, NML is a command-line program and therefore doesn't have a GUI; much like GRFCodec in fact. That means you need to run it from a command prompt window. You can start the command prompt from Start > Programs > Accessories > Command Prompt. Or by entering <code>cmd</code> into the Run dialog or the Start menu search bar.
+
As said before, NML is a command-line program and therefore does not have a GUI; much like GRFCodec, in fact. That means you need to run it from a command prompt window. You can start the command prompt by pressing <code>CMD+Space</code> to open Spotlight, and searching for "Terminal".
   
Next, you need to change directory to the folder where you have nmlc.exe in. Then you can run NML from there. For the example below we'll be assuming the following:
+
Next, you need to change directory to the project folder which has your NML (code) file in it. Then run the nmlc program to compile your GRF. For example:
* nmlc.exe and related files are in D:\grfs\nml
 
* The nml file you want to encode is D:\grfs\mygrf\mygrf.nml
 
* The grf file to be created needs to go into D:\grfs\mygrf\mygrf.grf
 
   
  +
~
From the command prompt you can now run the following commands, one at a time, confirm with Enter after each line:
 
  +
cd /Users/user/grfs/mygrf
  +
nmlc -c --grf mygrf.grf mygrf.nml
  +
  +
This will encode the nml file <code>/Users/user/grfs/mygrf.nml</code> into the GRF file <code>/Users/user/grfs/mygrf/mygrf.grf</code>. The <code>-c</code> option is not mandatory, but crops extraneous blue from sprites, reducing the filesize of the grf file. Note that if you have any spaces in a directory or file name, you need to enclose that complete path or filename in double quotes, e.g.: <code>cd "/Users/user/My Documents/mygrf"</code>. It is therefore recommended not to have any spaces.
  +
 
== Windows ==
 
NML is available as pre-built (64-bit) Windows executable from Github, so there is no need to compile it yourself.
  +
  +
=== Installing NML ===
  +
Go to https://github.com/OpenTTD/nml/releases to find the latest release, click on assets and download nml-standalone-XXXX-win64.zip
  +
, replacing XXXX with the actual version number of the package. The ZIP file contains a number of files. Where these files go depends on whether you want to take the easy route or do it properly.
  +
  +
==== Easy route ====
  +
The easy route is to extract the NML program file in the same directory as your NML project (where your file with the NML code and the directories with language and graphics files will go later). With this, you can use the NML program for this project alone. If you want to work on multiple NewGRF projects coded in NML, you need to copy the NML program file to each of these project directories.
  +
  +
==== Proper route ====
  +
If you want to run NML from any directory, you need to add the directory containing the nmlc.exe executable to your PATH environment variable. This can break Windows if you do not do it correctly, so follow the instructions carefully.
  +
  +
First, extract the NML program file to a directory of your choice, e.g. C:\tools\NML. It is preferred that you do not have spaces in the directory path, so avoid the "Program Files" directory. Once you have that, remember the directory path and follow these steps carefully:
  +
  +
'''Windows 7 or earlier:'''
  +
  +
# Rightclick "Computer" on the desktop or in the Start menu and select ''Properties''. This will open the System window from the Configuration Panel.
  +
# Click ''Advanced system settings'' in the left pane. This will open the System Properties window.
  +
# Click the ''Advanced'' tab.
  +
# On the Advanced tab, click the ''Environment Variables...'' button. This will open the Environment Variables window.
  +
# In the bottom half of the window below System variables, find the ''Path'' entry and select it.
  +
# With the Path entry selected, click the ''Edit...'' button. An edit box will appear.
  +
# '''Do not touch the Variable name and do not remove anything from the Variable value!''' (This is where you can break your computer.)
  +
# Put your cursor at the end of the ''Variable value'' box and type a semicolon followed by the directory path to the NML program, in this case <code>;C:\tools\NML</code>
  +
# Confirm your changes by clicking the ''OK'' button in each of the three windows.
  +
  +
'''Windows 8 and up:'''
  +
  +
# Either locate, or type "env" into the search bar, and click on 'Edit system environment variables'.
  +
# On the Advanced tab, click the ''Environment Variables...'' button. This will open the Environment Variables window.
  +
# In the bottom half of the window below System variables, find the ''Path'' entry and select it.
  +
# With the Path entry selected, click the ''Edit...'' button. An edit box will appear.
  +
# Click ''New'' and type in the path to your NML program, in the example case <code>C:\tools\NML</code>
  +
# '''Do not edit or remove any of the existing entries!'''
  +
# Confirm your changes by clicking the ''OK'' button in each of the three windows.
  +
  +
Now you can use the NML program from any directory on your computer.
  +
  +
=== Using NML ===
  +
As said before, NML is a command-line program and therefore does not have a GUI; much like GRFCodec, in fact. That means you need to run it from a command prompt window. You can start the command prompt from Start > Programs > Accessories > Command Prompt, or by entering <code>cmd</code> into the Run dialog or the Start menu search bar.
  +
  +
Next, you need to change directory to the project folder which has your NML (code) file in it. Then run the nmlc program to compile your GRF. For example:
   
 
D:
 
D:
cd D:\grfs\nml
+
cd D:\grfs\mygrf
nmlc -c --grf D:\grfs\mygrf\mygrf.grf D:\grfs\mygrf\mygrf.nml
+
nmlc -c --grf mygrf.grf mygrf.nml
   
This will encode the nml file D:\grfs\mygrf\mygrf.nml into the grf file D:\grfs\mygrf\mygrf.grf. The -c option is not mandatory, but crops extraneous blue from sprites, reducing the filesize of the grf file. Note that if you have any spaces in a folder or file name, you need to enclose the complete path in double quotes, e.g.: <code>nmlc -c --grf "D:\grfs\my grf\mygrf.grf" "D:\grfs\mgrf\mygrf.nml"</code>. It is therefore recommended not to have any spaces.
+
This will encode the nml file <code>D:\grfs\mygrf\mygrf.nml</code> into the GRF file <code>D:\grfs\mygrf\mygrf.grf</code>. The <code>-c</code> option is not mandatory, but crops extraneous blue from sprites, reducing the filesize of the grf file. Note that if you have any spaces in a directory or file name, you need to enclose that complete path or filename in double quotes, e.g.: <code>cd "D:\Users\Username\My Documents\mygrf"</code>. It is therefore recommended not to have any spaces.
   
 
All command-line options available to NML are available via the <code>nmlc -h</code> command and are also [[#NML Command-line Options|listed]] on this page. Now that you have NML and know how to use it, you can continue this tutorial to learn how to create an actual grf file using NML.
 
All command-line options available to NML are available via the <code>nmlc -h</code> command and are also [[#NML Command-line Options|listed]] on this page. Now that you have NML and know how to use it, you can continue this tutorial to learn how to create an actual grf file using NML.
Line 112: Line 166:
 
; Cross-platform
 
; Cross-platform
 
* [http://www.geany.org/ Geany]
 
* [http://www.geany.org/ Geany]
  +
* [https://code.visualstudio.com/ VS Code]
 
; Linux
 
; Linux
* [http://kate-editor.org/get-it/ Kate]
+
* [http://kate-editor.org/get-it/ Kate], vim
 
; MacOS
 
; MacOS
 
* XCode
 
* XCode
 
; Windows
 
; Windows
 
* [http://notepad-plus-plus.org/ Notepad++]
 
* [http://notepad-plus-plus.org/ Notepad++]
  +
* [https://www.sublimetext.com/ Sublime Text]
   
If you use an editor which you think is quite good and not listed here, you're welcome to add it.
+
If you use an editor which you think is quite good and not listed here, you are welcome to add it.
   
 
=== Syntax highlighting ===
 
=== Syntax highlighting ===
 
Syntax highlighting adds some colour to NML code, which makes it easier to read.
 
Syntax highlighting adds some colour to NML code, which makes it easier to read.
   
At the #openttdcoop DevZone there are syntax highlighter extensions available for [http://dev.openttdcoop.org/documents/24 Notepad++] and [http://dev.openttdcoop.org/documents/26 Geany]. If you want to create your own syntax highlighter, there's a [http://dev.openttdcoop.org/documents/25 script] available as well that will help you create the keyword lists.
+
At the #openttdcoop DevZone there are syntax highlighter extensions available for [https://marketplace.visualstudio.com/items?itemName=PNDA.nml-language VS Code], [http://dev.openttdcoop.org/documents/24 Notepad++] and [http://dev.openttdcoop.org/documents/26 Geany]. If you want to create your own syntax highlighter, there is a [http://dev.openttdcoop.org/documents/25 script] available as well that will help you create the keyword lists.
   
 
{{NMLTutorialNavbar||Graphic files}}
 
{{NMLTutorialNavbar||Graphic files}}

Latest revision as of 08:03, 26 October 2024

NML is written in Python and therefore can be made to run on every operating system that can run Python. This includes the popular operating sytems Linux, Mac OS X and Windows. Below you will find a description on how to install NML and how to use the command-line NML program on your operating system.

Notepad.png
Note
The NML Documentation reflects the latest state of the NML program. Make sure to update your NML regularly, especially if you find something not working that should work according to the documentation.


Linux

NML requires Python, the Python Image Library and PLY (Python Lex-Yacc). These three things are best installed from your package manager. If you are looking to compiling NML yourself, you also need the Python Setuptools. Note that NML currently only runs on Python 2.5 through 2.7, but not 3.x. Look for the following in your package manager:

  • python (you might already have this)
  • python-imaging (pil)
  • python-ply
  • python-setuptools

Installing NML

For Linux users, there are several ways to get NML. If you have Python 2.7, you can get it as precompiled binary. Otherwise you should be able to compile NML without too much effort. Pick the method of your choice below.

Installing NML as precompiled binary (recommended)

The latest version of NML is available as RPM package from the #openttdcoop DevZone. You can find it here: http://bundles.openttdcoop.org/nml/nightlies/LATEST/rpms/. This package is known to work on openSUSE and Red Hat (including Fedora and CentOS) distributions.

You can use the terminal to install this package through your package manager (make sure to run it as superuser). For example on Fedora:

sudo bash
yum install http://bundles.openttdcoop.org/nml/nightlies/LATEST/rpms/nml-rXXXX-suseYYYY.noarch.rpm

Make sure to replace XXXX and YYYY in the url with the actual version numbers you found via the link above. Enter "y" when asked, and when done, do not forget to exit the root shell again, preventing yourself from doing stupid things from this point on.

Compiling NML yourself

The other option to get NML is to compile it yourself. First, you need to get the source from http://bundles.openttdcoop.org/nml/nightlies/LATEST/ or via Mercurial checkout from http://hg.openttdcoop.org/nml (hg clone http://hg.openttdcoop.org/nml).

Also, this time, you need the terminal as superuser. Then change directory to the (extracted) NML source and run python setup.py install. For example:

sudo bash
cd ~/Downloads/nml-rXXXX
python setup.py install
exit

Using NML

As said before, NML is a command-line program and therefore does not have a GUI; much like GRFCodec, in fact. That means you need to run it from a terminal window. The NML program itself is called nmlc and the general usage is nmlc [options] <filename>. First, change directory to the directory which has your nml file. Then run the nmlc program to compile your GRF. For example:

cd ~/grfs/mygrf
nmlc -c --grf mygrf.grf mygrf.nml

This will encode the nml file ~/grfs/mygrf/mygrf.nml into the GRF file ~/grfs/mygrf/mygrf.grf. The -c option is not mandatory, but crops extraneous blue from sprites, reducing the filesize of the GRF file.

All command-line options available to NML are available via the nmlc -h command and are also listed on this page. Now that you have NML and know how to use it, you can continue this tutorial to learn how to create an actual grf file using NML.


Mac OS X

For Mac OS X, you are currently required to compile NML yourself, as there are no precompiled binaries available.

Installing NML

Make sure you have python version 3.4 or higher and pip installed, as well as Setuptools.

After that, run these commands:

pip3 install ply
pip3 install Pillow
pip3 install nml

Using NML

As said before, NML is a command-line program and therefore does not have a GUI; much like GRFCodec, in fact. That means you need to run it from a command prompt window. You can start the command prompt by pressing CMD+Space to open Spotlight, and searching for "Terminal".

Next, you need to change directory to the project folder which has your NML (code) file in it. Then run the nmlc program to compile your GRF. For example:

~
cd /Users/user/grfs/mygrf
nmlc -c --grf mygrf.grf mygrf.nml

This will encode the nml file /Users/user/grfs/mygrf.nml into the GRF file /Users/user/grfs/mygrf/mygrf.grf. The -c option is not mandatory, but crops extraneous blue from sprites, reducing the filesize of the grf file. Note that if you have any spaces in a directory or file name, you need to enclose that complete path or filename in double quotes, e.g.: cd "/Users/user/My Documents/mygrf". It is therefore recommended not to have any spaces.

Windows

NML is available as pre-built (64-bit) Windows executable from Github, so there is no need to compile it yourself.

Installing NML

Go to https://github.com/OpenTTD/nml/releases to find the latest release, click on assets and download nml-standalone-XXXX-win64.zip , replacing XXXX with the actual version number of the package. The ZIP file contains a number of files. Where these files go depends on whether you want to take the easy route or do it properly.

Easy route

The easy route is to extract the NML program file in the same directory as your NML project (where your file with the NML code and the directories with language and graphics files will go later). With this, you can use the NML program for this project alone. If you want to work on multiple NewGRF projects coded in NML, you need to copy the NML program file to each of these project directories.

Proper route

If you want to run NML from any directory, you need to add the directory containing the nmlc.exe executable to your PATH environment variable. This can break Windows if you do not do it correctly, so follow the instructions carefully.

First, extract the NML program file to a directory of your choice, e.g. C:\tools\NML. It is preferred that you do not have spaces in the directory path, so avoid the "Program Files" directory. Once you have that, remember the directory path and follow these steps carefully:

Windows 7 or earlier:

  1. Rightclick "Computer" on the desktop or in the Start menu and select Properties. This will open the System window from the Configuration Panel.
  2. Click Advanced system settings in the left pane. This will open the System Properties window.
  3. Click the Advanced tab.
  4. On the Advanced tab, click the Environment Variables... button. This will open the Environment Variables window.
  5. In the bottom half of the window below System variables, find the Path entry and select it.
  6. With the Path entry selected, click the Edit... button. An edit box will appear.
  7. Do not touch the Variable name and do not remove anything from the Variable value! (This is where you can break your computer.)
  8. Put your cursor at the end of the Variable value box and type a semicolon followed by the directory path to the NML program, in this case ;C:\tools\NML
  9. Confirm your changes by clicking the OK button in each of the three windows.

Windows 8 and up:

  1. Either locate, or type "env" into the search bar, and click on 'Edit system environment variables'.
  2. On the Advanced tab, click the Environment Variables... button. This will open the Environment Variables window.
  3. In the bottom half of the window below System variables, find the Path entry and select it.
  4. With the Path entry selected, click the Edit... button. An edit box will appear.
  5. Click New and type in the path to your NML program, in the example case C:\tools\NML
  6. Do not edit or remove any of the existing entries!
  7. Confirm your changes by clicking the OK button in each of the three windows.

Now you can use the NML program from any directory on your computer.

Using NML

As said before, NML is a command-line program and therefore does not have a GUI; much like GRFCodec, in fact. That means you need to run it from a command prompt window. You can start the command prompt from Start > Programs > Accessories > Command Prompt, or by entering cmd into the Run dialog or the Start menu search bar.

Next, you need to change directory to the project folder which has your NML (code) file in it. Then run the nmlc program to compile your GRF. For example:

D:
cd D:\grfs\mygrf
nmlc -c --grf mygrf.grf mygrf.nml

This will encode the nml file D:\grfs\mygrf\mygrf.nml into the GRF file D:\grfs\mygrf\mygrf.grf. The -c option is not mandatory, but crops extraneous blue from sprites, reducing the filesize of the grf file. Note that if you have any spaces in a directory or file name, you need to enclose that complete path or filename in double quotes, e.g.: cd "D:\Users\Username\My Documents\mygrf". It is therefore recommended not to have any spaces.

All command-line options available to NML are available via the nmlc -h command and are also listed on this page. Now that you have NML and know how to use it, you can continue this tutorial to learn how to create an actual grf file using NML.


NML Command-line Options

From the NML readme

Usage: nmlc [options] <filename>
Where <filename> is the nml file to parse

Options:
 --version             show program's version number and exit
 -h, --help            show this help message and exit
 -d, --debug           write the AST to stdout
 -s, --stack           Dump stack when an error occurs
 --grf=<file>          write the resulting grf to <file>
 --nfo=<file>          write nfo output to <file>
 -c                    crop extraneous transparent blue from real sprites
 -u                    save uncompressed data in the grf file
 --nml=<file>          write optimized nml to <file>
 -o <file>, --output=<file>
                       write output(nfo/grf) to <file>
 -t <file>, --custom-tags=<file>
                       Load custom tags from <file> [default:
                       custom_tags.txt]
 -l <dir>, --lang-dir=<dir>
                       Load language files from directory <dir> [default:
                       lang]
 -a <dir>, --sprites-dir=<dir>
                       Store 32bpp sprites in directory <dir> [default:
                       sprites]
 --default-lang=<file>
                       The default language is stored in <file> [default:
                       english.lng]
 --start-sprite=<num>  Set the first sprite number to write (do not use
                       except when you output nfo that you want to include in
                       other files)
 -p <palette>, --palette=<palette>
                       Force nml to use the palette <pal> [default: ANY].
                       Valid values are 'DOS', 'WIN', 'ANY'


Text editor

NML files and its language files are plain text files and should be edited in a plain text editor. Your operating system most likely comes with a text editor with limited functionality. As such it is recommended to choose an editor with more functionality:

Cross-platform
Linux
MacOS
  • XCode
Windows

If you use an editor which you think is quite good and not listed here, you are welcome to add it.

Syntax highlighting

Syntax highlighting adds some colour to NML code, which makes it easier to read.

At the #openttdcoop DevZone there are syntax highlighter extensions available for VS Code, Notepad++ and Geany. If you want to create your own syntax highlighter, there is a script available as well that will help you create the keyword lists.


NML Tutorial: Installation