Loading

Paste #pg1abrk2j

  1. general:
  2.   a industry can accept and produce multiple cargos.
  3.   CB 14B/14C define which cargos and they define a sorting order for the GUI.
  4.   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".
  5.  
  6. industry properties:
  7. * property 10 and 11 remain unchanged. additional cargos can only be defined via callback.
  8. * property 12 and 13, 1C, 1D and 1E remain unchanged. additional cargos must use production callback.
  9. *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.
  10.  
  11. industry tile properties:
  12. * property 0A, 0B and 0C remain unchanged. Industries have to distribute multiple acceptances over multiple tiles.
  13.  
  14. industry variables:
  15. * var 69[x]: waiting cargo for cargo x. x is an index into the cargo translation table
  16. * var 6A[x]: Amount of cargo produced this month for cargo x. x is an index into the cargo translation table
  17. * 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
  18. * 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
  19. * 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
  20. * 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
  21. * var 8A and 8C remain unchanged. there is no matching variable for other cargos.
  22. * var 9C and 9D remain unchanged. there is no matching variable for other cargos.
  23.  
  24. callback 2B and 2C remain unchanged. Industries have to distribute multiple acceptances over multiple tiles.
  25.  
  26. callback 37:
  27. * if special flag 40000 is clear:
  28.   var 18 bits 0..7:
  29.     00..04 with old behaviour
  30. * if special flag 40000 is set:
  31.   var 18 bits 0..7:
  32.     00: input cargo
  33.     01: output cargo
  34.   var 18 bits 16..23: cargo type from cargo translation table
  35.  
  36. callback 3D remains unchanged, it works just fine.
  37.  
  38. callback 14B, 14C:
  39. * these callback are now called more often than before.
  40.   * if the newgrf returns more types than allowed, this raises a newgrf error message. (ErrorUnknownCallbackResult)
  41.   * if special flag 40000 is clear, this also enforced max 3 input and 2 output cargos.
  42. * these callbacks are now also called in "purchase list".
  43.   * if the callback may return different cargo types at different types, then the "purchase list" variant must return a superset of all possible results.
  44.     OpenTTD checks this and issues ErrorUnknownCallbackResult or similar.
  45.  
  46. production callback version 02:
  47.   02 0A <set-id> <version> <num-input-cargo> ( <input-cargo-x> <subtract-in-x> )* <num-output-cargos> ( <output-cargo-x> <add-out-x> )* <again>
  48.     <set-id>           B   ID for this definition
  49.     <version>          B   Version of the production callback format, 02
  50.     <num-input-cargo>  B   Number of  ( <input-cargo-x> <subtract-in-x> ) pairs to follow
  51.     <input-cargo-x>    B   Index into cargo translation table. Must be one of the types returned by CB 14B, or is ignored (no error)
  52.     <subtract-in-x>    B   Index of register, containing the amount of cargo to process.
  53.     <num-output-cargo> B   Number of  ( <output-cargo-x> <add-out-x> ) pairs to follow
  54.     <output-cargo-x>   B   Index into cargo translation table. Must be one of the types returned by CB 14C, or is ignored (no error)
  55.     <add-out-x>        B   Index of register, containing the amount of cargo to output.
  56.     <again>            B   Number of <again> register. Repeat callback if the value of the register  isn't zero, do not repeat otherwise

Comments