NML - a Newgrf Meta Language

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

Moderator: Graphics Moderators

User avatar
stefino_cz
Transport Coordinator
Transport Coordinator
Posts: 268
Joined: 02 Jul 2015 08:05
Location: Czech Republic
Contact:

Re: NML - a Newgrf Meta Language

Post by stefino_cz »

Thanks a lot for the informations :)
Image
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: NML - a Newgrf Meta Language

Post by Wahazar »

How to fix my newgrf written in nml to display track icon in menu?
All track have icon except my 600mm set.
Where these icons are defined?
600mmg.png
600mmg.png (33.98 KiB) Viewed 15623 times
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.
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1728
Joined: 30 Mar 2005 09:43

Re: NML - a Newgrf Meta Language

Post by peter1138 »

https://newgrf-specs.tt-wiki.net/wiki/Action3/Railtypes

GUI Sprites (00)

This was literally the first part of the spec for railtype graphics ;-)

https://newgrf-specs.tt-wiki.net/wiki/N ... le_sprites

(Contrary to what the NML spec claims, this is not a callback, it's a "cargo" ID)
He's like, some kind of OpenTTD developer.
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: NML - a Newgrf Meta Language

Post by Wahazar »

Hah, problem solved - my track sprite is displayed, but has same gray color as menu background...
Sneak 100 :)
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.
Supercheese
Tycoon
Tycoon
Posts: 1660
Joined: 16 Dec 2007 22:24
Location: Idaho, USA

Re: NML - a Newgrf Meta Language

Post by Supercheese »

Perhaps more like: Hack 100

:wink:
Eyecandy Road Vehicles | Fake Subways | Supercheese's NewObjects

"Fashions and cultures change, but steam trains shall always be majestic."
-Professor Hershel Layton
User avatar
FulliAutomatix
Engineer
Engineer
Posts: 119
Joined: 24 Aug 2014 12:20
Location: Kaon Prison, Cybertron

Re: NML - a Newgrf Meta Language

Post by FulliAutomatix »

Hello, I'm trying to get compile this nightly version of NMLC in order to compile an industry that has more than 3 input and 2 output cargo types.
I followed the instructions on the github repo about installation successfully, but when I attempt to run nmlc from any folder in my computer I get the error at the bottom (I included the other commands to show that I did just install PIL and PLY is installed too).
[+] Spoiler
Image
Anybody able to help me out on this? Thanks.
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: NML - a Newgrf Meta Language

Post by Eddi »

looks like some version incompatibility to me...
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: NML - a Newgrf Meta Language

Post by SimYouLater »

Code: Select all

=======StarRaid's NML patcher!=======

Attempting to backup IH_AddonSet.nml
Successfully backed up to "backups/IH_AddonSet-03-00-36-2019-05-18.nml"!
Output : IH_AddonSet.nml
File : IH_AddonSet.pnml
Backup : 1
Verbose : 1
Opening "IH_AddonSet.pnml" as the main header.
Patched src/header.pnml with no errors.
Patched src/cyclops.pnml with no errors.
Patched src/electra.pnml with no errors.
Patched src/quicksilver.pnml with no errors.
[Knmlc ERROR: nmlc: An internal error has occurred:
nmlc-version: v6379:afad0c76c40b from 2017-06-19
Error:    (UnicodeEncodeError) "'charmap' codec can't encode character '\u202c' in position 19: character maps to <undefined>".
Command:  ['nmlc', 'IH_AddonSet.nml', '-o', 'IH_AddonSet.grf']
Location: File "c:\python\32-bit\3.3\lib\encodings\cp437.py", line 19, in encode
What is wrong with my pybuild.bat?!

EDIT: NML files must be coded in ANSI to work, apparently.
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: NML - a Newgrf Meta Language

Post by Eddi »

SimYouLater wrote:EDIT: NML files must be coded in ANSI to work, apparently.
no, but you can't mix it.
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: NML - a Newgrf Meta Language

Post by SimYouLater »

Eddi wrote:
SimYouLater wrote:EDIT: NML files must be coded in ANSI to work, apparently.
no, but you can't mix it.
I didn't mix it. Nothing worked until I converted to ANSI.
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
SomeIndianGuy
Engineer
Engineer
Posts: 65
Joined: 19 Nov 2018 19:26
Location: West Bengal,India

Re: NML - a Newgrf Meta Language

Post by SomeIndianGuy »

Please help, Nmlc.exe is not opening at all.
Nothing to put here!
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: NML - a Newgrf Meta Language

Post by Gwyd »

SomeIndianGuy wrote:Please help, Nmlc.exe is not opening at all.
Yup. Just as intended.

That is to say, you use its functions through a command prompt window.
SomeIndianGuy
Engineer
Engineer
Posts: 65
Joined: 19 Nov 2018 19:26
Location: West Bengal,India

Re: NML - a Newgrf Meta Language

Post by SomeIndianGuy »

What should I write?

Code: Select all

pip 3 install nml
?
Nothing to put here!
User avatar
PNDA_
Engineer
Engineer
Posts: 62
Joined: 18 Jul 2018 17:26
Location: Germany

Re: NML - a Newgrf Meta Language

Post by PNDA_ »

SomeIndianGuy wrote:What should I write?

Code: Select all

pip 3 install nml
?
No, reread https://www.tt-wiki.net/wiki/NMLTutorial/Installation.
You add it to your environment variables so you can use it over the command line.
Hello!
ImageImageImage
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: NML - a Newgrf Meta Language

Post by SimYouLater »

Code: Select all

ERROR: Image file "gfx/roads/track.png": cannot identify image file 'C:\\TTDTools\\GRFs\\Recycled Infrastructure Set\\CURRENT\\source\\gfx\\roads\\track.png'
Here's my code for Recycled Infrastructure Set.
ris21source.zip
(3.89 MiB) Downloaded 109 times
All I did was alter tracks.png in GIMP, and now the NewGRF won't compile unless I exclude tramway.pnml

Help? Thanks in advance.
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: NML - a Newgrf Meta Language

Post by Alberth »

Have you tried compiling without changing the image first? If that works, you know that you changing the image is the cause of the problem. If compiling the unaltered version also fails, you know the problem is not in you changing the image, but in something else.

Did you check that the file in the error message actually exists? (exactly as printed)

For what it is worth, did you try using a path that has no spaces in it like "Recycled Infrastructure Set" has?
Being a retired OpenTTD developer does not mean I know what I am doing.
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: NML - a Newgrf Meta Language

Post by SimYouLater »

Alberth wrote:Have you tried compiling without changing the image first? If that works, you know that you changing the image is the cause of the problem. If compiling the unaltered version also fails, you know the problem is not in you changing the image, but in something else.

Did you check that the file in the error message actually exists? (exactly as printed)

For what it is worth, did you try using a path that has no spaces in it like "Recycled Infrastructure Set" has?
For some reason, I got up yesterday morning, attempted the compile, and everything worked. I have no clue what I did right.
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
Timaperm
Engineer
Engineer
Posts: 3
Joined: 01 Dec 2019 15:38

Re: NML - a Newgrf Meta Language

Post by Timaperm »

How to encode pnml in graphics grf?
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 »

Timaperm wrote: 01 Dec 2019 15:41 How to encode pnml in graphics grf?
Usually pnml files are a part of a project which comes with a makefile. This makefile calls the gcc pre-processor to create an nml file from several pnml files. The resulting nml file is then fed to nmlc in order to compile a newgrf from it.

This process is used to allow splitting the code of a NewGRF conveniently into several source files to allow better navigation through the source.
Timaperm
Engineer
Engineer
Posts: 3
Joined: 01 Dec 2019 15:38

Re: NML - a Newgrf Meta Language

Post by Timaperm »

Make to collect through Linux?
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 3 guests