A set of scripts for exporting game data from Desynced lua files and importing it into the Desynced Wiki.
Those are not battle-tested and might have various issues, feel free to modify them.
Requires uv package manager.
uv syncSteps:
- 1 - Get game files
Get the game "main" mod. - 2 - Generate wiki files
Generate wiki files from the game files (uv run generate_wiki --help). - 3 - Upload to wiki
Upload files to Wiki.
Depending on what changed in the game files, you might need to make extra adjustements.
You need games files extracted wherever, the path will be fed to script by CLI.
If you want them autodiscovered by scripts, you can put them at ./game_data in this directory, such as ./game_data/def.json exists.
Either:
- Extract the main mod from your game directory (Ex:
<...>\Steam\steamapps\common\Desynced\Desynced\Content\mods\main.zip) - (currently broken) Pull game data from steam using
cli_fetch_main_from_steam(uv run fetch_main_from_steam --help).
See: uv run generate_wiki --help.
The script will:
- Evaluates a subset of game files (path provided in argument) in a lua environment.
- Traverses the
datatree to parse out necessary information. - Outputs wiki templates and data to
--wiki-output-directorystructured by category.
See: uv run upload_wiki --help
You need the "janitor" permission on the wiki. Credentials needs to be set in config file..
The script will:
- For files in
--wiki-output-directory, inTemplateuploads them as templates (cargo table definitions). - For files in
--wiki-output-directory, inDatauploads them to their ownData:...pages. (this does not create the "human" page meant to be read) - Trigger cargo tables regeneration as needed
/!\ This currently does not remove older data removed from the game
- You might have to handle new name collisions. Generation script should stop and error out if it detects one.
Most of that can be handled by adding entries toWIKI_NAME_OVERRIDES.- Also the DataTableIndex (table_index table) is related to handling name collisions, but me writting this didn't dive into it.
- By default, only entities that are unlockable by players are included. You can force extra inclusions by adding names in
FORCE_INCLUDE_NAMES. - Currently many pages like https://wiki.desyncedgame.com/Instructions have been written manually and need to be updated if extra content is done. Navboxes
- Currently new images are not added automatically and you might need to use cli_missing_images and probably handle more manually there.
Copy config.ini.example to config.ini and update your credentials as needed.
Steam credentials are needed to download the game assets.
Wiki credentials are needed for the import process.
Some other scripts to help with wiki maintenance. Most of those scripts can be resumed with --resume.
uv run create_missing_pages --helpuv run cleanup_page_templates --helpuv run missing_images --helpuv run remove_data_pages --help
| Cargo tables list | https://wiki.desyncedgame.com/Special:CargoTables |
| Browse all cargo tables data | https://wiki.desyncedgame.com/Special:Drilldown/ |
| One data page example | https://wiki.desyncedgame.com/index.php?title=Data:Item:Infected_Circuit_Board&redirect=no |
| Special pages | https://wiki.desyncedgame.com/Special:SpecialPages |
| List all templates | https://wiki.desyncedgame.com/Special:PrefixIndex?prefix=Template%3A&namespace=0 |
Some notes in DEV.md
Please note that this repository and its contents are not officially related to or endorsed by Desynced or Stage Games.