Doc Creator
Generates JSON data files and resources for the BeamNG documentation / Hugo system. Exports levels, vehicles, materials, JBeam defaults, controller info, and more across all available languages.
Generates JSON data files and resources for the BeamNG documentation / Hugo system. Exports levels, vehicles, materials, JBeam defaults, controller info, and more across all available languages.
Overview
util_docCreator exports game data into structured JSON files suitable for the documentation website. It iterates over all available languages, exporting localized level and vehicle data with resource files (images copied and hashed). Also exports common data like physics materials, JBeam defaults, JBeam stats, and tested controllers.
Extension path: lua/ge/extensions/util/docCreator.lua
Exports (M)
| Function | Signature | Description |
|---|---|---|
run | () | Starts async export of all doc data (alias: runAsync). |
runAndQuit | () | Starts async export and shuts down on completion. |
Internals
Output Directories
doc-out/data/- JSON data filesdoc-out/resources/- Copied/hashed resource files (images)
Language-Specific Export
For each language in /locales/*.json:
- Switches language via
Lua.userLanguage. - Exports
levels_{lang}.json- level list with localized text andbeamng:v1/openMaplinks. - Exports
vehicles_{lang}.json- model and config lists. - Resource files (images) are SHA1-hashed and copied to the resources folder.
Common Data Export
| Output File | Contents |
|---|---|
game_version.json | Build version info (version, arch, build number). |
physics_materials.json | List of physics material names. |
physics_jbeam_defaults.json | Default beam/node values from the JBeam loader. |
jbeam_stats.json | Statistics from util_jbeamStats.getStats(). |
tested_controllers.json | Controller compatibility table from inputmap files. |
Tested Controllers
Scans /settings/inputmaps/*.json files and:
- Extracts VID/PID from filenames or file content.
- Looks up vendor names from
vendorNames.json. - Detects force-feedback and TrueForce support.
- Outputs an HTML-formatted table with controller info.
Resource Handling
cleanupTable() recursively walks data tables:
- Translates localization strings.
- Detects file paths and copies referenced files to resources with SHA1-based filenames.
- Replaces paths with
/game/resources/{hash}.{ext}.
How It Works
- Call
run()orrunAndQuit()(the latter shuts down after). - A job system coroutine processes all languages.
- For each language, levels and vehicles are exported as JSON.
- Common (non-localized) data is exported once.
- All output goes to
doc-out/.
Lua Examples
-- Export documentation data (async)
extensions.util_docCreator.run()
-- Export and quit when done
extensions.util_docCreator.runAndQuit()Additional Exports
M.run- (undocumented)M.runAndQuit- (undocumented)
Dependency Tree
Analyzes level asset dependencies by walking scene objects and building a dependency graph of files, textures, materials, shapes, and SimObjects.
Export (glTF)
Exports the current player vehicle as a glTF/GLB 3D file, including meshes, materials, textures, part hierarchy, and optionally node/beam data.