Difference between revisions of "NML:Towns"
From GRFSpecs
Jump to navigationJump to search (Created page with "{{NMLNavPropVarCB}} Towns aren't a NewGRF feature of their own but town variables can be accessed via the parent scope of stations, houses and industries. ==Town variables== …") |
m (Changed from table to sortable.) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
==Town variables== |
==Town variables== |
||
− | {| class=" |
+ | {| class="wikitable sortable" |
! name |
! name |
||
! value range |
! value range |
||
Line 18: | Line 18: | ||
| [0 <nowiki>|</nowiki> 1] |
| [0 <nowiki>|</nowiki> 1] |
||
| 1 if the advanced setting for cities is enabled, 0 otherwise. |
| 1 if the advanced setting for cities is enabled, 0 otherwise. |
||
+ | |- |
||
+ | | town_index |
||
+ | | 0..65535 |
||
+ | | {{nml|0.6}} This returns the index of the town in the town array. You can use this value to treat some towns specially. (For example, the first town on the map can be considered the capital and you can allow a Parliament to be built there, but nowhere else) |
||
|- |
|- |
||
| has_church |
| has_church |
||
Line 28: | Line 32: | ||
|- |
|- |
||
| population |
| population |
||
− | | 0.. |
+ | | 0..65535 |
| Population of the town |
| Population of the town |
||
|- |
|- |
||
| num_houses |
| num_houses |
||
− | | 0.. |
+ | | 0..65535 |
| Number of houses |
| Number of houses |
||
|- |
|- |
||
Line 44: | Line 48: | ||
|- |
|- |
||
| town_zone_0_radius_square |
| town_zone_0_radius_square |
||
− | | 0.. |
+ | | 0..65535 |
| rowspan="5" | See [http://newgrf-specs.tt-wiki.net/wiki/TownZones TownZones page in NFO specs] |
| rowspan="5" | See [http://newgrf-specs.tt-wiki.net/wiki/TownZones TownZones page in NFO specs] |
||
|- |
|- |
||
| town_zone_1_radius_square |
| town_zone_1_radius_square |
||
− | | 0.. |
+ | | 0..65535 |
|- |
|- |
||
| town_zone_2_radius_square |
| town_zone_2_radius_square |
||
− | | 0.. |
+ | | 0..65535 |
|- |
|- |
||
| town_zone_3_radius_square |
| town_zone_3_radius_square |
||
− | | 0.. |
+ | | 0..65535 |
|- |
|- |
||
| town_zone_4_radius_square |
| town_zone_4_radius_square |
||
− | | 0.. |
+ | | 0..65535 |
|} |
|} |
Latest revision as of 21:07, 30 August 2022
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
Towns aren't a NewGRF feature of their own but town variables can be accessed via the parent scope of stations, houses and industries.
Town variables
name | value range | comment |
---|---|---|
is_city | [0 | 1] | 1 if this town is marked as a "city", 0 if it's not. |
cities_enabled | [0 | 1] | 1 if the advanced setting for cities is enabled, 0 otherwise. |
town_index | 0..65535 | NML 0.6 This returns the index of the town in the town array. You can use this value to treat some towns specially. (For example, the first town on the map can be considered the capital and you can allow a Parliament to be built there, but nowhere else) |
has_church | [0 | 1] | 1 if there is a church in the town. |
has_stadium | [0 | 1] | 1 if there is a stadium in the town. |
population | 0..65535 | Population of the town |
num_houses | 0..65535 | Number of houses |
percent_transported_passengers | 0..100 | Percentage of all passengers available for transported that were transported. |
percent_transported_mail | 0..100 | Percentage of all mail available for transported that was transported. |
town_zone_0_radius_square | 0..65535 | See TownZones page in NFO specs |
town_zone_1_radius_square | 0..65535 | |
town_zone_2_radius_square | 0..65535 | |
town_zone_3_radius_square | 0..65535 | |
town_zone_4_radius_square | 0..65535 |