Loading

Revision differences

Old revision #p3cta5jsgNew revision #pemwqxdcm
6 min_compatible_version: 1;  6 min_compatible_version: 1;  
7}  7}  
8  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  
  21produce (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  
  27switch (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  
  34switch (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  
  41switch (FEAT_INDUSTRIES, SELF, init_industry, [  
  42  STORE_PERM(512, 0),  
  43  extra_callback_info1  
  44]) {  
  45  return 16;  
  46}  
  47  
9item (FEAT_INDUSTRIES, item_industry_coal_mine) {  48item (FEAT_INDUSTRIES, item_industry_coal_mine) {  
10 property {  49 property {  
11  substitute: 00; // coal mine  50  substitute: 00; // coal mine  
12  override: 00;  51  override: 00;  
  52  prod_multiplier: [5, 0]  
13 }  53 }  
14 graphics {  54 graphics {  
15  random_prod_change: STORE_PERM(extra_callback_info_1, 1);  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;
16 }  59 }  
17}  17}
18    
19# nmlc output:    
20# ERROR: "main.nml", line 16: Unrecognized identifier 'extra_callback_info_1' encountered