Page 1 of 1

I'm having trouble getting started making my own GRF

Posted: 21 Feb 2017 09:02
by Ben1338
Hey there.

I've always kinda wanted to have a god at creating my own version of the Starting Ratings GRF viewtopic.php?p=1183003#p1183003 as I thought that since it doesn't deal with graphics development, but instead, depends entirely on scripts, I'd have an easier time with creating my first GRF, But I am having trouble getting started.

So I did a quick search around the internet and discovered that NML was a good program to code in, but I need a program to compress the files into a Game Resource File.

So first, I looked around for the tools that are used for OTTD development https://wiki.openttd.org/NewGRF_development_tools and despite how many tools are there, there are only 2 or 3 tools which are actually used for GRF development, which are the following:
  • GRF Wizard - which seems to be a tool that handles with purely the graphics side of things (Sprites and all that.), it links in with GRF codec which, in itself, does very much the same thing, just with Command Prompt.
  • NML - Which seems to be a command prompt program to compile scripts written in NML written by an external editor (eg: notepad or notepad++).
  • m4nfo - Another NML editor which seems to need its own Operating System.
So now I need to merge the 2 somehow... But since I don't really know how to code in NML and use the programs that I have retrieved it seems that I have got bogged down with trying to understand how to do it.

Re: I'm having trouble getting started making my own GRF

Posted: 21 Feb 2017 09:09
by planetmaker
The only officially supported programmes are
* NML
* grfcodec

There is no way to write NewGRFs or base grfs without the coding part. However that coding part is not tricky, and there are tutorials and for the simple cases it's just telling the programme how your NewGRF is called and where it finds the graphics

Re: I'm having trouble getting started making my own GRF

Posted: 21 Feb 2017 12:26
by Ben1338
Alright, Yeah, that makes sense.

Since the station ratings GRF doesn't contain any graphics what so ever, do you think it's best to start off with that? or should I attempt something similar to the base set? Ie: minimal coding and mostly graphics.

I ask this because I'm comfortable with a basic understanding of coding, but I'm not sure on how to translate that into a way that OTTD understands and I find that the https://newgrf-specs.tt-wiki.net website seems to confuse me even more.

Re: I'm having trouble getting started making my own GRF

Posted: 21 Feb 2017 13:58
by planetmaker
have a look at the tutorials at https://www.tt-wiki.net/wiki/NMLTutorial and browse the many projects available at the DevZone for examples: http://dev.openttdcoop.org

Consider a similarily free license for your work - so that others can profit from what you make in the same way you profit from those existing projects.

Re: I'm having trouble getting started making my own GRF

Posted: 24 Mar 2017 16:26
by Ben1338
Thank you for linking that, I've been trying to work through it and for the most part I've ben reasonably successful, the only thing I don't have is a sample to test if I've installed the nml encoder correctly.

Re: I'm having trouble getting started making my own GRF

Posted: 24 Mar 2017 17:41
by Transportman
Ben1338 wrote:Thank you for linking that, I've been trying to work through it and for the most part I've ben reasonably successful, the only thing I don't have is a sample to test if I've installed the nml encoder correctly.
You can test that by running nmlc from the command line. If installed correctly and nmlc is in your path (which would be helpful as you don't have to mess with pointing to file paths all the time), it should answer with something.

Re: I'm having trouble getting started making my own GRF

Posted: 24 Mar 2017 18:29
by Ben1338
Fair enough, thank you.

Re: I'm having trouble getting started making my own GRF

Posted: 25 Mar 2017 05:24
by Alberth
Standard trick in these cases is to query version (with --version) or online help (with -h), like

Code: Select all

nmlc --version
That eliminates the need for a specification.

I typically make a batch script for running it anyway, even if it is in the path, as that eliminates the need to specify the input file, output file, and compile options, each time.