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
Traffic Manager
Traffic Manager
Posts: 186
Joined: 02 Jul 2015 08:05
Location: Czech Republic
Contact:

Re: NML - a Newgrf Meta Language

Post by stefino_cz » 21 Mar 2019 10:25

Thanks a lot for the informations :)
Image

McZapkie
Tycoon
Tycoon
Posts: 1175
Joined: 18 Jan 2014 18:10

Re: NML - a Newgrf Meta Language

Post by McZapkie » 08 Apr 2019 21:40

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 8998 times
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension, V4 CEE train set.
Addicted to freeciv longturn.

peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1646
Joined: 30 Mar 2005 09:43

Re: NML - a Newgrf Meta Language

Post by peter1138 » 08 Apr 2019 21:43

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.

McZapkie
Tycoon
Tycoon
Posts: 1175
Joined: 18 Jan 2014 18:10

Re: NML - a Newgrf Meta Language

Post by McZapkie » 09 Apr 2019 09:06

Hah, problem solved - my track sprite is displayed, but has same gray color as menu background...
Sneak 100 :)
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension, V4 CEE train set.
Addicted to freeciv longturn.

Supercheese
Tycoon
Tycoon
Posts: 1660
Joined: 16 Dec 2007 22:24
Location: Idaho, USA

Re: NML - a Newgrf Meta Language

Post by Supercheese » 09 Apr 2019 23:10

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: 104
Joined: 24 Aug 2014 12:20
Location: Kaon Prison, Cybertron

Re: NML - a Newgrf Meta Language

Post by FulliAutomatix » 11 May 2019 12:05

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: 7396
Joined: 17 Jan 2007 00:14

Re: NML - a Newgrf Meta Language

Post by Eddi » 11 May 2019 13:07

looks like some version incompatibility to me...
You might not exactly be interested in Ferion, but if you are, have fun :)

SimYouLater
Director
Director
Posts: 599
Joined: 03 Apr 2016 20:19

Re: NML - a Newgrf Meta Language

Post by SimYouLater » 18 May 2019 03:04

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: 7396
Joined: 17 Jan 2007 00:14

Re: NML - a Newgrf Meta Language

Post by Eddi » 18 May 2019 09:29

SimYouLater wrote:EDIT: NML files must be coded in ANSI to work, apparently.
no, but you can't mix it.
You might not exactly be interested in Ferion, but if you are, have fun :)

SimYouLater
Director
Director
Posts: 599
Joined: 03 Apr 2016 20:19

Re: NML - a Newgrf Meta Language

Post by SimYouLater » 18 May 2019 20:57

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: 18
Joined: 19 Nov 2018 19:26
Location: Somewhere in India

Re: NML - a Newgrf Meta Language

Post by SomeIndianGuy » 31 May 2019 16:55

Please help, Nmlc.exe is not opening at all.
Nothing to put here!

User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 692
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: NML - a Newgrf Meta Language

Post by Gwyd » 31 May 2019 17:45

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: 18
Joined: 19 Nov 2018 19:26
Location: Somewhere in India

Re: NML - a Newgrf Meta Language

Post by SomeIndianGuy » 31 May 2019 17:47

What should I write?

Code: Select all

pip 3 install nml
?
Nothing to put here!

User avatar
PNDA_
Engineer
Engineer
Posts: 51
Joined: 18 Jul 2018 17:26
Location: Germany

Re: NML - a Newgrf Meta Language

Post by PNDA_ » 31 May 2019 18:01

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.
Image

SimYouLater
Director
Director
Posts: 599
Joined: 03 Apr 2016 20:19

Re: NML - a Newgrf Meta Language

Post by SimYouLater » 31 May 2019 22:29

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 14 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: 4721
Joined: 09 Sep 2007 05:03
Location: home

Re: NML - a Newgrf Meta Language

Post by Alberth » 01 Jun 2019 17:18

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 OpenTTD developer does not mean I know what I am doing.
Also, other OpenTTD developers may have different opinions.

SimYouLater
Director
Director
Posts: 599
Joined: 03 Apr 2016 20:19

Re: NML - a Newgrf Meta Language

Post by SimYouLater » 01 Jun 2019 19:47

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.

Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 0 guests