-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add export-map
script
#1329
base: master
Are you sure you want to change the base?
Add export-map
script
#1329
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please also add a line to the New Tools section of changelog.txt: https://github.com/DFHack/scripts/blob/master/changelog.txt#L29
|
||
.. dfhack-tool:: | ||
:summary: Export fortress map tile data to a JSON file | ||
:tags: dev map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:tags: dev map | |
:tags: dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dev
tools generally do not carry any other tags to avoid confusing end users (regular players)
|
||
:: | ||
|
||
export-map [include|exclude] [<options>] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export-map [include|exclude] [<options>] | |
export-map | |
export-map (include|exclude) <options> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to better reflect that include/exclude is required when specifying options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you move
export-map.lua
->devel/export-map.lua
docs/export-map.rst
->docs/devel/export-map.rst
to match other dev tools?
========== | ||
|
||
.. dfhack-tool:: | ||
:summary: Export fortress map tile data to a JSON file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
short summaries need to end in a period. also, this tool should work just as well on an adventure map, so there's no need to restrict it to fortress maps
Exports the fortress map tile data to a JSON file. (does not include items, | ||
characters, buildings, etc.) Depending on options enabled, there will be a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exports the fortress map tile data to a JSON file. (does not include items, | |
characters, buildings, etc.) Depending on options enabled, there will be a | |
Exports the fortress map tile data to a JSON file. The export does not include items, | |
characters, buildings, etc. Depending on options enabled, there will be a |
-------- | ||
|
||
``export-map`` | ||
Exports the fortress map to JSON with ALL data included |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and below: Exports
-> Export
. These are descriptions of what the command represents, not a description of what happens. Also, please end these sentences in a period.
Required | ||
-------- | ||
|
||
When you are using options, you must include one of these settings. | ||
|
||
``include`` | ||
Include only the data listed from options to the JSON (whitelist) | ||
|
||
``exclude`` | ||
Exclude only the data listed from options to the JSON (blacklist) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the update to the Usage section, you can remove this section
``help``, ``--help`` | ||
Shows the help menu | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we generally don't document "help" options since the canonical way to get help is help devel/export-map
checks the value of the center map tile at ground level and will ignore | ||
biomes at the edges of the map. | ||
|
||
JSON DATA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the client requirements that led to this output format? The choices made here seem strange to me, and I could use some context.
WARNING - This command will cause the game to freeze for minutes depending on | ||
map size and options enabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the runtime for large maps is untenable, it probably would not be too hard to move the property scanning logic a Lua-accessible function of probe
and just use Lua for the output formatting (which is a pain to do in C++).
This adds a Lua tool that exports all the tile data in a fortress map to a JSON file. It's based on export-map.lua by @mikerenfro that I rewrote. I used his repo as my starting point while I was looking for DFHack scripts to export tile data.
With this script you can select tile flags and attributes to be copied and extracted:
Depending on the options selected, the material tables will be included as KEYS to reference the number IDs. Also big shoutout to @quietust for helping me find the aquifer data.