Page 1 of 1

Access to cargo weight in vehicle var 47

Posted: 03 Feb 2006 01:09
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.

Posted: 03 Feb 2006 01:22
by Patchman
Done.