Page 64 of 65

Re: NML - a Newgrf Meta Language

Posted: 21 Mar 2019 10:25
by stefino_cz
Thanks a lot for the informations :)

Re: NML - a Newgrf Meta Language

Posted: 08 Apr 2019 21:40
by McZapkie
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 10559 times

Re: NML - a Newgrf Meta Language

Posted: 08 Apr 2019 21:43
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)

Re: NML - a Newgrf Meta Language

Posted: 09 Apr 2019 09:06
by McZapkie
Hah, problem solved - my track sprite is displayed, but has same gray color as menu background...
Sneak 100 :)

Re: NML - a Newgrf Meta Language

Posted: 09 Apr 2019 23:10
by Supercheese
Perhaps more like: Hack 100

:wink:

Re: NML - a Newgrf Meta Language

Posted: 11 May 2019 12:05
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.

Re: NML - a Newgrf Meta Language

Posted: 11 May 2019 13:07
by Eddi
looks like some version incompatibility to me...

Re: NML - a Newgrf Meta Language

Posted: 18 May 2019 03:04
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.

Re: NML - a Newgrf Meta Language

Posted: 18 May 2019 09:29
by Eddi
SimYouLater wrote:EDIT: NML files must be coded in ANSI to work, apparently.
no, but you can't mix it.

Re: NML - a Newgrf Meta Language

Posted: 18 May 2019 20:57
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.

Re: NML - a Newgrf Meta Language

Posted: 31 May 2019 16:55
by SomeIndianGuy
Please help, Nmlc.exe is not opening at all.

Re: NML - a Newgrf Meta Language

Posted: 31 May 2019 17:45
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.

Re: NML - a Newgrf Meta Language

Posted: 31 May 2019 17:47
by SomeIndianGuy
What should I write?

Code: Select all

pip 3 install nml
?

Re: NML - a Newgrf Meta Language

Posted: 31 May 2019 18:01
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.

Re: NML - a Newgrf Meta Language

Posted: 31 May 2019 22:29
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 30 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.

Re: NML - a Newgrf Meta Language

Posted: 01 Jun 2019 17:18
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?

Re: NML - a Newgrf Meta Language

Posted: 01 Jun 2019 19:47
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.

Re: NML - a Newgrf Meta Language

Posted: 01 Dec 2019 15:41
by Timaperm
How to encode pnml in graphics grf?

Re: NML - a Newgrf Meta Language

Posted: 01 Dec 2019 16:14
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.

Re: NML - a Newgrf Meta Language

Posted: 01 Dec 2019 16:55
by Timaperm
Make to collect through Linux?