NewGRF Livery Selection/Cargo Subtypes (GRF Callback 19)

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

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

NewGRF Livery Selection/Cargo Subtypes (GRF Callback 19)

Post by mart3p »

Some recent GRF files use "Cargo Subtypes" to select liveries or alternative cargo graphics. This patch implements newGRF callback 19 which adds suffixes to cargo types in the refit window, allowing selection of these alternative liveries.

The screenshot shows the refit lists for an IC125 train and an A380 aircraft. In the case of the train, although not reffitable to anything but passengers, the refit window will display the 5 available liveries. The A380 has a selection of airline liveries for passengers and the choice of Fed-Ex or UPS liveries for other cargoes.

The IC125 (v0.5) is by Born Acorn and is available here. The A380 is one of Grigory1's aircraft available here with many others. If this link is not available the A380 is posted in the forums here.

Planeset 1.5 uses Cargo Subtypes for the selection of alternative airline company liveries. This patch makes these available. In addition, suffixes “liquid” and “solid” are added for goods. These options give (for example) alternative graphics for the Chinook cargo slings. Also have a look here.

This patch is now also included in the MiniIN. Find the most recent builds for all platforms here.
Edit: Patch updated to r5428. Support for NewGRF "include” strings added (moved from Planeset 1.5 patch). 29/06/06
Edit: Bug fixed - refitting to non-temperate cargoes. Patch updated to r5451. 03/07/06
Edit: There is a win32 exe built at r5510 here which includes this patch. 17/07/06
Edit: Patch updated to r5643. 30/07/06
Edit: Patch updated to r5933. 17/08/06
Edit: Patch updated to r6104. 24/08/06
Edit: Patch updated to r6300. 01/09/06
Edit: Patch updated to r6560. 28/09/06
Edit: Most of this patch is now in the trunk. The latest version (r6901) fixes a few remaining issues (see recent post for details). 23/10/06
Edit: Patch updated to r6920. All it now does is display the cargo subtype suffix in the vehicle details window, the rest is in the trunk. 24/10/06
Attachments
Mart3p Transport, 28th Dec 1998.png
Mart3p Transport, 28th Dec 1998.png (49.53 KiB) Viewed 16265 times
GRF_Cargo_Subtype_r6920.patch
(3.92 KiB) Downloaded 678 times
Last edited by mart3p on 24 Oct 2006 11:33, edited 21 times in total.
Image
User avatar
Born Acorn
Tycoon
Tycoon
Posts: 7597
Joined: 10 Dec 2002 20:36
Skype: bornacorn
Location: Wrexham, Wales
Contact:

Post by Born Acorn »

Ooh. Nice work! :D
Image
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

I'd rather have shared rails, than just pretend that there are lots of companies by using liveries. It is clever, though.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
User avatar
mart3p
Tycoon
Tycoon
Posts: 1030
Joined: 31 Oct 2005 21:00
Location: UK

Post by mart3p »

Born Acorn: Thanks, I thought you might like it. :)

Brianetta: I agree with you, shared rails would be great. But all my patch adds is the ability for OTTD to access features that are already in some GRF files. I would agree that company liveries are not much use for multiplayer games but they’re great for single player.
Image
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1795
Joined: 30 Mar 2005 09:43

Post by peter1138 »

Yeah, it is purely a visual effect. Much like NewStations is :-)
He's like, some kind of OpenTTD developer.
User avatar
Born Acorn
Tycoon
Tycoon
Posts: 7597
Joined: 10 Dec 2002 20:36
Skype: bornacorn
Location: Wrexham, Wales
Contact:

Post by Born Acorn »

Brianetta wrote:I'd rather have shared rails, than just pretend that there are lots of companies by using liveries. It is clever, though.
Thats not the point. The point is you can use real life liveries now without having to have 5 entries of the same loco on the Buy Vehicle list. :P
Image
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Post by Michi_cc »

Is it supposed to work with the DBSetXL as well?

Start a game around 1935, build a BR18 and add some passenger waggons. If you're doing it with the Patch, it's possible to refit those cars to special "Rheingold" ones. This option is missing in OpenTTD, even with your patch.


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

Post by mart3p »

Michi_cc wrote:Is it supposed to work with the DBSetXL as well?

Start a game around 1935, build a BR18 and add some passenger waggons. If you're doing it with the Patch, it's possible to refit those cars to special "Rheingold" ones. This option is missing in OpenTTD, even with your patch.
Michi_cc, if DBSetXL is using callback 19 for its refit options, my patch should make them available.

Thanks for letting me know that this isn't working. I will load up DBSetXL and look into it.

Edit: Well, it’s my patch that’s broken. :oops: It is only checking the engine for callback 19 and not the wagons. Thanks for finding and reporting this problem. I will fix it as soon as I can.

Another edit: I've got it almost working. :) Just need to get rid of duplicates in the refit list.
Attachments
Mentfingbridge Transport, 2nd May 1936.png
Mentfingbridge Transport, 2nd May 1936.png (24.55 KiB) Viewed 15792 times
Image
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

dunno if you've done it yet, but, something else with re-fit that needs fixing is the cost. in TTDP and UKRS some refits like steel to wood cost money to refit, while others like coal to ore don't, however in OTTD all cost money, and in most cases the refit costs more than the wagon itself...
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
User avatar
mart3p
Tycoon
Tycoon
Posts: 1030
Joined: 31 Oct 2005 21:00
Location: UK

Post by mart3p »

bobingabout: I have had a quick look at this problem, as I have been frustrated by this myself when playing with UKRS. The problem is, OTTD doesn't implement newGRF action 0 property 1C which is the refit cost set by the GRF file. It's on my list of possible future patches. :)
Image
User avatar
Born Acorn
Tycoon
Tycoon
Posts: 7597
Joined: 10 Dec 2002 20:36
Skype: bornacorn
Location: Wrexham, Wales
Contact:

Post by Born Acorn »

bloomin hell. A list of newgrf patches! :P

*mind is blown*
Image
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1795
Joined: 30 Mar 2005 09:43

Post by peter1138 »

Should I put mine on hold and let mart3p get on with it? ;-)

More seriously, perhaps we should put up a page on the wiki to allocate our tasks to stop duplication... Let's use http://wiki.openttd.org/index.php/Tasks
He's like, some kind of OpenTTD developer.
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

sounds good peter :P
i knew it'd be something like what mart said, but not knowing the NFO NewGRF structure, i didn't kow what action or property it was :P
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

peter1138 wrote:Should I put mine on hold and let mart3p get on with it? ;-)

More seriously, perhaps we should put up a page on the wiki to allocate our tasks to stop duplication... Let's use http://wiki.openttd.org/index.php/Tasks
actually we planned flyspray to contain something like this, but we ended up using it for bugs only. The idea of using flyspray was to open task A and then assign somebody to it. This person can then change due date, due release and how many % is done (so other people can follow the progress). If we also add task B, then we can make it depend on task A, like say a patch, that will do something to electrified rails would depend on electrified rails to be completed. Having it in the same system as the bug reports mean that we can make a bug report depend on completion of a patch and so on.

In theory this works, so I wonder why nobody uses it. I have used it, but it's like it's not a great idea if only one person is using it.
KING
Traffic Manager
Traffic Manager
Posts: 180
Joined: 12 Dec 2005 08:03

Post by KING »

martp: what grf set are you useing in your 1st post?
Image
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

you could try reading his post, it tells you!!!
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
User avatar
mart3p
Tycoon
Tycoon
Posts: 1030
Joined: 31 Oct 2005 21:00
Location: UK

Post by mart3p »

peter1138 wrote:Should I put mine on hold and let mart3p get on with it? ;-)
:shock:
peter1138 wrote:More seriously, perhaps we should put up a page on the wiki to allocate our tasks to stop duplication... Let's use http://wiki.openttd.org/index.php/Tasks

Good idea, in fact, I've already contributed.
bobingabout wrote:you could try reading his post, it tells you!!!

It not only tells you but there are download links as well!
Image
User avatar
mart3p
Tycoon
Tycoon
Posts: 1030
Joined: 31 Oct 2005 21:00
Location: UK

Post by mart3p »

There is now an updated patch in the first post. It seems to be working ok with DBSetXL.

There is one bug that I know about, one of the goods vans has the refit options "Livestock (packaged)" and "Livestock (Beer)"!! :D I think the reason for this is DBSetXL's use of Action 0 property 8 for cargo types. This isn't yet supported by OTTD but I think NewCargoes might be on the way...

Please let me know if you find any further bugs. I will build a new win32 exe and post it later (follow link in first post).
Attachments
Conningville Transport, 12th Oct 1936.png
Conningville Transport, 12th Oct 1936.png (50.46 KiB) Viewed 15687 times
Image
User avatar
Jim Starluck
Traffic Manager
Traffic Manager
Posts: 135
Joined: 26 Jun 2005 20:12
Location: Cincinnati, OH
Contact:

Post by Jim Starluck »

Brianetta wrote:I'd rather have shared rails, than just pretend that there are lots of companies by using liveries. It is clever, though.
That's not the only use. One player could refit to exclusively LNER appearances, the other Great Western. Essentially two complete trainsets (graphics-wise) for the cost of one .grf.

Pretty darn nifty if you ask me. Which .grfs use this again?
If at first you don't succeed, get a bigger locomotive and try again.
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

Jim Starluck wrote:
Brianetta wrote:I'd rather have shared rails, than just pretend that there are lots of companies by using liveries. It is clever, though.
That's not the only use. One player could refit to exclusively LNER appearances, the other Great Western. Essentially two complete trainsets (graphics-wise) for the cost of one .grf.

Pretty darn nifty if you ask me. Which .grfs use this again?
Sold.

The only one I'm aware of is Born_Acorn's IC125 set, which is just the one train.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 3 guests