Skip to content

Commit d600990

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent b18aa8f commit d600990

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

docs/export-map.rst

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ export-map
55
:summary: Export fortress map tile data to a JSON file
66
:tags: dev map
77

8-
WARNING - This command will cause the game to freeze for minutes depending on
8+
WARNING - This command will cause the game to freeze for minutes depending on
99
map size and options enabled.
1010

11-
Exports the fortress map tile data to a JSON file. (does not include items,
12-
characters, buildings, etc.) Depending on options enabled, there will be a
13-
``KEY`` table in the JSON with relevant [number ID] values that match a number
11+
Exports the fortress map tile data to a JSON file. (does not include items,
12+
characters, buildings, etc.) Depending on options enabled, there will be a
13+
``KEY`` table in the JSON with relevant [number ID] values that match a number
1414
to their object type.
1515

1616
Usage
@@ -27,17 +27,17 @@ Examples
2727
Exports the fortress map to JSON with ALL data included
2828

2929
``export-map include -m -s -v``
30-
Exports the fortress map to JSON with only materials, shape, and vein data
30+
Exports the fortress map to JSON with only materials, shape, and vein data
3131
included
3232

3333
``export-map exclude --variant --hidden --light``
34-
Exports the fortress map to JSON with variant, hidden, and light data
34+
Exports the fortress map to JSON with variant, hidden, and light data
3535
excluded
3636

3737
Required
3838
--------
3939

40-
When you are using options, you must include one of these settings.
40+
When you are using options, you must include one of these settings.
4141

4242
``include``
4343
Include only the data listed from options to the JSON (whitelist)
@@ -58,11 +58,11 @@ Options
5858
The tile shape classification [number ID] (EMPTY/FLOOR/WALL/STAIR/etc.)
5959

6060
``-p``, ``--special``
61-
The tile surface special properties for smoothness [number ID]
61+
The tile surface special properties for smoothness [number ID]
6262
(NORMAL/SMOOTH/ROUGH/etc.) (used for engraving)
6363

6464
``-r``, ``--variant``
65-
The specific variant of a tile that have visual variations [number] (like
65+
The specific variant of a tile that have visual variations [number] (like
6666
grass tiles in ASCII mode)
6767

6868
``-h``, ``--hidden``
@@ -72,7 +72,7 @@ Options
7272
Whether tile is exposed to light [boolean]
7373

7474
``-b``, ``--subterranean``
75-
Whether the tile is considered underground [boolean] (used to determine
75+
Whether the tile is considered underground [boolean] (used to determine
7676
crops that can be planted underground)
7777

7878
``-o``, ``--outside``
@@ -84,7 +84,7 @@ Options
8484

8585
``-m``, ``--material``
8686
The material inside the tile [number ID] (IRON/GRANITE/CLAY/
87-
TOPAZOLITE/BLACK_OPAL/etc.) (will return nil if the tile is empty)
87+
TOPAZOLITE/BLACK_OPAL/etc.) (will return nil if the tile is empty)
8888

8989
``-u``, ``--underworld``
9090
Whether the underworld z-levels will be included [boolean]
@@ -103,15 +103,15 @@ JSON DATA
103103

104104
``MAP_SIZE``
105105
A table containing basic information about the map size for width, height,
106-
depth. (x, y, z) The underworld_z_level is included if the underworld option
106+
depth. (x, y, z) The underworld_z_level is included if the underworld option
107107
is enabled and the map depth (z) will be automatically adjusted.
108108

109109
``KEYS``
110110
The tables containing the [number ID] values for different options.
111111

112112
``"SHAPE": {
113-
"-1": "NONE",
114-
"0": "EMPTY",
113+
"-1": "NONE",
114+
"0": "EMPTY",
115115
"1": "FLOOR",
116116
"2": "BOULDERS",
117117
"3": "PEBBLES",
@@ -121,7 +121,7 @@ JSON DATA
121121
``
122122
123123
``"PLANT": {
124-
"0": "SINGLE-GRAIN_WHEAT",
124+
"0": "SINGLE-GRAIN_WHEAT",
125125
"1": "TWO-GRAIN_WHEAT",
126126
"2": "SOFT_WHEAT",
127127
"3": "HARD_WHEAT",
@@ -132,38 +132,38 @@ JSON DATA
132132
``
133133
134134
``"AQUIFER": {
135-
"0": "NONE",
135+
"0": "NONE",
136136
"1": "LIGHT",
137137
"2": "HEAVY"
138138
``
139139
140140
Note - when using the ``materials`` option, you need to pair the [number ID]
141-
with the correct ``KEYS`` material table. Generally you use ``tiletype``
142-
option as a helper to sort tiles into different material types. I would
141+
with the correct ``KEYS`` material table. Generally you use ``tiletype``
142+
option as a helper to sort tiles into different material types. I would
143143
recommend consulting ``tile-material.lua`` to see how materials are sorted.
144144

145145
``map``
146-
JSON map data is arranged as: ``map[z][y][x] = {tile_data}``
147-
146+
JSON map data is arranged as: ``map[z][y][x] = {tile_data}``
147+
148148
JSON maps start at index [1]. (starts at map[1][1][1])
149149
DF maps start at index [0]. (starts at map[0][0][0])
150150

151-
To translate an actual DF map position from the JSON map you need add +1 to
151+
To translate an actual DF map position from the JSON map you need add +1 to
152152
all x/y/z coordinates to get the correct tile position.
153153

154-
The ``ARGUMENT_OPTION_ORDER`` determines order of tile data. (see above)
154+
The ``ARGUMENT_OPTION_ORDER`` determines order of tile data. (see above)
155155
I would recommend referencing the tile data like so:
156156
``shape = json_data.map[z][x][y][json_data.ARGUMENT_OPTIONS_ORDER.shape]``
157157
``light = json_data.map[z][x][y][json_data.ARGUMENT_OPTIONS_ORDER.light]``
158158

159-
Note - some of the bottom z-levels for hell do not have the same
160-
width/height as the default map. So if your map is 190x190, the last hell
159+
Note - some of the bottom z-levels for hell do not have the same
160+
width/height as the default map. So if your map is 190x190, the last hell
161161
z-levels are gonna be like 90x90.
162162

163163
Instead of returning normal tile data like:
164164
``map[0][90][90] = {tile_data}``
165165

166166
It will return nil instead:
167-
``map[0][91][91] = nil``
167+
``map[0][91][91] = nil``
168168

169-
So you need to account for this!
169+
So you need to account for this!

0 commit comments

Comments
 (0)