I'm having trouble getting started making my own GRF

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

Moderator: Graphics Moderators

Post Reply
User avatar
Ben1338
Traffic Manager
Traffic Manager
Posts: 171
Joined: 17 Nov 2007 17:23
Skype: ben313371

I'm having trouble getting started making my own GRF

Post 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.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

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

Post 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
User avatar
Ben1338
Traffic Manager
Traffic Manager
Posts: 171
Joined: 17 Nov 2007 17:23
Skype: ben313371

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

Post 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.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

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

Post 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.
User avatar
Ben1338
Traffic Manager
Traffic Manager
Posts: 171
Joined: 17 Nov 2007 17:23
Skype: ben313371

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

Post 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.
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

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

Post 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.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
Ben1338
Traffic Manager
Traffic Manager
Posts: 171
Joined: 17 Nov 2007 17:23
Skype: ben313371

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

Post by Ben1338 »

Fair enough, thank you.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

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

Post 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.
Being a retired OpenTTD developer does not mean I know what I am doing.
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 2 guests