Page 1 of 1

Zephyris's newGRF examples guide

Posted: 05 May 2008 16:27
by Zephyris
Vehicle GRF Tutorials/Examples - Common GRF Coding Challenges
Richard Wheeler (Zephyris) 2008


Attached is the first draft of an document I have been working on over the last few months when I have been bored.

This is a good thing to read once you have finished the tutorials at the TTDPatch wiki. Currently it covers vehicle coding including:
* action 1
* action 2
_* loading stage graphics
_* moving/loading graphics
_* variational action2
_* randomised action2
* action 3
_* multiple cargo types
_* livery override
* callbacks
_* articulated vehicles

There are mistakes, please let me know if you find one!
It is a Google docs document, so If you would like to contribute just ask!

Re: Zephyris's newGRF examples guide

Posted: 05 May 2008 17:27
by FooBar
I think this is very useful. Now I finally understand the bit-shift and AND-mask stuff. So thanks for explaining! :mrgreen:


One general remark:
In an example, I'd use a real vehicle ID instead of **. Right now, people who just started coding NFO, might think they really need to put ** in there. For a theoretical explanation, ** is just fine, but for an example I would just use a random number. :wink:

Re: Zephyris's newGRF examples guide

Posted: 05 May 2008 20:03
by AndersI
If the tutorial is really ambitious, it should have an accompanying .pcx file and make real examples. Nothing is better than seeing the fruits of one's labour running around inside the game!

Anyway, it's already a good read and will hopefully grow. But why a PDF? Why not add pages in the Wiki?

Now all that's needed is a parallel document with the same questions and GRFMaker answers. But that's a question for the GRFMaker thread (http://www.tt-forums.net/viewtopic.php? ... &start=340), and not much seems to be happening there :-(

Re: Zephyris's newGRF examples guide

Posted: 05 May 2008 20:36
by Zephyris
I find it easier to write something without trying to fit it into the wiki structure, but the text can be transplanted if wanted...

Re: Zephyris's newGRF examples guide

Posted: 06 May 2008 02:22
by lead@inbox
Zephyris - Excellent work! 8)

Re: Zephyris's newGRF examples guide

Posted: 06 May 2008 11:43
by Trond
I echo the rest! Superb job Zeph!