Help in manipulating building CC with code

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
Hi-Torque
Engineer
Engineer
Posts: 27
Joined: 14 Feb 2003 16:26
Location: Germany

Help in manipulating building CC with code

Post by Hi-Torque »

Hello Everyone,

I have recently resumed my long running love affair with TTD (for about the 10th time in as many years). One of the things that have always appealed to me about the patch and OTTD was the ability to muck about in the GRF's. I have been studying up on the NewGRF documentation. But perhaps you could help point me in the right direction.

Is it possible though code to manipulate the CC portions of buildings? I rather prefer subdued CC, and would like as an example, to reduce the amount of CC in the airports replacing it with red.

I know that I can certainly replace the sprites and I am comfortable doing that, but for me it would be interesting if I could achieve this with code.

Thanks in advance and Happy New Year to all.
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Help in manipulating building CC with code

Post by FooBar »

What portion of a building is CC and what is not is actually defined in the graphics. In some cases the code can only enable/disable it completely or set specific colours. So in this case you would need to paint over the graphics.
Hi-Torque
Engineer
Engineer
Posts: 27
Joined: 14 Feb 2003 16:26
Location: Germany

Re: Help in manipulating building CC with code

Post by Hi-Torque »

Hello Foobar,

Thank you kindly. As I have been puzzling over this, I ran across the Combined Airport Set (newairportw.grf) For me, this grf works in OTTD but only with the default parameters, none of the others are visible.

So I understand the forums philosophy of "if you want something done, do it yourself" and I completely agree. It seems like adding the feature I want would be much easier using an existing grf. But, as I am still floundering a bit in all of the changes since I was last fairly knowledgeable, any help in briefly explaining or at least hinting what direction I need to take to make this grf fully compatible with OTTD 1.2 or higher would be greatly appreciated.

Kind Regards,
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Help in manipulating building CC with code

Post by planetmaker »

Hi-Torque wrote:Hello Foobar,

Thank you kindly. As I have been puzzling over this, I ran across the Combined Airport Set (newairportw.grf) For me, this grf works in OTTD but only with the default parameters, none of the others are visible.
Really? See yourself, this looks distinctly different to me...

And mind: if you play with the OpenGFX base set: a portion of its airport sprites is actually borrowed from this set or a slightly modified version of it - so not every parameter setting will have a huge effect - especially if it refers to skidd13's sprites.
Attachments
with settings
with settings
combined_airports.png (64.67 KiB) Viewed 2155 times
default graphics (OpenGFX)
default graphics (OpenGFX)
no_combined_airports.png (89.39 KiB) Viewed 2155 times
other parameters
other parameters
combined_airports2.png (61.06 KiB) Viewed 2151 times
Hi-Torque
Engineer
Engineer
Posts: 27
Joined: 14 Feb 2003 16:26
Location: Germany

Re: Help in manipulating building CC with code

Post by Hi-Torque »

Hi Planetmaker,

Thank you for taking the time to reply. Ok, well I will do a bit of troubleshooting to see what the conflict is. Then I can use this grf to learn from.

Thank you all!
Yoshi
Transport Coordinator
Transport Coordinator
Posts: 278
Joined: 21 Dec 2010 17:24

Re: Help in manipulating building CC with code

Post by Yoshi »

In some cases the code can only enable/disable it completely or set specific colours.
Is this possible for vehicles, and if so, how?
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Help in manipulating building CC with code

Post by FooBar »

Yes, you can. First and foremost there's a property flag to enable 2CC.
On top of that you can apply specific recolour palettes, regardless of player colour. See http://www.tt-wiki.net/wiki/NMLTutorial/Train_recolour for an example.
And if that's not enough you can specify custom recolour palettes. I used this for instance in the Dutch Trainset for cargo recolouring. These are the recolour sprites: http://dev.openttdcoop.org/projects/dut ... rites.pnml, which are called from a vehicle's graphics block: http://dev.openttdcoop.org/projects/dut ... _item.pnml
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 5 guests