For an example, the Action08 pseudo-sprite is currently rendered as:
Code: Select all
grf // Action08
{
grf_id: "\xFB\xFB\x06\x01";
version: 8;
name: "Dutch Trainset 2.1.0";
description: "{lt-gray}Dutch Trains for OpenTTD {new-line}{black}First vehicle: 1839.{new-line}{new-line}(c)Dutch Trainset Team {new-line}License: GPLv2 or higher. {new-line}See readme for details.";
}
For another example, a VarAction02:
Code: Select all
switch<Trains> // Action02 variable
{
this_set_id: 0xEC;
test: (year_of_construction & 0xFFFFFFFF);
switch (test)
{
0x00000000..0x000007BE: 0x00F0;
0x000007BF..0x000007C5: 0x00F4;
0x000007C6: 0x00F5;
0x000007C7..0x000007CE: 0x00F4;
0x000007CF..0x000007D3: 0x00F8;
0x000007D4: 0x00F1;
0x000007D5..0x000007D6: 0x00F8;
0x000007D7: 0x00EC;
default: 0x00EB;
}
}
A secondary, but maybe more interesting, goal for this tool is that it should be able to read its own text files and sprite sheets back into memory, and then write out the data as a new GRF file. This is why the output has a lot of apparently superfluous braces and semicolons. This feature has become very important in my mind, but is much less complete than writing the text file. I pretty much know how to do it, but my approach to parsing the text is a bit tedious and verbose, and there is quite a lot to do. Again, it's largely a matter of filling in the blanks.
Anyway... the reason for posting is that I've been working on this for a little while now, and I kind of wanted to give a heads up. And maybe get some direction from feedback. Obviously NML (or M4NFO, I guess) is the way to go for most GRF development, but I wondered if there is still a place for something more low level. The main reason I started this was curiosity about how NML constructs map on to the NewGRF specs. And then I got a bit carried away...