Access to cargo weight in vehicle var 47

Got an idea for a new feature in TTDPatch? Post it here.

Moderator: TTDPatch Moderators

Post Reply
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Access to cargo weight in vehicle var 47

Post by DaleStan »

Would it be possible to use the reserved byte of variable 47 to access property 0F of the cargo it is carrying? This would make coding weight-based capacity for the planes much easier and more reliable.

With this, I could just type "02 03 <ID> 85 1A 20 <capacity in sixteenth-tonnes> 08 47 08 FF 00 00 <default>" and that would work.
Currently, I have to maintain a cargo translation table, check the low byte of variable 47, and switch between several manaully calculated results, depending on the weight of that cargo. And getting the weight is not particularly easy for non-TTD cargos.

A few cargos (eg passengers, tourists, and probably livestock) would still require the latter solution, but dealing with three cargos is a massive improvement over dealing with fifty-three (the number currently listed on the CargoTypes page)

If for some reason, variable 47 is not acceptable, but var 49 is, that would be fine too, but it seems to me that the reserved byte in var 47 is the most logical place.
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
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Done.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
Post Reply

Return to “Suggestions”

Who is online

Users browsing this forum: No registered users and 11 guests