Regenerating the hook reference#
The Game Hooks page reads generated JSON under docs-cr/data/. Regenerate it when augment.manifest.json changes (after a hook-enabled game build).
Prerequisites#
Generate#
From the docs-cr/ folder:
If pc/build/augment.manifest.json already exists, you can omit the path:
From the repository root:
Output files#
| File | Used by |
|---|---|
docs-cr/data/cr_hooks.json | Game Hooks browser (names, categories, signatures) |
docs-cr/data/cr_reference.json | Full struct/enum/function dump (structure only) |
docs-cr/data/cr_types.json | Struct/enum field lists for Game Hooks type tooltips |
docs-cr/data/cr_descriptions.json | Compiled from yaml, hook/type descriptions for the UI |
To rebuild derived files from an existing reference dump:
Adding descriptions#
Edit docs-cr/data/cr_descriptions.yaml only for custom text. The generator compiles it to cr_descriptions.json and fills in common da*_c actor hooks automatically (see docs-cr/scripts/auto_descriptions.py, Execute, Draw, action_*, damage_check, and similar shared methods). Override a specific hook in yaml only when the template is wrong.
Hook overrides use C++ flat names (ClassName::method):
functions:
"daCow_c::Execute":
description: "Main per-frame tick for a cow actor."
category: "Actors"
Commit the updated docs-cr/data/cr_descriptions.yaml and regenerated docs-cr/data/*.json with your PR.
Legacy / advanced#
Lower-level generator (still supports courage_bindings.d.ts if needed):
python3 docs-cr/scripts/gen_reference.py --from-manifest pc/build/augment.manifest.json
python3 docs-cr/scripts/gen_reference.py --dts /path/to/crxts-types/include/generated/courage_bindings.d.ts
To rebuild cr_hooks.json from the old tuple-based hooks dump (must contain a top-level hooks array):
Related scripts#
See docs-cr/scripts/README.md for add_script_labels.py (Luau/TypeScript example labels).