- general:
- a industry can accept and produce multiple cargos.
- CB 14B/14C define which cargos and they define a sorting order for the GUI.
- In all other places the sorting order does not matter. All callbacks get a cargo type (according to cargo translation table) instead of "n-th cargo".
- industry properties:
- * property 10 and 11 remain unchanged. additional cargos can only be defined via callback.
- * property 12 and 13, 1C, 1D and 1E remain unchanged. additional cargos must use production callback.
- * property 1A: new special flag 18/0x40000 to enable more than 3/2 input/output cargos. this changes the behaviour of various callbacks, see below. (IndustrySpec::behaviour, INDUSTRYBEH_xxx)
- industry tile properties:
- * property 0A, 0B and 0C remain unchanged. Industries have to distribute multiple acceptances over multiple tiles.
- industry variables (IndustriesScopeResolver::GetVariable):
- * var 69[x]: waiting cargo for cargo x. x is an index into the cargo translation table
- * var 6A[x]: Amount of cargo produced this month for cargo x. x is an index into the cargo translation table
- * var 6B[x]: Amount of cargo transported this month for cargo x (like 98 and 9A). x is an index into the cargo translation table
- * var 6C[x]: Amount of cargo produced last month for cargo x (like 9E and A0). x is an index into the cargo translation table
- * var 6D[x]: Amount of cargo transported last month for cargo x (like A2 and A4). x is an index into the cargo translation table
- * var 6E[x]: Date when cargo x was accepted last in days since year 0 (similar to B4, but per cargo type). x is an index into the cargo translation table
- * var 8A and 8C remain unchanged. there is no matching variable for other cargos.
- * var 9C and 9D remain unchanged. there is no matching variable for other cargos.
- callback 2B and 2C remain unchanged. Industries have to distribute multiple acceptances over multiple tiles.
- callback 37: (CBID_INDUSTRY_CARGO_SUFFIX)
- * if special flag 40000 is clear:
- var 18 bits 0..7:
- 00..04 with old behaviour
- * if special flag 40000 is set:
- var 18 bits 0..7:
- 00: input cargo
- 01: output cargo
- var 18 bits 16..23: cargo type from cargo translation table
- callback 3D remains unchanged, it works just fine.
- callback 14B, 14C: (CBID_INDUSTRY_INPUT_CARGO_TYPES, CBID_INDUSTRY_OUTPUT_CARGO_TYPES)
- * these callback are now called more often than before.
- * if the newgrf returns more types than allowed, this raises a newgrf error message. (ErrorUnknownCallbackResult)
- * if special flag 40000 is clear, this also enforced max 3 input and 2 output cargos.
- * these callbacks are now also called in "purchase list".
- * if the callback may return different cargo types at different types, then the "purchase list" variant must return a superset of all possible results.
- OpenTTD checks this and issues ErrorUnknownCallbackResult or similar.
- production callback version 02: (IndustryProductionSpriteGroup, NewSpriteGroup, IndustryProductionCallback)
- 02 0A <set-id> <version> <num-input-cargo> ( <input-cargo-x> <subtract-in-x> )* <num-output-cargos> ( <output-cargo-x> <add-out-x> )* <again>
- <set-id> B ID for this definition
- <version> B Version of the production callback format, 02
- <num-input-cargo> B Number of ( <input-cargo-x> <subtract-in-x> ) pairs to follow
- <input-cargo-x> B Index into cargo translation table. Must be one of the types returned by CB 14B, or is ignored (no error)
- <subtract-in-x> B Index of register, containing the amount of cargo to process.
- <num-output-cargo> B Number of ( <output-cargo-x> <add-out-x> ) pairs to follow
- <output-cargo-x> B Index into cargo translation table. Must be one of the types returned by CB 14C, or is ignored (no error)
- <add-out-x> B Index of register, containing the amount of cargo to output.
- <again> B Number of <again> register. Repeat callback if the value of the register isn't zero, do not repeat otherwise