Having fun with sprite replacement

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
ChrisCF
Transport Empire Developer
Transport Empire Developer
Posts: 3608
Joined: 26 Dec 2002 16:39
Location: Over there --->

Having fun with sprite replacement

Post by ChrisCF »

A complete grf file:

Code: Select all

// Automatically generated by GRFCODEC. Do not modify!
// (Info version 4)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
0 * 4 03 00 00 00
1 * 48 08 06 43 4A FF 01 4C 69 76 65 72 79 20 63 68 65 63 6B 65 72 00 32 30 30 34 20 43 68 72 69 73 20 4D 2E 20 4A 61 63 6B 73 6F 6E 20 2D 20 47 50 00
2 * 5 0A 01 01 1A 0C
3 E:\MPS\TTWin95\newgrf\SPRITES\replace.pcx 0 0 01 12 32 -16 -6
All this is supposed to do is replace the bus that shows up in the colour selection window, so you can see a particular vehicle in all its player-colour permutations. Find attached an enlarged view of the unit in question, and how the thing looks in the colour selector.

Note that the actual .pcx file does not have the white border. Both pictures scaled to 200%.
Attachments
How it looks in the window
How it looks in the window
eep.png (401 Bytes) Viewed 1871 times
A unit, 12x32.
A unit, 12x32.
class_180_player.png (409 Bytes) Viewed 1871 times
Bugzilla available for use - PM for details.
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Post by Korenn »

to me it looks like the pcx you're using has an odd width?
ttd (or grfcodec) can only handle even width...
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

It's obviously f*** up (excusez le mot). Are you sure you coded everything right and didn't mix up xa dn y size/rel.
ChrisCF
Transport Empire Developer
Transport Empire Developer
Posts: 3608
Joined: 26 Dec 2002 16:39
Location: Over there --->

Post by ChrisCF »

Korenn wrote:to me it looks like the pcx you're using has an odd width?
Learn to read :roll:
Hyronymus wrote:Are you sure you coded everything right and didn't mix up xa dn y size/rel.
Well, it's worked before, and I've followed the order specified in the header comments. I've also put the entire nfo above.
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Post by Korenn »

ChrisCF wrote:Learn to read :roll:
*rereads*

still nothing about the size of the pcx you're using.
learn to write :roll:
Prof. Frink
Tycoon
Tycoon
Posts: 3849
Joined: 20 Jan 2003 14:51
Location: Broadstone, Dorset
Contact:

Post by Prof. Frink »

In the picture comment he wrote:A unit, 12x32
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Prof. Frink wrote:
In the picture comment he wrote:A unit, 12x32
That doesn't mention the PCX file, just the sprite within it.

I'm not sure if grfcodec can handle sprites at y=0, to be honest. Try:
- encode
- decode
- in decoded pcx, replace the sprite with the correct graphics
- encode again
ChrisCF
Transport Empire Developer
Transport Empire Developer
Posts: 3608
Joined: 26 Dec 2002 16:39
Location: Over there --->

Post by ChrisCF »

The original file was 12x32, just like I said :roll:

Anyway, decoding and recoding has done the trick.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Amazon [Bot], Google [Bot] and 17 guests