NFO2 language

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

NFO2 language

Post by Bilbo »

I see people posting their high-level languages for NFO coding, so I decided to post my own too (so we have enough choices to choose from :). I created it some time ago when coding my large ships newGRF to help me with development.

It is written in perl and it is essentially "only" a preprocessor, replacing symbolic constants and resolving need for having a spritecount at beginning (this one can be filled automatically)

But it will make the file more readable, which can be seen in example files posted along with the tool (vl_shipw.nf2 vs vl_shipw.nfo)

Usage information is also in the archive.

The internal tables are largely incomplete (basically, they contain mostly some of the ship-related constants plus few generic ones)

The implementation is kinda hackish and perhaps buggy (but this can be fixed by using some proper parser instead of bunch of regexps :), but I thought it to be easier than implementing such functionality (automatic sprite count and named constants) into grfcodec, especially if I am unfamiliar with grfcodec internals. Also, it supports partial decompilation (some of the numbers are resolved to corresponding constants, byte sequences known to represent a word are converted to word, etc ...)
Attachments
nfo2.zip
NFO tool (source, documentation, examples)
(3.31 KiB) Downloaded 203 times
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 16 guests