Page 1 of 1

The relation of the nfo file and the pcx file.

Posted: 02 Aug 2009 21:45
by W_neun
Hello!

Can someone tell me how does the nfo file get the coordinates of the sprites? Also, which program aligns the sprites in the pcx file? Currently I'm trying to edit some grfs, replacing some sprites with my graphics, but I don't know how to use sprites that are not the same size as the original.

Re: The relation of the nfo file and the pcx file.

Posted: 02 Aug 2009 22:04
by ISA
Maybe this can help
There is also more things You can read and learn about!

Re: The relation of the nfo file and the pcx file.

Posted: 02 Aug 2009 22:06
by FooBar
W_neun wrote:Can someone tell me how does the nfo file get the coordinates of the sprites?
The coordinates are written directly into the nfo file. So it gets it from whoever puts it in.
W_neun wrote:Also, which program aligns the sprites in the pcx file?
For new pcx files; any proper graphics editing program. For decoded newgrfs: grfcodec.
W_neun wrote:Currently I'm trying to edit some grfs, replacing some sprites with my graphics, but I don't know how to use sprites that are not the same size as the original.
See ISA's link.

Re: The relation of the nfo file and the pcx file.

Posted: 02 Aug 2009 22:08
by planetmaker

Code: Select all

	
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
    3 sprites/pcx/gui04.pcx 66 8 01 24 24 0 0
with xpos and ypos the upper left corner of the sprite is meant. xrel and yrel move the graphics wrt the tile centre.

I propose to look at other NewGRF source as e.g. found at our DevZone and to look at the TTD graphics wiki at http://wiki.ttdpatch.net/tiki-index.php ... phicsSpecs

Re: The relation of the nfo file and the pcx file.

Posted: 03 Aug 2009 10:48
by W_neun
I checked the grf wiki a long time ago, but didn't find the answer. (In the meantime I found the instructions in the grfcodec documentation). So if I understand it right, I just have to check the coordinates and the size of each sprite, and write them in the nfo. Not complicated, just a lot of work.

Anyway, thanks for your replies.

Re: The relation of the nfo file and the pcx file.

Posted: 03 Aug 2009 11:37
by planetmaker
W_neun wrote:Not complicated, just a lot of work.
Yeah. Only then one starts to really appreciate HOW much work the creation of such newgrf might be.

Re: The relation of the nfo file and the pcx file.

Posted: 03 Aug 2009 12:07
by DJ Nekkid
why i always reorder the sprites to a template file, and then i can just copy/paste the code, and use CTRL-H (in most txteditors) to replace whatever is needed. usually just the name of the file

Re: The relation of the nfo file and the pcx file.

Posted: 03 Aug 2009 12:07
by Ammler
I found out, part of coding is also rearrange the sprites in a pcx, so it makes coding (alignment) easier. The sprites should be drawn, so you can use the same values for every sprite, just with offsets. Some use excel for such task, and then you see white borders, if that didn't work for all. ;-)

[mäh, DJN was faster :-P]