Loading
#openttdcoop - Paste
Archives
Trending
Docs
Login
ABAP
ActionScript
ActionScript 3
Ada
AIMMS3
ALGOL 68
Apache configuration
AppleScript
Apt sources
ARM ASSEMBLER
ASM
ASP
asymptote
Autoconf
Autohotkey
AutoIt
AviSynth
awk
BASCOM AVR
Bash
Basic4GL
BibTeX
BlitzBasic
bnf
Boo
Brainfuck
C
C#
C (LoadRunner)
C (Mac)
C (WinAPI)
C++
C++ (Qt)
C++ (WinAPI)
CAD DCL
CAD Lisp
CFDG
ChaiScript
Chapel
CIL
Clojure
CMake
COBOL
CoffeeScript
ColdFusion
CSS
Cuesheet
D
Dart
DCL
DCPU-16 Assembly
DCS
Delphi
Diff
DIV
DOS
dot
E
ECMAScript
Eiffel
eMail (mbox)
EPC
Erlang
Euphoria
EZT
F#
Falcon
FO (abas-ERP)
Formula One
Fortran
FreeBasic
FreeSWITCH
GADV 4CS
GAMBAS
GDB
genero
Genie
glSlang
GML
GNU/Octave
GNU Gettext
GNU make
Gnuplot
Go
Groovy
GwBasic
Haskell
Haxe
HicEst
HQ9+
HTML
HTML5
Icon
INI
Inno
INTERCAL
Io
ISPF Panel
J
Java
Java(TM) 2 Platform Standard Edition 5.0
Javascript
JCL
jQuery
KiXtart
KLone C
KLone C++
LaTeX
LDIF
Liberty BASIC
Lisp
LLVM Intermediate Representation
Locomotive Basic
Logtalk
LOLcode
Lotus Notes @Formulas
LotusScript
LScript
LSL2
Lua
MagikSF
MapBasic
Matlab M
Microchip Assembler
Microsoft Registry
mIRC Scripting
MMIX
Modula-2
Modula-3
MOS 6502 (6510) ACME Cross Assembler format
MOS 6502 (6510) Kick Assembler format
MOS 6502 (6510) TASM/64TASS 1.46 Assembler format
Motorola 68000 - HiSoft Devpac ST 2 Assembler format
Motorola 68000 Assembler
MXML
MySQL
Nagios
NetRexx
newlisp
nginx
Nimrod
NML NewGRF Meta Language
NSIS
Oberon-2
Objeck Programming Language
Objective-C
OCaml
OCaml (brief)
ooRexx
OpenBSD Packet Filter
OpenOffice.org Basic
Oracle 8 SQL
Oracle 11 SQL
Oxygene
OZ
ParaSail
PARI/GP
Pascal
PCRE
per
Perl
Perl 6
PHP
PHP (brief)
PIC16
Pike
Pixel Bender 1.0
PL/I
PL/SQL
PostgreSQL
PostScript
POVRAY
PowerBuilder
PowerShell
ProFTPd configuration
Progress
Prolog
PROPERTIES
ProvideX
Puppet
PureBasic
Python
Python for S60
q/kdb+
QBasic/QuickBASIC
QML
R / S+
Racket
Rails
RBScript
REBOL
rexx
robots.txt
RPM Specification File
Ruby
Rust
SAS
Scala
Scheme
SciLab
SCL
sdlBasic
Smalltalk
Smarty
SPARK
SPARQL
SQL
Squirrel Script
Squirrel Script with OpenTTD AI/GS
StandardML
StoneScript
SystemVerilog
T-SQL
TCL
Tera Term Macro
Text
thinBasic
TypoScript
Unicon (Unified Extended Dialect of Icon)
Uno Idl
Unreal Script
UPC
Urbi
Vala
vb.net
VBScript
Vedit macro language
Verilog
VHDL
Vim Script
Visual Basic
Visual Fox Pro
Visual Prolog
Whitespace
Whois (RPSL format)
Winbatch
X++
XBasic
XML
Xorg configuration
YAML
ZiLOG Z80 Assembler
ZXBasic
planetmaker@localhost:~/ottd/grfdev$ nmlc -d test_nml.nml Switch, Feature = 0, name = pass_weight_switch Expression: ID: vehicle_type_id Body: Min: Int: 0 Max: Int: 0 Result: Return value: Int: 35 Min: Int: 1 Max: Int: 1 Result: Return value: Int: 70 Min: ID: default Max: ID: default Result: Return value: Int: 0 Switch, Feature = 0, name = pass_weight_checks Expression: ID: grfid Body: Min: Call function: str2number Parameter: String literal: "EN\01\01" Max: Call function: str2number Parameter: String literal: "EN\01\01" Result: Go to block: ID: pass_weight_switch Min: ID: default Max: ID: default Result: Return value: Int: 0 Item, feature 0x0 Property block: Property: weight ID: pass_weight_checks nmlc warning: "test_nml.nml", line 8: Block 'pass_weight_checks' is not referenced, ignoring. nmlc warning: "test_nml.nml", line 2: Block 'pass_weight_switch' is not referenced, ignoring. nmlc ERROR: "test_nml.nml", line 15: Binary operator requires both operands to be integers. planetmaker@localhost:~/ottd/grfdev$ nmlc -s test_nml.nml nmlc warning: "test_nml.nml", line 8: Block 'pass_weight_checks' is not referenced, ignoring. nmlc warning: "test_nml.nml", line 2: Block 'pass_weight_switch' is not referenced, ignoring. nmlc ERROR: "test_nml.nml", line 15: Binary operator requires both operands to be integers. Traceback (most recent call last): File "/home/planetmaker/bin/nmlc", line 6, in <module> main.run() File "/home/planetmaker/ottd/grfdev/nml/nml/main.py", line 425, in run main(sys.argv[1:]) File "/home/planetmaker/ottd/grfdev/nml/nml/main.py", line 170, in main 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) File "/home/planetmaker/ottd/grfdev/nml/nml/main.py", line 248, in nml tmp_actions = result.get_action_list() File "/home/planetmaker/ottd/grfdev/nml/nml/ast/base_statement.py", line 154, in get_action_list action_list.extend(stmt.get_action_list()) File "/home/planetmaker/ottd/grfdev/nml/nml/ast/item.py", line 98, in get_action_list return base_statement.BaseStatementList.get_action_list(self) File "/home/planetmaker/ottd/grfdev/nml/nml/ast/base_statement.py", line 154, in get_action_list action_list.extend(stmt.get_action_list()) File "/home/planetmaker/ottd/grfdev/nml/nml/ast/item.py", line 169, in get_action_list return action0.parse_property_block(self.prop_list, item_feature, item_id, item_size) File "/home/planetmaker/ottd/grfdev/nml/nml/actions/action0.py", line 661, in parse_property_block value_list_list.extend(parse_property_value(prop_info, prop.value, prop.unit, size_bit) for prop_info in new_prop_info_list) File "/home/planetmaker/ottd/grfdev/nml/nml/actions/action0.py", line 661, in <genexpr> value_list_list.extend(parse_property_value(prop_info, prop.value, prop.unit, size_bit) for prop_info in new_prop_info_list) File "/home/planetmaker/ottd/grfdev/nml/nml/actions/action0.py", line 518, in parse_property_value value = prop_info['value_function'](value) File "/home/planetmaker/ottd/grfdev/nml/nml/actions/action0properties.py", line 179, in <lambda> low_byte_info = {'num': low_prop, 'size': 1, 'value_function': lambda value: BinOp(nmlop.AND, value, ConstantNumeric(0xFF, value.pos), value.pos).reduce()} File "/home/planetmaker/ottd/grfdev/nml/nml/expression/binop.py", line 77, in reduce self.op.validate_func(expr1, expr2, self.pos) File "/home/planetmaker/ottd/grfdev/nml/nml/nmlop.py", line 100, in validate_func_int raise generic.ScriptError("Binary operator requires both operands to be integers.", pos) nml.generic.ScriptError: "test_nml.nml", line 15: Binary operator requires both operands to be integers. planetmaker@localhost:~/ottd/grfdev$ cd nml planetmaker@localhost:~/ottd/grfdev/nml$ hg pull -u Rufe von http://dev.openttdcoop.org/hg/nml ab echte Adresse ist https://hg.openttdcoop.org/nml Suche nach Änderungen Keine Änderungen gefunden planetmaker@localhost:~/ottd/grfdev/nml$ cd .. planetmaker@localhost:~/ottd/grfdev$ cat test_nml.nml //Sets weight of the passenger carriage based on the engine. switch(FEAT_TRAINS, PARENT, pass_weight_switch, vehicle_type_id) { 0: return 35; 1: return 70; default: return 0; } //Checks for native grfid switch(FEAT_TRAINS, PARENT, pass_weight_checks, grfid) { str2number("EN\01\01"): pass_weight_switch; default: return 0; } //Passenger Car item(FEAT_TRAINS, item_passenger_wagon, 0) { property { weight: pass_weight_checks; } }
Mark as private
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
forever