The relation of the nfo file and the pcx file.

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
W_neun
Engineer
Engineer
Posts: 24
Joined: 03 Apr 2009 11:03

The relation of the nfo file and the pcx file.

Post 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.
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

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

Post 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.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

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

Post 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
W_neun
Engineer
Engineer
Posts: 24
Joined: 03 Apr 2009 11:03

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

Post 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.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

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

Post 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.
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

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

Post 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
Member of the
ImageImage
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

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

Post 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]
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 9 guests