[code help] Company color on station tile? Lenght?

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
ISA
Tycoon
Tycoon
Posts: 3384
Joined: 17 Oct 2005 20:56
Location: Estonia

[code help] Company color on station tile? Lenght?

Post by ISA »

I have a problem to get work my company color station tile! Ok as I guess the line I'm trying to change is 9 * 22 .... This is correct one?
But where I can see what I should type there to get my color work correctly?

Code: Select all

09 * 22      00 04 09 01 01 08 "LAMP" 0C FE 0D FE 11 00 14 FF 15 FF 0A 00
10 * 4	 01 04 01 02
11 c:\games\ttd\sprites/lamps.pcx 319 8 09 45 64 -30 -14
12 c:\games\ttd\sprites/lamps.pcx 399 8 09 45 64 -30 -14
13 * 7	 02 04 00 00 01 00 00
14 * 7	 03 04 01 01 00 00 00
15 * 13	 04 04 9F 01 01 "Å<Fence" 00
Wiki wrote:The values are a byte, used as a bit mask. Bits 0 to 6 control the availability of number or length 1 to 7, and bit 7 controls the availability of the "+7" button. Each bit that is set disables the corresponding length or number of platforms.
Second question is about station length. I don't understand well where to I put this code what gives me bigger length to stations?
Are those

Code: Select all

0C FE 0D
on line 09 * 22?

Thanks for any tips :)
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: [code help] Company color on station tile? Lenght?

Post by michael blunck »

Sprite recolouring information has to be included into the sprite "number" itself, by property 09.

Regarding platform numbers and lengths, these are specified by properties 0C and 0D: 0C is a "bit mask of disabled numbers of platforms", likewise, 0D is a "bit mask of disabled platform lengths".

I.e.,

0C F0 -> 11110000 -> allow only platforms 1-4
0D FE -> 11111110 -> allow only platform length = 1.

HTH
regards
Michael
Image
User avatar
ISA
Tycoon
Tycoon
Posts: 3384
Joined: 17 Oct 2005 20:56
Location: Estonia

Re: [code help] Company color on station tile? Lenght?

Post by ISA »

Ok I had some free time I did try Michael advice! The lenght problem is solved but that compani color code are bit hard to understand! Maybe some example?
Cheers again :)

Edit: sry for double post
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: [code help] Company color on station tile? Lenght?

Post by michael blunck »

ISA wrote:[...] that compani color code are bit hard to understand! Maybe some example?
Well, from the Wiki:
0000042D+X use sprite X from the corresponding action 1 block (i.e. 0000042D for the first, 0000042E for the second, etc.)
0000842D+X same, but draw it using company colour translation

http://wiki.ttdpatch.net/tiki-index.php ... _layout_09_ [<- link!]
I.e., imagine simple station platforms, and one side´s sprites (42F, 430h) should contain objects in company colour, then:

-1 * 57 00 04 01 01 <ID> 09 02

// x-direction
2D 04 00 80 // groundtile
00 00 00 10 05 10 2D 04 00 00 // platform sprite
00 0B 00 10 05 10 2F 84 00 00 80 // .. in company colour

// y-direction
30 04 00 80 // groundtile
00 00 00 05 10 10 2E 04 00 00 // platform sprite
0B 00 00 05 10 10 30 84 00 00 80 // .. in company colour

HTH
regards
Michael
Image
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Ahrefs [Bot], Baidu [Spider], Google [Bot] and 8 guests