grf - to nml

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

Moderator: Graphics Moderators

Post Reply
sky81
Engineer
Engineer
Posts: 15
Joined: 29 Oct 2019 05:49

grf - to nml

Post by sky81 »

Hello,

I'm newbie on this topic but I cannot figure out how can I convert an existing grf to nml?
I have eGRVTS2.grf and when I write nmlc -o ooutput.nml eGRVTS2.grf I get this error: "input file is not utf-8 encoded"
any ideeas?

Thank you
Attachments
eGRVTS2.grf
(8.13 MiB) Downloaded 10 times

User avatar
kamnet
Moderator
Moderator
Posts: 7222
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: grf - to nml

Post by kamnet »

It would be better to contact LaDoncella and ask for a copy of the source code.

sky81
Engineer
Engineer
Posts: 15
Joined: 29 Oct 2019 05:49

Re: grf - to nml

Post by sky81 »

Sorry but how did you find that LaDocella made this grf?

User avatar
jfs
Tycoon
Tycoon
Posts: 1208
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: grf - to nml

Post by jfs »

sky81 wrote:
05 May 2020 19:56
Sorry but how did you find that LaDocella made this grf?
Go to the release post (viewtopic.php?p=1048815#p1048815) and read that Coding is credited to LaDoncella.


Edit: And no, NML is not capable of decompiling GRF files. There is no sensible way to translate GRF files back into NML.

User avatar
kamnet
Moderator
Moderator
Posts: 7222
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: grf - to nml

Post by kamnet »

If necessary, you could decode it with YAGL or, worse, NFO. But it's typically easier to just ask for the original source code and work with the coder.

User avatar
LaRoso
Engineer
Engineer
Posts: 103
Joined: 15 Sep 2017 22:29
Location: Augsburg, BY, Germany

Re: grf - to nml

Post by LaRoso »

It may be worth to note that some creators don't code their NewGRFs in NML but directly in NFO or with python for example.
Image

sky81
Engineer
Engineer
Posts: 15
Joined: 29 Oct 2019 05:49

Re: grf - to nml

Post by sky81 »

Thank you all for your replies. Either nml or python will be ok for me. I converted the grf to nfo but I read that nml is easier that nfo so I decifed to try nml to see how it is. That is why I ask for a conversio grf to nml. I thought that it exist such decoder like from grf to nfo (grfcodec).

User avatar
UnicycleBloke
Engineer
Engineer
Posts: 63
Joined: 30 Aug 2011 14:39
Location: Cambridge, England

Re: grf - to nml

Post by UnicycleBloke »

sky81 wrote:
07 May 2020 04:22
That is why I ask for a conversio grf to nml. I thought that it exist such decoder like from grf to nfo (grfcodec).
I don't think this is possible, or certainly not easy, to implement. Like any compiler, the steps from NML source code to GRF binary throw away a lot of information that cannot easily be recovered, if at all. You cannot unbake a cake to recover the ingredients. kamnet mentioned YAGL. If you have decoded to NFO with grfcodec, you might want to try decoding to YAGL with yagl. This is still low level, but is intended to be much more human readable/maintainable than NFO. It's fairly new, so just shout if there are problems.

sky81
Engineer
Engineer
Posts: 15
Joined: 29 Oct 2019 05:49

Re: grf - to nml

Post by sky81 »

Ok. Thanks for the info.
Still, I found on the topic bellow the sources for eGRVTS22
viewtopic.php?f=67&start=160&t=62841&si ... 87fe8b9848
But still, I don't know how to packit and transform to grf. If I look in the compile.ps1, I think this should be the file that should do this job. But how can I compile it? This is not a python or batch file. What file is it and how can I run it?

Thanks again for your time

sky81
Engineer
Engineer
Posts: 15
Joined: 29 Oct 2019 05:49

Re: grf - to nml

Post by sky81 »

Me again. I found out what is it with ps1 (power shell). So I managed to compile it, translate to nml then to grf. Seems that the sources I have(from above post)), do have some issue: I get fatal error when accesing grf: unknown property for action 0 0x17 (sprite10). Anyone any ideea?

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5714
Joined: 27 Nov 2004 15:05
Location: Canada

Re: grf - to nml

Post by wallyweb »

sky81 wrote:
07 May 2020 13:41
Me again. I found out what is it with ps1 (power shell). So I managed to compile it, translate to nml then to grf. Seems that the sources I have(from above post)), do have some issue: I get fatal error when accesing grf: unknown property for action 0 0x17 (sprite10). Anyone any ideea?
Your question sounds like you are seeing this error when starting a new game. It could be that you are using an older version of OpenTTD. Are you using the latest release of OpenTTD?

sky81
Engineer
Engineer
Posts: 15
Joined: 29 Oct 2019 05:49

Re: grf - to nml

Post by sky81 »

That piece of code is from 2016, so I should not use the latest version. Nevertheless, I try also with latest version still not worked. Anyway, I figure out what was the problem, then anther problems appear, solved those also (edit in nfo), then recompile and run. Then it worked. But I think the trams will not work as expected. Anyway, that is why I need the latest code to change some parameters on it from eGRVTS2. The one that I have form that forum, seems that is not good.

Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 2 guests