I can make them whatever you want. The ones on that page will work, so I'll use them.George wrote:Are they what the MB's page says?Patchman wrote:The patch defines names for them, of course.George wrote:Should default cargos have these identifiers or should the GRF specify them?
OK, that's easy enough to change. It only affects how the default cargos are labelled. Just give me a list of all cargo types in TTD and what their labels should be.Not a good solution. For example, valuables, gold and diamonds should have different transportations costs, weights and in my sets armoured trucks have different capacities for them. Tropic wood is a different cargo than wood in temperate. I think they should have different identifiers, but may have same graphics.Patchman wrote:Grain, Wheat and Maize will all have the same identifier.Seems like it is not clean to me now. Let me describe how it should look like and let you say, is it possible and how hard to do it this way or may be it is possible already. Let us considerate that GRF has only one vehicle.
1) the vehicle GRF file have graphics for cargos "GRAN" "CELR" "WHET" "MAIZ" "COAL" "IRNO" "CPRO" "PTSH" "LMST" "SAND" "FRTL" "SLFR". It is a dump truck. Some graphics are the same ("GRAN" "CELR" "WHET" "MAIZ")
That's basically how it works. The refit list will still be made up from three parts: (1) allowed cargo classes, (2) forbidden cargo classes and (3) the explicit refit mask.This is the way I think that would be the easiest to code vehicles (If I understood it right). I mean the vehicle coder should not know anything about refit list or default cargos or bits where they are located. He should only specify the list of supported cargos.Patchman wrote:Is that how you want it to work, or how you think it works?2) the vehicle GRF file checks, are they accessible and loads required graphics
3) the vehicle GRF file specifies the ID and characteristics of the vehicle. The default cargo and capacity is not specified here. The capacity should be specified in the refit call-back.
4) the vehicle GRF file specifies the list of this supported cargos (4 letters ones). The first defined cargo from this list is default cargo.
5) the refit list is calculated from the list of supported cargos
And that's exactly how it works.Yes. And vehicle GRF has not to know it. It should know only the list of global identifiers. And it should support the on that level. for example, if the vehicle supports "WATR", it should support it regardless of the slot, used to put it there. Even if it is on slot 9, 1 or anything other (that cargo GRFs define), it should represent the same graphics for it because it is water.
No. You can support all possible cargos using the cargo classes still. You are only limited to 32 cargos which need exceptions in the refit list. Out of the 253 possible cargo types you can list in the translation table, 221 must be accessible through cargo class-based refit, and 32 can have exceptions to that.That way allows the GRF to support only 32 cargos in general.Bit 1 in the refit mask is whatever cargo you defined as second slot in the translation table, i.e. in my example bit 1 would refer to petrol.
You can have
- unlimited cargos available for refitting, through cargo class based refit
- unlimited cargos with generic (non-specific) graphics based on, for example, their cargo class
- different graphics for up to 253 different cargo types of your choice, specified through the translation table
- exceptions to the refit list for 32 different cargo types of your choice, specified through the first 32 entries of the translation table
- generic refit capacities for all cargo types based on their cargo class
- different refit capacities for the 253 cargo types in the translation list
I don't see why you think you need this. This does not affect the "real" cargo slots, these are still determined by the cargo grfs. My proposal only concerns how vehicles and stations decide the graphics to display and refittability.For example, slot 1 is coal if coal is defined, water if coal is not defined, rubber if not coal nor water are defined and so on. That would be hard to code I think.
For graphics, you can support 253 different cargo types, of which those that aren't active will be ignored. For refitting, you can also support 253 different cargo types, but 221 must be set via cargo classes, and 32 can be set or removed from the cargo class selection.
There's no need to know or care which cargo is in the "real" cargo bit or slot 1.
There will be no problem unless there are vehicles refitted to cargos which have changed (or don't exist now), but then they'll just use the new type instead. That cannot be changed.That could lead to a problem with lunching saves on the other PCs, where some global cargo identifiers are missing
Again, you seem to be talking about real cargo bits, which simply don't matter here. The very idea of this translation table is that each vehicle grf can define its own idea of which IDs a certain cargo should use, no matter what its real cargo slot and bit are.But how can I specify, that the second slot is coal if the coal is specified, water if not, rubber if not neither coal nor water? Have a look:
You don't need to. That's what the translation table does for you.As you can see, different schemas can specify different slots for one cargo, and different combinations are possible. It would be rather hard to search for all the possible locations of one cargo for the vehicle.