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!
Zephyris's newGRF examples guide
Moderator: Graphics Moderators
Zephyris's newGRF examples guide
- Attachments
-
- GRF Code Examples.pdf
- (151.22 KiB) Downloaded 568 times
Re: Zephyris's newGRF examples guide
I think this is very useful. Now I finally understand the bit-shift and AND-mask stuff. So thanks for explaining!
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.

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.

Re: Zephyris's newGRF examples guide
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
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
I find it easier to write something without trying to fit it into the wiki structure, but the text can be transplanted if wanted...
- lead@inbox
- Transport Coordinator
- Posts: 377
- Joined: 28 Dec 2007 04:35
- Location: Serge, Russia, Vladivostok
- Contact:
Re: Zephyris's newGRF examples guide
Zephyris - Excellent work! 

Re: Zephyris's newGRF examples guide
I echo the rest! Superb job Zeph!
..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Who is online
Users browsing this forum: Bing [Bot] and 14 guests