Loading

nml question

  1. grf {
  2.  grfid : "ZUU0";
  3.  name : string(STR_GRF_NAME);
  4.  desc : string(STR_GRF_DESCRIPTION);
  5.  version: 1;
  6.  min_compatible_version: 1;
  7. }
  8.  
  9. /* Behaviour:
  10.  *   Industry is constructed with 'storage 0' set to 512, which means 100%.
  11.  *   GS sets 'storage 0' via command.
  12.  *   Actual production modifier is: (1 + storage0/256) / 3
  13.  *     storage0 = 0   ->  33%
  14.  *     storage0 = 256 ->  66%
  15.  *     storage0 = 512 -> 100%
  16.  *     storage0 = 1024 -> 166%
  17.  *   Special value:
  18.  *     Adding 0x10000 to storage0 announces closure and closes the industry next month.
  19.  */
  20.  
  21. produce (primary_produce,
  22.   0, 0, 0,
  23.   production_rate_1 * (LOAD_PERM(0) & 0xFFFF) / 256,
  24.   production_rate_2 * (LOAD_PERM(0) & 0xFFFF) / 256,
  25. );
  26.  
  27. switch (FEAT_INDUSTRIES, SELF, monthly_check), [
  28.   LOAD_PERM(0) >> 16
  29. ]) {
  30.   1: return CB_RESULT_IND_PROD_CLOSE;
  31.   0: return CB_RESULT_IND_PROD_NO_CHANGE;
  32. }
  33.  
  34. switch (FEAT_INDUSTRIES, SELF, switch_prod_change, [
  35.   STORE_PERM(extra_callback_info1, 0),
  36.   extra_callback_info1
  37. ]) {
  38.   return CB_RESULT_IND_PROD_CLOSE;
  39. }
  40.  
  41. switch (FEAT_INDUSTRIES, SELF, init_industry, [
  42.   STORE_PERM(512, 0),
  43.   extra_callback_info1
  44. ]) {
  45.   return 16;
  46. }
  47.  
  48. item (FEAT_INDUSTRIES, item_industry_coal_mine) {
  49.  property {
  50.   substitute: 00; // coal mine
  51.   override: 00;
  52.   prod_multiplier: [5, 0]
  53.  }
  54.  graphics {
  55.   build_prod_change: init_industry;
  56.   random_prod_change: switch_prod_change;
  57.   monthly_prod_change: monthly_check;
  58.   produce_256_ticks: primary_produce;
  59.  }
  60. }

Version history

Revision # Author Created at
psons6rk3 Anonymous 23 Jul 2015, 19:04:25 UTC Diff
pwjxexar9 Anonymous 23 Jul 2015, 18:19:51 UTC Diff
pb848eosb Anonymous 23 Jul 2015, 18:19:37 UTC Diff
p3cta5jsg Anonymous 23 Jul 2015, 18:12:55 UTC Diff

Comments