Recipes
Recipes
Section titled “Recipes”Start from the result you want. The main recipes now have their own short pages with minimal code → expected result → common failure → evidence boundary → deep reference.
Practical recipes
Start from the result. A recipe gives the smallest path, expected result, common failure, and only then sends you into full API reference.
`mod.json` + `Main.cs` + one Player.log line. No game mechanics until the skeleton proves it loaded.
Open step-by-step recipe →Write an `int`, read a fallback, and understand exactly what survived save/load and restart.
Open step-by-step recipe →Typed party data, stable party ID, missing-party fallback, and inactive/reactivate lifecycle.
Open step-by-step recipe →Minimal subscription, payload, unsubscribe, and the rule: do not guess event fields.
Open step-by-step recipe →Register an action, check `CanExecute`, run the handler, and avoid the same-ID replacement trap.
Open step-by-step recipe →Start with versions and the error signature, then jump to the relevant troubleshooting guide — without uploading the file.
Open step-by-step recipe →Why an active clone crashed in `Awake()` and how to separate visual structure from unsafe MonoBehaviours.
Open step-by-step recipe →Write to verified terrain-height storage and avoid the old `health` mistake.
Open step-by-step recipe →Decide when a tag should be visible to other mods and when it should belong only to your addon.
Open step-by-step recipe →A real StackOverflow case: getter and setter call each other during first initialization.
Open step-by-step recipe →When an event is better than continuously scanning kingdoms and how that simplifies an addon.
Open step-by-step recipe →Separate validation, callback errors, warnings, and the observed diagnostics-bookkeeping mismatch.
Open step-by-step recipe →How to use recipes
Section titled “How to use recipes”- Pick the closest task even if your wording is different.
- Make the minimal version work before adding architecture.
- Read the expected result and common-failure section.
- Follow the full API/case-study link only when you need the deeper contract.
- If your runtime disagrees, capture
Player.logand treat it as a compatibility question rather than silently guessing.