Remove rotors from helicopter?

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

Moderator: Graphics Moderators

Post Reply
AndyLandy
Engineer
Engineer
Posts: 30
Joined: 10 Sep 2008 20:09

Remove rotors from helicopter?

Post by AndyLandy »

Hello,

I've created a GRF file with some helicopters in, but I'd like to make one a VTOL without any rotor blades. Is there a simple way of disabling the addition of rotor blades to a chopper? I've had a look through the documentation for Action3 and it says it's possible, but I couldn't find any examples.

As ever, all advice gratefully received!
Transportman
Tycoon
Tycoon
Posts: 2792
Joined: 22 Feb 2011 18:34

Re: Remove rotors from helicopter?

Post by Transportman »

Doesn't it work when you provide a sprite with only transparent blue?
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
mart3p
Tycoon
Tycoon
Posts: 1030
Joined: 31 Oct 2005 21:00
Location: UK

Re: Remove rotors from helicopter?

Post by mart3p »

Transportman wrote:Doesn't it work when you provide a sprite with only transparent blue?
You do have to provide a transparent blue sprite but you also need an action 3 livery override to set that as the rotor sprite. The livery override must immediately follow the helicopter's action 3.

Something like this...

Code: Select all

//Graphics for vehicle
  0 * 0	 03 03 01 // n-id
		26 // vehicle ID
		00 
		02 00 // sprites for helicopter

//Rotor override
  0 * 0	 03 03 81 // n-id - note, bit 7 set
		26 //  vehicle ID
		00 
		03 00 // sprites for rotor
Image
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: Remove rotors from helicopter?

Post by michael blunck »

mart3p wrote: [...]you also need an action 3 livery override to set that as the rotor sprite. The livery override must immediately follow the helicopter's action 3.
IIRC, this is an obsolete restriction which had been lifted as early as 2.0.1 alpha 41 (TTDPatch, that is).

regards
Michael
Image
User avatar
mart3p
Tycoon
Tycoon
Posts: 1030
Joined: 31 Oct 2005 21:00
Location: UK

Re: Remove rotors from helicopter?

Post by mart3p »

michael blunck wrote:IIRC, this is an obsolete restriction which had been lifted as early as 2.0.1 alpha 41 (TTDPatch, that is).
Yes, it's a very long time since I studied the OpenTTD helicopter rotor code. :wink:
Image
AndyLandy
Engineer
Engineer
Posts: 30
Joined: 10 Sep 2008 20:09

Re: Remove rotors from helicopter?

Post by AndyLandy »

OK, got it working, thanks!

Took me a while to get my head round Action2/Action3 interactions, particularly since I'm using an Action2 callback to add some text into the purchase vehicle dialog. Forgot that it still needs its own unique set-id, which I was overwriting with the new rotors. Oops.

For the "invisible" sprites, I simply copied the original sprites and blanked them out as entirely blue. Do I need four blue sprites, or can (and should) I just use a single blue sprite for all variations on a rotor? (On the other hand, it makes it nice and easy if I want to add some custom rotor designs later!)

Anyways, thanks again for all your help and input so far. :)
Transportman
Tycoon
Tycoon
Posts: 2792
Joined: 22 Feb 2011 18:34

Re: Remove rotors from helicopter?

Post by Transportman »

You can use one single sprite.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: Remove rotors from helicopter?

Post by michael blunck »

Transportman wrote:You can use one single sprite.
A single blue pixel would be sufficient. :cool:

regards
Michael
Image
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 17 guests