The m4nfo User manual and Technical Report

Technical Report

Station properties, functions and callbacks


Content

Station property functions

m4nfo station properties are based on plain nfo's action0 properties. Most of them are mapped in a straightforward way, but some of m4nfo's station property functions are based on custom calculations, or based on using more than one nfo property.

m4nfo function nfo property custom
anim_info0x16 
anim_speed0x17
anim_triggers0x18
bridge_height0x1Byes
callbacks0x0B
classlabel0x08 
exclude_lengths0x0D
exclude_widths0x0C
flags0x13
include_lengths0x0D
include_widths0x0C
layout0x09
nontrack0x15
nopylons0x11
nowires0x14
pylons0x11
setcargotriggers0x12
threshold0x10
tiletypelayout0x0E
wires0x14

Flag label Bit Value
GROUNDSPRITES00x01
DIVAMOUNT10x02
RANDOMBITS20x04
FOUNDATIONS30x08
EXTENDED40x10

Station performance functions

m4nfo station performance functions are based on plain nfo's Variational Action2 variables. Again, most of them are mapped in a straightforward way, but some of m4nfo's station performance functions are based on custom calculations, or based on use of more than one nfo variable.

Please note that functions return either Byte, Word or Dword values, depending on the context they're used in.

m4nfo function nfo var Byte Word
anim_frame0x4A/0x6681 (4A | (66 $1)) 00 FF 
anim_trigger0x1881 10 00 FF
callback0x0C81 0C 00 FF85 0C 00 FF FF
cargo_trigger0x1881 18 08 FF 
elsen/a 
pbsinfo0x4481 44 00 07
plt_axis0x40/0x4181 40/41 18 01
plt_edgescustom
plt_even81 40/41 08 01
plt_index/indexrevcustom
plt_length81 40/41 10 0F
plt_midnum0x46/0x4781 46/47 04 0F
plt_midpos81 46/47 00 0F
plt_num0x40/0x4181 40/41 08 0F
plt_numrev81 40/41 0C 0F
plt_pos81 40/41 00 0F
plt_posrev81 40/41 04 0F
plt_tiletype81 40/41 18 0F
plt_total81 40/41 14 0F
randombits0x1081 10 00 FF
spritetype
stationage0x00/0xFAcustom
test_axis0x1081 10 18 01
test_pltlength0x1881 18 10 FF
test_pltnum81 18 08 FF
test_pltpos81 18 00 FF
test_plttotal81 18 18 FF
test_position0x1081 10 00 0F
test_slope81 10 00 0F
test_tiletypecustom
tinfo_flatwater0x67
tinfo_height0x6281 62 $1 10 FF
tinfo_lclass0x6781 67 $1 18 0F
tinfo_slope81 67 $1 00 $2
tinfo_statid0x6881 68 $1 00 ff
tinfo_terrain0x42/0x6781 42 00 0F / 81 67 $1 0A 07
tinfo_trackconnect0x4581 45 00
tinfo_trackexist81 45 08
tinfo_tracktype0x4281 42 08
tinfo_water0x6781 67 $1 09 01
tinfo_waterclass81 67 $1 0D 03
testslope0x1081 10 00 0F
yearbuilt0xFA81 FA 08 FF

Station callbacks

m4nfo station callbacks are based on plain nfo's callbacks. They're all mapped in a straightforward way. Callbacks from the first section of the table below have to be enabled by property function callbacks(), but those from the second section do not need to be: they're always active and will be used automatically if needed.

m4nfo callback nfo callback
CB_AFRAME0x141
CB_ASPEED0x142
CB_AVAILABLE0x13
CB_LAYOUT0x14
CB_SLOPE0x149
CB_ACONTROL0x140
CB_AISELECT0x18
CB_TILETYPE0x24

Callback helper functions

Callback helper functions are based on m4nfo's function cbr() which returns a parameter as a callback return value.

m4nfo function definition
animcontrolcbr($1)
animframecbr($1)
grftextcbr($1)
reftile(custom)
reftxtcb

Random functions

In nfo, randomized Action2s are used to randomize the station (0x80).

m4nfo function nfo random Action2 type
random0x80
randomcb0x80
rerandom(custom)

m4nfo trigger nfo trigger
bit value
NEWCARGO01
NOCARGO12
ARRIVE24
LEAVE38
LOADING416
PBSRESERVE532
ALLTRIGGERS7128

Auxiliary functions

m4nfo function definition
little 
lots 
pos__nibble($2){}__nibble($1)
self