Difference between revisions of "NML:General"
From GRFSpecs
Jump to navigationJump to search (add nav template) |
(Add a ref for version_openttd() who will use old nml version) |
||
(25 intermediate revisions by 9 users not shown) | |||
Line 5: | Line 5: | ||
A number of global variables are available. Some are only available in switch-blocks, while others can be used in any expression. This is indicated by the second column in the following table: |
A number of global variables are available. Some are only available in switch-blocks, while others can be used in any expression. This is indicated by the second column in the following table: |
||
− | {| class=" |
+ | {| class="wikitable sortable" |
! name |
! name |
||
! Available outside switch blocks |
! Available outside switch blocks |
||
Line 11: | Line 11: | ||
! Comment |
! Comment |
||
|- |
|- |
||
− | | ttd_platform |
+ | | <code style="color:green">ttd_platform</code> |
| Yes |
| Yes |
||
− | | PLATFORM_TTDPATCH or PLATFORM_OPENTTD |
+ | | <code style="color:green">PLATFORM_TTDPATCH</code> or <code style="color:green">PLATFORM_OPENTTD</code> |
| |
| |
||
|- |
|- |
||
− | | ttdpatch_version |
+ | | <code style="color:green">ttdpatch_version</code> |
| Yes |
| Yes |
||
| |
| |
||
| |
| |
||
|- |
|- |
||
− | | openttd_version |
+ | | <code style="color:green">openttd_version</code> |
| Yes |
| Yes |
||
| |
| |
||
− | | |
+ | | Use <code style="color:green">version_openttd</code> to test and compare for a release version. |
+ | * {{ottd|≤1.11}} <code style="color:green">version_openttd(MAJOR, MINOR, BUILD)</code> |
||
+ | * {{ottd|≥12}} <code style="color:green">version_openttd(MAJOR, MINOR)</code><ref name=versionopnettd>It should be <code style="color:green">version_openttd(1, MAJOR, MINOR)</code> if you are using NML with version ≤ 0.7.3</ref> |
||
|- |
|- |
||
− | | current_palette |
+ | | <code style="color:green">current_palette</code> |
| Yes |
| Yes |
||
− | | PALETTE_DOS or PALETTE_WIN |
+ | | <code style="color:green">PALETTE_DOS</code> or <code style="color:green">PALETTE_WIN</code> |
| |
| |
||
|- |
|- |
||
− | | current_date |
+ | | <code style="color:green">current_date</code> |
| No |
| No |
||
| days since year 0 |
| days since year 0 |
||
− | | Use |
+ | | Use <code style="color:green">date(year, month, day)</code> to compare with. |
|- |
|- |
||
− | | current_year |
+ | | <code style="color:green">current_year</code> |
| No |
| No |
||
+ | | 0 .. 5000000 |
||
− | | years since year 0 |
||
| |
| |
||
|- |
|- |
||
− | | current_month |
+ | | <code style="color:green">current_month</code> |
| No |
| No |
||
| 0 .. 11 |
| 0 .. 11 |
||
| |
| |
||
|- |
|- |
||
− | | current_day_of_month |
+ | | <code style="color:green">current_day_of_month</code> |
| No |
| No |
||
| 0 .. 30 |
| 0 .. 30 |
||
| |
| |
||
|- |
|- |
||
− | | current_day_of_year |
+ | | <code style="color:green">current_day_of_year</code> |
| No |
| No |
||
| 0 .. 364 (365 in leap years) |
| 0 .. 364 (365 in leap years) |
||
| |
| |
||
|- |
|- |
||
− | | is_leapyear |
+ | | <code style="color:green">is_leapyear</code> |
| No |
| No |
||
| 0 or 1 |
| 0 or 1 |
||
| |
| |
||
|- |
|- |
||
− | | date_loaded |
+ | | <code style="color:green">date_loaded</code> |
| Yes |
| Yes |
||
| days since year 0 |
| days since year 0 |
||
| Set to the time of game load, which is the current date in single player, and the date the server started in multiplayer. This to prevent desyncs. |
| Set to the time of game load, which is the current date in single player, and the date the server started in multiplayer. This to prevent desyncs. |
||
|- |
|- |
||
− | | year_loaded |
+ | | <code style="color:green">year_loaded</code> |
| Yes |
| Yes |
||
| years since year 0 |
| years since year 0 |
||
− | | See date_loaded. |
+ | | See <code style="color:green">date_loaded</code>. |
|- |
|- |
||
− | | starting_year |
+ | | <code style="color:green">starting_year</code> |
| Yes |
| Yes |
||
| years since year 0 |
| years since year 0 |
||
| Years before 1920 are clamped to 1920 |
| Years before 1920 are clamped to 1920 |
||
|- |
|- |
||
− | | animation_counter |
+ | | <code style="color:green">animation_counter</code> |
| No |
| No |
||
| 0 .. 65535 |
| 0 .. 65535 |
||
| Increased by 1 each tick |
| Increased by 1 each tick |
||
|- |
|- |
||
− | | climate |
+ | | <code style="color:green">climate</code> |
⚫ | |||
⚫ | |||
− | | CLIMATE_XXX with XXX = [TEMPERATE | ARCTIC | TROPICAL | TOYLAND] |
+ | | <code style="color:green">CLIMATE_XXX</code> with <code style="color:green">XXX</code> = [<code style="color:green">TEMPERATE</code> <nowiki>|</nowiki> <code style="color:green">ARCTIC</code> <nowiki>|</nowiki> <code style="color:green">TROPICAL</code> <nowiki>|</nowiki> <code style="color:green">TOYLAND</code>] |
| |
| |
||
|- |
|- |
||
− | | game_mode |
+ | | <code style="color:green">game_mode</code> |
| Yes |
| Yes |
||
+ | | <code style="color:green">GAMEMODE_XXX</code> with <code style="color:green">XXX</code> = [<code style="color:green">MENU</code> <nowiki>|</nowiki> <code style="color:green">GAME</code> <nowiki>|</nowiki> <code style="color:green">EDITOR</code>] |
||
− | | GAMEMODE_XXX with XXX = [MENU | GAME | EDITOR] |
||
| |
| |
||
|- |
|- |
||
− | | loading_stage |
+ | | <code style="color:green">loading_stage</code> |
| Yes |
| Yes |
||
− | | LOADING_STAGE_XXX with XXX = [INITIALIZE | RESERVE | ACTIVATE | TEST] |
+ | | <code style="color:green">LOADING_STAGE_XXX</code> with <code style="color:green">XXX</code> = [<code style="color:green">INITIALIZE</code> <nowiki>|</nowiki> <code style="color:green">RESERVE</code> <nowiki>|</nowiki> <code style="color:green">ACTIVATE</code> <nowiki>|</nowiki> <code style="color:green">TEST</code>] |
| 'Phase' of the GRF loading process. |
| 'Phase' of the GRF loading process. |
||
|- |
|- |
||
− | | difficulty_level |
+ | | <code style="color:green">difficulty_level</code> |
− | | Yes |
+ | | Yes <ref name=gamechange /> |
+ | | <code style="color:green">DIFFICULTY_XXX</code> with <code style="color:green">XXX</code> = [<code style="color:green">EASY</code> <nowiki>|</nowiki> <code style="color:green">MEDIUM</code> <nowiki>|</nowiki> <code style="color:green">HARD</code> <nowiki>|</nowiki> <code style="color:green">CUSTOM</code>] |
||
− | | DIFFICULTY_XXX with XXX = [EASY | MEDIUM | HARD | CUSTOM] |
||
| |
| |
||
|- |
|- |
||
− | | display_options |
+ | | <code style="color:green">display_options</code> |
| No |
| No |
||
− | | bitmask of DISPLAY_XXX with XXX = [TOWN_NAMES | STATION_NAMES | SIGNS | ANIMATION | FULL_DETAIL] |
+ | | bitmask of <code style="color:green">DISPLAY_XXX</code> with <code style="color:green">XXX</code> = [<code style="color:green">TOWN_NAMES</code> <nowiki>|</nowiki> <code style="color:green">STATION_NAMES</code> <nowiki>|</nowiki> <code style="color:green">SIGNS</code> <nowiki>|</nowiki> <code style="color:green">ANIMATION</code> <nowiki>|</nowiki> <code style="color:green">FULL_DETAIL</code>] |
− | | Use hasbit(display_options, DISPLAY_XXX) to test a particular bit. |
+ | | Use <code style="color:green">hasbit(display_options, DISPLAY_XXX)</code> to test a particular bit. |
|- |
|- |
||
− | | desert_paved_roads |
+ | | <code style="color:green">desert_paved_roads</code> |
⚫ | |||
⚫ | |||
+ | |||
⚫ | |||
⚫ | |||
⚫ | |||
| 0 or 1 |
| 0 or 1 |
||
| If 1, desert roads have pavement and street lights. |
| If 1, desert roads have pavement and street lights. |
||
|- |
|- |
||
+ | | <code style="color:green">second_rocky_tileset</code> |
||
− | | train_width_32_px |
||
− | | Yes |
+ | | Yes <ref name=readwrite /> |
+ | | 0 or 1 |
||
+ | | {{ottdp|1.5|no|ottdrev=r27200}} If 1, rocky tiles are drawn using sprites from two ranges: 4023 - 4041 (always used) and 4042 - 4060 (used if enabled) |
||
+ | |- |
||
+ | | <code style="color:green">train_width_32_px</code> |
||
+ | | Yes <ref name=readwrite /> |
||
| 0 or 1 |
| 0 or 1 |
||
| If 1, train vehicles are 32 instead of 29 pixels wide in the depot view. |
| If 1, train vehicles are 32 instead of 29 pixels wide in the depot view. |
||
|- |
|- |
||
− | | traininfo_y_offset |
+ | | <code style="color:green">traininfo_y_offset</code> |
− | | Yes |
+ | | Yes <ref name=readwrite /> |
| -128 .. 127 |
| -128 .. 127 |
||
| Used to correctly position the depot view of trains. |
| Used to correctly position the depot view of trains. |
||
|- |
|- |
||
− | | snowline_height |
+ | | <code style="color:green">snowline_height</code> |
| No |
| No |
||
− | | 16 .. 120 in steps of 8, or 0xFF if no snow. |
+ | | {{nml|0.2}} 16 .. 120 in steps of 8, or 0xFF if no snow. |
+ | {{nml|0.3}} 0..max_tile_height, or 0xFF if no snow. |
||
− | | One tile height is equivalent to 8 units. |
+ | | {{nml|0.2}} One tile height is equivalent to 8 units. |
+ | {{nml|0.3}} It's the height in tiles. |
||
|- |
|- |
||
− | | traffic_side |
+ | | <code style="color:green">traffic_side</code> |
− | | Yes |
+ | | Yes <ref name=gamechange /> |
− | | TRAFFIC_SIDE_LEFT or TRAFFIC_SIDE_RIGHT |
+ | | <code style="color:green">TRAFFIC_SIDE_LEFT</code> or <code style="color:green">TRAFFIC_SIDE_RIGHT</code> |
| |
| |
||
|- |
|- |
||
− | | freight_trains |
+ | | <code style="color:green">freight_trains</code> |
| Yes |
| Yes |
||
| 1 .. 255 |
| 1 .. 255 |
||
| Weight multiplier for freight trains |
| Weight multiplier for freight trains |
||
|- |
|- |
||
− | | plane_speed |
+ | | <code style="color:green">plane_speed</code> |
| Yes |
| Yes |
||
| 1 .. 4 |
| 1 .. 4 |
||
| Speed multiplier for planes. Value of 1 is equal to the original speed (1/4), while 4 means that planes move at full speed (4/4) |
| Speed multiplier for planes. Value of 1 is equal to the original speed (1/4), while 4 means that planes move at full speed (4/4) |
||
|- |
|- |
||
− | | ttdpatch_flags |
+ | | <code style="color:green">ttdpatch_flags</code> |
| Yes |
| Yes |
||
| |
| |
||
| |
| |
||
|- |
|- |
||
− | | current_callback |
+ | | <code style="color:green">current_callback</code> |
| No |
| No |
||
| |
| |
||
| Set to the ID of the current callback, useful for old-style callbacks. |
| Set to the ID of the current callback, useful for old-style callbacks. |
||
|- |
|- |
||
− | | extra_callback_info1 |
+ | | <code style="color:green">extra_callback_info1</code> |
| No |
| No |
||
| Varies |
| Varies |
||
| Extra callback information, meaning differs per callback. |
| Extra callback information, meaning differs per callback. |
||
|- |
|- |
||
− | | extra_callback_info2 |
+ | | <code style="color:green">extra_callback_info2</code> |
| No |
| No |
||
| Varies |
| Varies |
||
| Extra callback information, meaning differs per callback. |
| Extra callback information, meaning differs per callback. |
||
|- |
|- |
||
− | | last_computed_result |
+ | | <code style="color:green">last_computed_result</code> |
| No |
| No |
||
| |
| |
||
| Result of the last (previously evaluated) switch block. |
| Result of the last (previously evaluated) switch block. |
||
|- |
|- |
||
− | | base_sprite_2cc |
+ | | <code style="color:green">base_sprite_2cc</code> |
| Yes |
| Yes |
||
| 0 .. 65535 |
| 0 .. 65535 |
||
| Base sprite for 2cc (dual company colour) colour-maps |
| Base sprite for 2cc (dual company colour) colour-maps |
||
|- |
|- |
||
+ | | <code style="color:green">base_sprite_foundations</code> |
||
− | | map_type |
||
| Yes |
| Yes |
||
+ | | 0 .. 65535 |
||
− | | MAP_TYPE_XXX with XXX = [RECTANGULAR | X_BIGGER | Y_BIGGER] |
||
+ | | {{ottdp|1.4|no|ottdrev=r25230}} Base sprite for foundations. This sprite block does only contain the extra foundations from [[NML:Replace_new_sprites| replacenew]] type <code style="color:green">FOUNDATIONS_SLOPES_HALFTILES</code> or <code style="color:green">FOUNDATIONS_SLOPES</code>. It does not contain the default foundations of sprites 990 to 1003 (via replace) |
||
+ | |- |
||
+ | | <code style="color:green">base_sprite_shores</code> |
||
⚫ | |||
+ | | 0 .. 65535 |
||
+ | | {{ottdp|1.4|no|ottdrev=r25230}} Base sprite for shores. All coast sprites in the order of the [[Action5#0D_Coast_tile_sprites|16 sprites version]] of [[NML:Replace_new_sprites| replacenew]] type <code style="color:green">COAST_TILES</code>. Note that, it does not matter in which way the sprites were originally defined (whether via replacenew with 10 or 16 sprites, or via replace). The sprite block returned by this variable has always all sprites in the same order. |
||
+ | |- |
||
+ | | <code style="color:green">map_type</code> |
||
⚫ | |||
+ | | <code style="color:green">MAP_TYPE_XXX</code> with <code style="color:green">XXX</code> = [<code style="color:green">RECTANGULAR</code> <nowiki>|</nowiki> <code style="color:green">X_BIGGER</code> <nowiki>|</nowiki> <code style="color:green">Y_BIGGER</code>] |
||
| |
| |
||
|- |
|- |
||
− | | map_min_edge |
+ | | <code style="color:green">map_min_edge</code> |
| Yes |
| Yes |
||
− | | 64 .. |
+ | | 64 .. 4096 |
| Length of the smallest map edge (in tiles) |
| Length of the smallest map edge (in tiles) |
||
|- |
|- |
||
− | | map_max_edge |
+ | | <code style="color:green">map_max_edge</code> |
| Yes |
| Yes |
||
− | | 64 .. |
+ | | 64 .. 4096 |
| Length of the biggest map edge (in tiles) |
| Length of the biggest map edge (in tiles) |
||
|- |
|- |
||
− | | map_x_edge |
+ | | <code style="color:green">map_x_edge</code> |
| Yes |
| Yes |
||
− | | 64 .. |
+ | | 64 .. 4096 |
| Length of the x (top-left) map edge (in tiles) |
| Length of the x (top-left) map edge (in tiles) |
||
|- |
|- |
||
− | | map_y_edge |
+ | | <code style="color:green">map_y_edge</code> |
| Yes |
| Yes |
||
− | | 64 .. |
+ | | 64 .. 4096 |
| Length of the y (top-right) map edge (in tiles) |
| Length of the y (top-right) map edge (in tiles) |
||
|- |
|- |
||
− | | map_size |
+ | | <code style="color:green">map_size</code> |
| Yes |
| Yes |
||
− | | 64*64 .. |
+ | | 64*64 .. 4096*4096 |
| Total number of tiles on the map |
| Total number of tiles on the map |
||
|- |
|- |
||
− | | long_bridges |
+ | | <code style="color:green">long_bridges</code> |
| Yes |
| Yes |
||
| 0 or 1 |
| 0 or 1 |
||
| |
| |
||
|- |
|- |
||
− | | gradual_loading |
+ | | <code style="color:green">gradual_loading</code> |
| Yes |
| Yes |
||
| 0 or 1 |
| 0 or 1 |
||
| |
| |
||
|- |
|- |
||
− | | bridge_speed_limits |
+ | | <code style="color:green">bridge_speed_limits</code> |
| Yes |
| Yes |
||
− | | 0 or 1 |
+ | | {{ttdp|}} 0 or 1 {{ottd|}} Always 1 |
| |
| |
||
|- |
|- |
||
+ | | <code style="color:green">wagon_speed_limits</code> |
||
⚫ | |||
+ | | Yes |
||
+ | | 0 or 1 |
||
+ | | {{nml|0.4}} |
||
+ | |- |
||
⚫ | |||
| Yes |
| Yes |
||
| 0 or 1 |
| 0 or 1 |
||
| |
| |
||
|- |
|- |
||
− | | electrified_railways |
+ | | <code style="color:green">electrified_railways</code> |
| Yes |
| Yes |
||
| 0 or 1 |
| 0 or 1 |
||
| |
| |
||
|- |
|- |
||
− | | unified_maglev |
+ | | <code style="color:green">unified_maglev</code> |
| Yes |
| Yes |
||
− | | 0 .. 3 |
+ | | {{ttdp|}} 0 .. 3 {{ottd|}} Always 3 |
| |
| |
||
|- |
|- |
||
− | | temperate_snowline |
+ | | <code style="color:green">temperate_snowline</code> |
| Yes |
| Yes |
||
− | | 0 or 1 |
+ | | {{ttdp|}} 0 or 1 {{ottd|}} Always 0 |
| |
| |
||
|- |
|- |
||
− | | dynamic_engines |
+ | | <code style="color:green">dynamic_engines</code> |
| Yes |
| Yes |
||
| 0 or 1 |
| 0 or 1 |
||
| |
| |
||
|- |
|- |
||
− | | variable_runningcosts |
+ | | <code style="color:green">variable_runningcosts</code> |
| Yes |
| Yes |
||
− | | 0 or 1 |
+ | | {{ttdp|}} 0 or 1 {{ottd|}} Always 1 |
| |
| |
||
|- |
|- |
||
− | | newtrains |
+ | | <code style="color:green">newtrains</code> |
| Yes |
| Yes |
||
− | | 0 or 1 |
+ | | {{ttdp|}} 0 or 1 {{ottd|}} Always 1 |
| |
| |
||
|- |
|- |
||
+ | | <code style="color:green">newrvs</code> |
||
− | | newrvs |
||
| Yes |
| Yes |
||
− | | 0 or 1 |
+ | | {{ttdp|}} 0 or 1 {{ottd|}} Always 1 |
| |
| |
||
|- |
|- |
||
− | | newships |
+ | | <code style="color:green">newships</code> |
| Yes |
| Yes |
||
− | | 0 or 1 |
+ | | {{ttdp|}} 0 or 1 {{ottd|}} Always 1 |
| |
| |
||
|- |
|- |
||
− | | newplanes |
+ | | <code style="color:green">newplanes</code> |
| Yes |
| Yes |
||
− | | 0 or 1 |
+ | | {{ttdp|}} 0 or 1 {{ottd|}} Always 1 |
| |
| |
||
|- |
|- |
||
− | | newhouses |
+ | | <code style="color:green">newhouses</code> |
| Yes |
| Yes |
||
− | | 0 or 1 |
+ | | {{ttdp|}} 0 or 1 {{ottd|}} Always 1 |
| |
| |
||
|- |
|- |
||
− | | newindustries |
+ | | <code style="color:green">newindustries</code> |
| Yes |
| Yes |
||
− | | 0 or 1 |
+ | | {{ttdp|}} 0 or 1 {{ottd|}} Always 1 |
| |
| |
||
|- |
|- |
||
− | | newcargos |
+ | | <code style="color:green">newcargos</code> |
+ | | Yes |
||
+ | | {{ttdp|}} 0 or 1 {{ottd|}} Always 1 |
||
+ | | |
||
+ | |- |
||
+ | | <code style="color:green">256_persistent_registers</code> |
||
| Yes |
| Yes |
||
| 0 or 1 |
| 0 or 1 |
||
+ | | {{nml|0.5}} |
||
| |
| |
||
+ | |- |
||
+ | | <code style="color:green">inflation</code> |
||
+ | | Yes |
||
+ | | 0 or 1 |
||
+ | | {{nml|0.7}} {{ottdp|1.11|no}} |
||
+ | |- |
||
+ | | <code style="color:green">map_seed</code> |
||
+ | | Yes |
||
+ | | 0 .. 4294967295 |
||
+ | | {{nml|0.7}} {{ottd|12.0}} |
||
|} |
|} |
||
+ | <references /> |
||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
⚫ | |||
⚫ |
Latest revision as of 13:23, 28 June 2023
Vehicles, Stations, Canals, Bridges, Towns, Houses, Industries (Tiles), Cargos, Airports+Tiles, Objects, Railtypes, Roadtypes, Tramtypes, Terrain
- common props | vars | CBs
- train | roadveh | ship | aircr props
- common variables
- industry props | vars | CBs
- tile props | vars | CBs
- airport props | vars | CBs
- tile props | vars | CBs
General variables
A number of global variables are available. Some are only available in switch-blocks, while others can be used in any expression. This is indicated by the second column in the following table:
name | Available outside switch blocks | Value range | Comment | |
---|---|---|---|---|
ttd_platform
|
Yes | PLATFORM_TTDPATCH or PLATFORM_OPENTTD
|
||
ttdpatch_version
|
Yes | |||
openttd_version
|
Yes | Use version_openttd to test and compare for a release version.
| ||
current_palette
|
Yes | PALETTE_DOS or PALETTE_WIN
|
||
current_date
|
No | days since year 0 | Use date(year, month, day) to compare with.
| |
current_year
|
No | 0 .. 5000000 | ||
current_month
|
No | 0 .. 11 | ||
current_day_of_month
|
No | 0 .. 30 | ||
current_day_of_year
|
No | 0 .. 364 (365 in leap years) | ||
is_leapyear
|
No | 0 or 1 | ||
date_loaded
|
Yes | days since year 0 | Set to the time of game load, which is the current date in single player, and the date the server started in multiplayer. This to prevent desyncs. | |
year_loaded
|
Yes | years since year 0 | See date_loaded .
| |
starting_year
|
Yes | years since year 0 | Years before 1920 are clamped to 1920 | |
animation_counter
|
No | 0 .. 65535 | Increased by 1 each tick | |
climate
|
Yes [2] | CLIMATE_XXX with XXX = [TEMPERATE | ARCTIC | TROPICAL | TOYLAND ]
|
||
game_mode
|
Yes | GAMEMODE_XXX with XXX = [MENU | GAME | EDITOR ]
|
||
loading_stage
|
Yes | LOADING_STAGE_XXX with XXX = [INITIALIZE | RESERVE | ACTIVATE | TEST ]
|
'Phase' of the GRF loading process. | |
difficulty_level
|
Yes [2] | DIFFICULTY_XXX with XXX = [EASY | MEDIUM | HARD | CUSTOM ]
|
||
display_options
|
No | bitmask of DISPLAY_XXX with XXX = [TOWN_NAMES | STATION_NAMES | SIGNS | ANIMATION | FULL_DETAIL ]
|
Use hasbit(display_options, DISPLAY_XXX) to test a particular bit.
| |
desert_paved_roads
|
Yes [3] | 0 or 1 | If 1, desert roads have pavement and street lights. | |
second_rocky_tileset
|
Yes [3] | 0 or 1 | 1.5 If 1, rocky tiles are drawn using sprites from two ranges: 4023 - 4041 (always used) and 4042 - 4060 (used if enabled) | |
train_width_32_px
|
Yes [3] | 0 or 1 | If 1, train vehicles are 32 instead of 29 pixels wide in the depot view. | |
traininfo_y_offset
|
Yes [3] | -128 .. 127 | Used to correctly position the depot view of trains. | |
snowline_height
|
No | NML 0.2 16 .. 120 in steps of 8, or 0xFF if no snow.
NML 0.3 0..max_tile_height, or 0xFF if no snow. |
NML 0.2 One tile height is equivalent to 8 units.
NML 0.3 It's the height in tiles. | |
traffic_side
|
Yes [2] | TRAFFIC_SIDE_LEFT or TRAFFIC_SIDE_RIGHT
|
||
freight_trains
|
Yes | 1 .. 255 | Weight multiplier for freight trains | |
plane_speed
|
Yes | 1 .. 4 | Speed multiplier for planes. Value of 1 is equal to the original speed (1/4), while 4 means that planes move at full speed (4/4) | |
ttdpatch_flags
|
Yes | |||
current_callback
|
No | Set to the ID of the current callback, useful for old-style callbacks. | ||
extra_callback_info1
|
No | Varies | Extra callback information, meaning differs per callback. | |
extra_callback_info2
|
No | Varies | Extra callback information, meaning differs per callback. | |
last_computed_result
|
No | Result of the last (previously evaluated) switch block. | ||
base_sprite_2cc
|
Yes | 0 .. 65535 | Base sprite for 2cc (dual company colour) colour-maps | |
base_sprite_foundations
|
Yes | 0 .. 65535 | 1.4 Base sprite for foundations. This sprite block does only contain the extra foundations from replacenew type FOUNDATIONS_SLOPES_HALFTILES or FOUNDATIONS_SLOPES . It does not contain the default foundations of sprites 990 to 1003 (via replace)
| |
base_sprite_shores
|
Yes | 0 .. 65535 | 1.4 Base sprite for shores. All coast sprites in the order of the 16 sprites version of replacenew type COAST_TILES . Note that, it does not matter in which way the sprites were originally defined (whether via replacenew with 10 or 16 sprites, or via replace). The sprite block returned by this variable has always all sprites in the same order.
| |
map_type
|
Yes | MAP_TYPE_XXX with XXX = [RECTANGULAR | X_BIGGER | Y_BIGGER ]
|
||
map_min_edge
|
Yes | 64 .. 4096 | Length of the smallest map edge (in tiles) | |
map_max_edge
|
Yes | 64 .. 4096 | Length of the biggest map edge (in tiles) | |
map_x_edge
|
Yes | 64 .. 4096 | Length of the x (top-left) map edge (in tiles) | |
map_y_edge
|
Yes | 64 .. 4096 | Length of the y (top-right) map edge (in tiles) | |
map_size
|
Yes | 64*64 .. 4096*4096 | Total number of tiles on the map | |
long_bridges
|
Yes | 0 or 1 | ||
gradual_loading
|
Yes | 0 or 1 | ||
bridge_speed_limits
|
Yes | 0 or 1 Always 1 | ||
wagon_speed_limits
|
Yes | 0 or 1 | NML 0.4 | |
signals_on_traffic_side
|
Yes | 0 or 1 | ||
electrified_railways
|
Yes | 0 or 1 | ||
unified_maglev
|
Yes | 0 .. 3 Always 3 | ||
temperate_snowline
|
Yes | 0 or 1 Always 0 | ||
dynamic_engines
|
Yes | 0 or 1 | ||
variable_runningcosts
|
Yes | 0 or 1 Always 1 | ||
newtrains
|
Yes | 0 or 1 Always 1 | ||
newrvs
|
Yes | 0 or 1 Always 1 | ||
newships
|
Yes | 0 or 1 Always 1 | ||
newplanes
|
Yes | 0 or 1 Always 1 | ||
newhouses
|
Yes | 0 or 1 Always 1 | ||
newindustries
|
Yes | 0 or 1 Always 1 | ||
newcargos
|
Yes | 0 or 1 Always 1 | ||
256_persistent_registers
|
Yes | 0 or 1 | NML 0.5 | |
inflation
|
Yes | 0 or 1 | NML 0.7 1.11 | |
map_seed
|
Yes | 0 .. 4294967295 | NML 0.7 12.0 |
- ↑ It should be
version_openttd(1, MAJOR, MINOR)
if you are using NML with version ≤ 0.7.3 - ↑ 2.0 2.1 2.2 The value of these variables can change during the game. Reading them from a switch block (which reads the current value) may result in a different value than in the rest of the code (which is evaluated when the game is loaded).
- ↑ 3.0 3.1 3.2 3.3 These variables can be written as well as read. Use a normal assignment, for example:
traininfo_y_offset = -2;