@@ -5,12 +5,12 @@ export-map
5
5
:summary: Export fortress map tile data to a JSON file
6
6
:tags: dev map
7
7
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
9
9
map size and options enabled.
10
10
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
14
14
to their object type.
15
15
16
16
Usage
@@ -27,17 +27,17 @@ Examples
27
27
Exports the fortress map to JSON with ALL data included
28
28
29
29
``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
31
31
included
32
32
33
33
``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
35
35
excluded
36
36
37
37
Required
38
38
--------
39
39
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.
41
41
42
42
``include ``
43
43
Include only the data listed from options to the JSON (whitelist)
@@ -58,11 +58,11 @@ Options
58
58
The tile shape classification [number ID] (EMPTY/FLOOR/WALL/STAIR/etc.)
59
59
60
60
``-p ``, ``--special ``
61
- The tile surface special properties for smoothness [number ID]
61
+ The tile surface special properties for smoothness [number ID]
62
62
(NORMAL/SMOOTH/ROUGH/etc.) (used for engraving)
63
63
64
64
``-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
66
66
grass tiles in ASCII mode)
67
67
68
68
``-h ``, ``--hidden ``
@@ -72,7 +72,7 @@ Options
72
72
Whether tile is exposed to light [boolean]
73
73
74
74
``-b ``, ``--subterranean ``
75
- Whether the tile is considered underground [boolean] (used to determine
75
+ Whether the tile is considered underground [boolean] (used to determine
76
76
crops that can be planted underground)
77
77
78
78
``-o ``, ``--outside ``
@@ -84,7 +84,7 @@ Options
84
84
85
85
``-m ``, ``--material ``
86
86
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)
88
88
89
89
``-u ``, ``--underworld ``
90
90
Whether the underworld z-levels will be included [boolean]
@@ -103,15 +103,15 @@ JSON DATA
103
103
104
104
``MAP_SIZE ``
105
105
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
107
107
is enabled and the map depth (z) will be automatically adjusted.
108
108
109
109
``KEYS ``
110
110
The tables containing the [number ID] values for different options.
111
111
112
112
``"SHAPE": {
113
- "-1": "NONE",
114
- "0": "EMPTY",
113
+ "-1": "NONE",
114
+ "0": "EMPTY",
115
115
"1": "FLOOR",
116
116
"2": "BOULDERS",
117
117
"3": "PEBBLES",
@@ -121,7 +121,7 @@ JSON DATA
121
121
``
122
122
123
123
``"PLANT": {
124
- "0": "SINGLE-GRAIN_WHEAT",
124
+ "0": "SINGLE-GRAIN_WHEAT",
125
125
"1": "TWO-GRAIN_WHEAT",
126
126
"2": "SOFT_WHEAT",
127
127
"3": "HARD_WHEAT",
@@ -132,38 +132,38 @@ JSON DATA
132
132
``
133
133
134
134
``"AQUIFER": {
135
- "0": "NONE",
135
+ "0": "NONE",
136
136
"1": "LIGHT",
137
137
"2": "HEAVY"
138
138
``
139
139
140
140
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
143
143
recommend consulting ``tile-material.lua `` to see how materials are sorted.
144
144
145
145
``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
+
148
148
JSON maps start at index [1]. (starts at map[1][1][1])
149
149
DF maps start at index [0]. (starts at map[0][0][0])
150
150
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
152
152
all x/y/z coordinates to get the correct tile position.
153
153
154
- The ``ARGUMENT_OPTION_ORDER `` determines order of tile data. (see above)
154
+ The ``ARGUMENT_OPTION_ORDER `` determines order of tile data. (see above)
155
155
I would recommend referencing the tile data like so:
156
156
``shape = json_data.map[z][x][y][json_data.ARGUMENT_OPTIONS_ORDER.shape] ``
157
157
``light = json_data.map[z][x][y][json_data.ARGUMENT_OPTIONS_ORDER.light] ``
158
158
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
161
161
z-levels are gonna be like 90x90.
162
162
163
163
Instead of returning normal tile data like:
164
164
``map[0][90][90] = {tile_data} ``
165
165
166
166
It will return nil instead:
167
- ``map[0][91][91] = nil ``
167
+ ``map[0][91][91] = nil ``
168
168
169
- So you need to account for this!
169
+ So you need to account for this!
0 commit comments