Difference between revisions of "VariationalAction2/Towns"
Planetmaker (talk | contribs) m (Reverted edits by Hgnmu128 (Talk) to last revision by Planetmaker) |
Planetmaker (talk | contribs) (town radii explained) |
||
Line 12: | Line 12: | ||
|82||W||Population |
|82||W||Population |
||
|- |
|- |
||
− | |94 |
+ | |94, 96, 98, 9A, 9C||W||Square of town zone radii for the town zones 0 ... 4 |
|- |
|- |
||
|B6||W||number of buildings |
|B6||W||number of buildings |
||
Line 39: | Line 39: | ||
This returns the index of the town in the town array. This value is between 0 and 69 (inclusive). 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) |
This returns the index of the town in the town array. This value is between 0 and 69 (inclusive). 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) |
||
+ | |||
+ | ===Town zone radii (94, 96, 98, 9A, 9C)=== |
||
+ | Squares of radii of 5 town zones. Town zone 0 is the outer most town zone and town zone 4 the inner most. Towns do not have all town zones concurrently. Which town zones are present and their radii depends on the number of houses (values given as square of the radius, the same as the variables will return): |
||
+ | {| |
||
+ | !#Houses!! Zone 0 !! Zone 1 !! Zone 2 !! Zone 3 !! Zone 4 |
||
+ | |- |
||
+ | | 0 || 4 || 0 || 0 || 0 || 0 |
||
+ | |- |
||
+ | | 4 || 16|| 0|| 0|| 0|| 0 |
||
+ | |- |
||
+ | | 8 || 25|| 0|| 0|| 0|| 0 |
||
+ | |- |
||
+ | | 12 || 36|| 0|| 0|| 0|| 0 |
||
+ | |- |
||
+ | | 16 || 49|| 0|| 4|| 0|| 0 |
||
+ | |- |
||
+ | | 20 || 64|| 0|| 4|| 0|| 0 |
||
+ | |- |
||
+ | | 24 || 64|| 0|| 9|| 0|| 1 |
||
+ | |- |
||
+ | | 28|| 64|| 0|| 9|| 0|| 4 |
||
+ | |- |
||
+ | | 32|| 64|| 0||16|| 0|| 4 |
||
+ | |- |
||
+ | | 36|| 81|| 0||16|| 0|| 4 |
||
+ | |- |
||
+ | | 40|| 81|| 0||16|| 0|| 4 |
||
+ | |- |
||
+ | | 44|| 81|| 0||25|| 0|| 9 |
||
+ | |- |
||
+ | | 48|| 81||36||25|| 0|| 9 |
||
+ | |- |
||
+ | | 52|| 81||36||25||16|| 9 |
||
+ | |- |
||
+ | | 56|| 81||49|| 0||25|| 9 |
||
+ | |- |
||
+ | | 60|| 81||64|| 0||25|| 9 |
||
+ | |- |
||
+ | | 64|| 81||64|| 0||36|| 9 |
||
+ | |- |
||
+ | | 68|| 81||64|| 0||36||16 |
||
+ | |- |
||
+ | | 72||100||81|| 0||49||16 |
||
+ | |- |
||
+ | | 76||100||81|| 0||49||25 |
||
+ | |- |
||
+ | | 80||121||81|| 0||49||25 |
||
+ | |- |
||
+ | | 84||121||81|| 0||49||25 |
||
+ | |- |
||
+ | | 88||121||81|| 0||49||36 |
||
+ | |- |
||
+ | | >=92|| n/8*15 - 40|| n/8*9 - 15|| 0 || n/8*5 - 5 || n/8*3 + 5 |
||
+ | |} |
||
+ | where n is the number of houses of the town |
||
==Example== |
==Example== |
Revision as of 12:22, 15 June 2011
Introduction
Variables
Variable | Size | Content |
---|---|---|
40 | B | Larger town effect on this town |
41 | B | Town index |
82 | W | Population |
94, 96, 98, 9A, 9C | W | Square of town zone radii for the town zones 0 ... 4 |
B6 | W | number of buildings |
These are accessed by using a type 82/86/8A action 2 for stations, town buildings, or industries.
For other 80+x variables confer the town structure.
Description
Larger town effect (40)
This returns how the "largertowns" switch affects this town:
Value | Meaning |
---|---|
0 | largertowns is enabled, but it won't allow this town to grow larger than usual |
1 | largertowns is enabled, and it allows to grow this town larger |
2 | largertowns is disabled, so no towns are allowed to grow larger |
Town index (41)
This returns the index of the town in the town array. This value is between 0 and 69 (inclusive). 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)
Town zone radii (94, 96, 98, 9A, 9C)
Squares of radii of 5 town zones. Town zone 0 is the outer most town zone and town zone 4 the inner most. Towns do not have all town zones concurrently. Which town zones are present and their radii depends on the number of houses (values given as square of the radius, the same as the variables will return):
#Houses | Zone 0 | Zone 1 | Zone 2 | Zone 3 | Zone 4 |
---|---|---|---|---|---|
0 | 4 | 0 | 0 | 0 | 0 |
4 | 16 | 0 | 0 | 0 | 0 |
8 | 25 | 0 | 0 | 0 | 0 |
12 | 36 | 0 | 0 | 0 | 0 |
16 | 49 | 0 | 4 | 0 | 0 |
20 | 64 | 0 | 4 | 0 | 0 |
24 | 64 | 0 | 9 | 0 | 1 |
28 | 64 | 0 | 9 | 0 | 4 |
32 | 64 | 0 | 16 | 0 | 4 |
36 | 81 | 0 | 16 | 0 | 4 |
40 | 81 | 0 | 16 | 0 | 4 |
44 | 81 | 0 | 25 | 0 | 9 |
48 | 81 | 36 | 25 | 0 | 9 |
52 | 81 | 36 | 25 | 16 | 9 |
56 | 81 | 49 | 0 | 25 | 9 |
60 | 81 | 64 | 0 | 25 | 9 |
64 | 81 | 64 | 0 | 36 | 9 |
68 | 81 | 64 | 0 | 36 | 16 |
72 | 100 | 81 | 0 | 49 | 16 |
76 | 100 | 81 | 0 | 49 | 25 |
80 | 121 | 81 | 0 | 49 | 25 |
84 | 121 | 81 | 0 | 49 | 25 |
88 | 121 | 81 | 0 | 49 | 36 |
>=92 | n/8*15 - 40 | n/8*9 - 15 | 0 | n/8*5 - 5 | n/8*3 + 5 |
where n is the number of houses of the town