Loading

Paste #pluvfpqiw

  1. planetmaker@localhost:~/ottd/grfdev$ nmlc -d test_nml.nml
  2. Switch, Feature = 0, name = pass_weight_switch
  3.   Expression:
  4.     ID: vehicle_type_id
  5.   Body:
  6.     Min:
  7.       Int: 0
  8.     Max:
  9.       Int: 0
  10.     Result:
  11.       Return value:
  12.         Int: 35
  13.     Min:
  14.       Int: 1
  15.     Max:
  16.       Int: 1
  17.     Result:
  18.       Return value:
  19.         Int: 70
  20.     Min:
  21.       ID: default
  22.     Max:
  23.       ID: default
  24.     Result:
  25.       Return value:
  26.         Int: 0
  27. Switch, Feature = 0, name = pass_weight_checks
  28.   Expression:
  29.     ID: grfid
  30.   Body:
  31.     Min:
  32.       Call function: str2number
  33.         Parameter:
  34.           String literal: "EN\01\01"
  35.     Max:
  36.       Call function: str2number
  37.         Parameter:
  38.           String literal: "EN\01\01"
  39.     Result:
  40.       Go to block:
  41.         ID: pass_weight_switch
  42.     Min:
  43.       ID: default
  44.     Max:
  45.       ID: default
  46.     Result:
  47.       Return value:
  48.         Int: 0
  49. Item, feature 0x0
  50.   Property block:
  51.     Property: weight
  52.       ID: pass_weight_checks
  53.  nmlc warning: "test_nml.nml", line 8: Block 'pass_weight_checks' is not referenced, ignoring.
  54.  nmlc warning: "test_nml.nml", line 2: Block 'pass_weight_switch' is not referenced, ignoring.
  55. nmlc ERROR: "test_nml.nml", line 15: Binary operator requires both operands to be integers.
  56. planetmaker@localhost:~/ottd/grfdev$ nmlc -s test_nml.nml
  57.  nmlc warning: "test_nml.nml", line 8: Block 'pass_weight_checks' is not referenced, ignoring.
  58.  nmlc warning: "test_nml.nml", line 2: Block 'pass_weight_switch' is not referenced, ignoring.
  59. nmlc ERROR: "test_nml.nml", line 15: Binary operator requires both operands to be integers.
  60. Traceback (most recent call last):
  61.   File "/home/planetmaker/bin/nmlc", line 6, in <module>
  62.     main.run()
  63.   File "/home/planetmaker/ottd/grfdev/nml/nml/main.py", line 425, in run
  64.     main(sys.argv[1:])
  65.   File "/home/planetmaker/ottd/grfdev/nml/nml/main.py", line 170, in main
  66.     ret = nml(input, input_filename, opts.debug, outputs, opts.start_sprite_num, opts.compress, opts.crop, not opts.no_cache, opts.forced_palette, opts.md5_filename)
  67.   File "/home/planetmaker/ottd/grfdev/nml/nml/main.py", line 248, in nml
  68.     tmp_actions = result.get_action_list()
  69.   File "/home/planetmaker/ottd/grfdev/nml/nml/ast/base_statement.py", line 154, in get_action_list
  70.     action_list.extend(stmt.get_action_list())
  71.   File "/home/planetmaker/ottd/grfdev/nml/nml/ast/item.py", line 98, in get_action_list
  72.     return base_statement.BaseStatementList.get_action_list(self)
  73.   File "/home/planetmaker/ottd/grfdev/nml/nml/ast/base_statement.py", line 154, in get_action_list
  74.     action_list.extend(stmt.get_action_list())
  75.   File "/home/planetmaker/ottd/grfdev/nml/nml/ast/item.py", line 169, in get_action_list
  76.     return action0.parse_property_block(self.prop_list, item_feature, item_id, item_size)
  77.   File "/home/planetmaker/ottd/grfdev/nml/nml/actions/action0.py", line 661, in parse_property_block
  78.     value_list_list.extend(parse_property_value(prop_info, prop.value, prop.unit, size_bit) for prop_info in new_prop_info_list)
  79.   File "/home/planetmaker/ottd/grfdev/nml/nml/actions/action0.py", line 661, in <genexpr>
  80.     value_list_list.extend(parse_property_value(prop_info, prop.value, prop.unit, size_bit) for prop_info in new_prop_info_list)
  81.   File "/home/planetmaker/ottd/grfdev/nml/nml/actions/action0.py", line 518, in parse_property_value
  82.     value = prop_info['value_function'](value)
  83.   File "/home/planetmaker/ottd/grfdev/nml/nml/actions/action0properties.py", line 179, in <lambda>
  84.     low_byte_info = {'num': low_prop, 'size': 1, 'value_function': lambda value: BinOp(nmlop.AND, value, ConstantNumeric(0xFF, value.pos), value.pos).reduce()}
  85.   File "/home/planetmaker/ottd/grfdev/nml/nml/expression/binop.py", line 77, in reduce
  86.     self.op.validate_func(expr1, expr2, self.pos)
  87.   File "/home/planetmaker/ottd/grfdev/nml/nml/nmlop.py", line 100, in validate_func_int
  88.     raise generic.ScriptError("Binary operator requires both operands to be integers.", pos)
  89. nml.generic.ScriptError: "test_nml.nml", line 15: Binary operator requires both operands to be integers.
  90. planetmaker@localhost:~/ottd/grfdev$ cd nml
  91. planetmaker@localhost:~/ottd/grfdev/nml$ hg pull -u
  92. Rufe von http://dev.openttdcoop.org/hg/nml ab
  93. echte Adresse ist https://hg.openttdcoop.org/nml
  94. Suche nach Ă„nderungen
  95. Keine Ă„nderungen gefunden
  96. planetmaker@localhost:~/ottd/grfdev/nml$ cd ..
  97. planetmaker@localhost:~/ottd/grfdev$ cat test_nml.nml
  98. //Sets weight of the passenger carriage based on the engine.
  99. switch(FEAT_TRAINS, PARENT, pass_weight_switch,  vehicle_type_id) {
  100.    0: return 35;
  101.    1: return 70;
  102.    default: return 0;
  103. }
  104. //Checks for native grfid
  105. switch(FEAT_TRAINS, PARENT, pass_weight_checks, grfid) {
  106.    str2number("EN\01\01"): pass_weight_switch;
  107.    default: return 0;
  108. }
  109. //Passenger Car
  110. item(FEAT_TRAINS, item_passenger_wagon, 0) {
  111.    property {
  112.       weight: pass_weight_checks;
  113.    }
  114. }

Comments