You can have 65535 types of vehicles to choose since r12924!

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

User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: You can have 65535 types of vehicles to choose since r12924!

Post by Zephyris »

The callback result for building an articulated vehicle is the vehicle ID or (if over 7F) the 80 plus the vehicle ID you want to add, but reversed. This means only vehicle IDs of under 7F (ie. half of them) cannnot be used for the carriage of articulated vehicles...

*edit* Just to expand on this - whilst all vehicles may be the head of an articulated consist not all may be a trailer, this is very constricting when trying to keep vehicles in some kind of logical order.
Clovertown
Engineer
Engineer
Posts: 56
Joined: 24 May 2008 17:07

Re: You can have 65535 types of vehicles to choose since r12924!

Post by Clovertown »

You can always put the trailers first in the GRF file. Unless of course you need more than 127 different trailers...

The callback result would need to use all 15 bits.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: You can have 65535 types of vehicles to choose since r12924!

Post by Zephyris »

The problem is that every trailer has to be a separate vehicle, atm I am limited to ~200 vechicles when I would ideally want >256 :)
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1732
Joined: 30 Mar 2005 09:43

Re: You can have 65535 types of vehicles to choose since r12924!

Post by peter1138 »

Brings up a question... Should livery overrides be supported for road vehicles?
He's like, some kind of OpenTTD developer.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: You can have 65535 types of vehicles to choose since r12924!

Post by Zephyris »

I was thinking that, it would be a powerful feature for creating generic trailers.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: You can have 65535 types of vehicles to choose since r12924!

Post by DaleStan »

Livery overrides can be faked pretty easily with a type 82/86/8A check of var C6.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Clovertown
Engineer
Engineer
Posts: 56
Joined: 24 May 2008 17:07

Re: You can have 65535 types of vehicles to choose since r12924!

Post by Clovertown »

Zephyris wrote:The problem is that every trailer has to be a separate vehicle, atm I am limited to ~200 vechicles when I would ideally want >256 :)
Why? Aren't the vehicle IDs supposed to be extended bytes now? Except in the callback result that is.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: You can have 65535 types of vehicles to choose since r12924!

Post by Zephyris »

I was under the impression there was still a limit of 256 per GRF file...
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: You can have 65535 types of vehicles to choose since r12924!

Post by DJ Nekkid »

peter1138 wrote:
Zephyris wrote:only 256 vehicles may be coded per GRF and articulation cannot be used for most of them...
Actually, not true.
DJ Nekkid wrote:care to enlighten us, or show us some sort of wikipage or something? :)
DaleStan wrote:Please try looking at the wiki before asking for documentation that already exists.
What about actually bringing something new to the conversation, and not just point to some generic page? That wikipage is a somewhat good source for nfo-programming, but i heavent read too much on the question we had. That only the first 127 vehID's can use articulation :)

So, please have some more specific pointers, if you have any, as i think all people who have some remote interest in the question mentioned know where to find the .nfo documentation.
Member of the
ImageImage
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: You can have 65535 types of vehicles to choose since r12924!

Post by DaleStan »

Try reading the rest of the documentation, which has specified the incantations necessary to set properties for up to 65536 of *absolutely anything* since newsounds was invented (August of two thousand five), and rather more recently was updated to include the incantations for setting graphics for up to 65536 of *absolutely anything* and names for up to 65536 vehicles.

Don't whine to me if you can't be bothered to check the wiki twice a month for updates. It's not like it's that hard to find the list of most-recently updated pages. Or, if you must, whine that you looked at @PAGES and didn't find anything promising.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: You can have 65535 types of vehicles to choose since r12924!

Post by Zephyris »

So are you saying action 0 and 3s can use extendd bytes for vehicle IDs?
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: You can have 65535 types of vehicles to choose since r12924!

Post by DaleStan »

Well, yes and no. What I'm actually saying is "What do the Action0, Action3, and Action4 wiki pages say?"

As a coder in a rather disturbingly dynamic language, it behooves you to watch the spec and read every single change. Old limitations may disappear or new abilities may appear, and if you don't pay attention, you come out ... well, "smelling like roses" it ain't.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: You can have 65535 types of vehicles to choose since r12924!

Post by DJ Nekkid »

it seems to me that if you add /b* you use the extended byte thingy for vehID's
Member of the
ImageImage
barber16
Engineer
Engineer
Posts: 1
Joined: 13 Aug 2008 22:20

Re: You can have 65535 types of vehicles to choose since r12924!

Post by barber16 »

could anyone tell me where the 'valve supersonic' ships come from in the screenshot
User avatar
Digitalfox
Chief Executive
Chief Executive
Posts: 708
Joined: 28 Oct 2004 04:42
Location: Catch the Fox if you can... Almost 20 years and counting!

Re: You can have 65535 types of vehicles to choose since r12924!

Post by Digitalfox »

barber16 wrote:could anyone tell me where the 'valve supersonic' ships come from in the screenshot
It's from the Mars set :mrgreen:

Where can you get it? Well I don't remember from what topic I got it :(
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: You can have 65535 types of vehicles to choose since r12924!

Post by Gremnon »

Grfcrawler entry
Grfcrawler has most every TTDP and OTTD grfs these days.
Kumagoro
Engineer
Engineer
Posts: 58
Joined: 21 Oct 2004 15:29

Re: You can have 65535 types of vehicles to choose since r12924!

Post by Kumagoro »

Clovertown wrote:Using the original vehicle grf posted in this thread makes the vehicles unable to load any cargo. Even if it is the only grf loaded. Newgrf vehicles (including new wagons on original train engines) will still work, but only if their grf was loaded before origengs.grf.

I'm using the latest nightly (13232 as of this post).
Yeah, got that problem too. Wonder what causes that...
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1732
Joined: 30 Mar 2005 09:43

Re: You can have 65535 types of vehicles to choose since r12924!

Post by peter1138 »

*cough* Probably because that GRF set all cargo load amounts to 0...
He's like, some kind of OpenTTD developer.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: You can have 65535 types of vehicles to choose since r12924!

Post by DaleStan »

That could possibly cause problems.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Kumagoro
Engineer
Engineer
Posts: 58
Joined: 21 Oct 2004 15:29

Re: You can have 65535 types of vehicles to choose since r12924!

Post by Kumagoro »

Now who the hell did that :o
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Amazon [Bot] and 28 guests