Editing Decks
Run castle serve <deck-dir> --open while editing a deck so you can preview the current local project.
Edit Scripts
Lua scripts live under each card directory:
my-deck/
cards/
<card-id>/
scripts/
main.lua
Edit the Lua files directly in your text editor. After saving a batch of changes, restart the preview:
castle restart
Read script output and errors with:
castle logs
For scripting details, see the scripting tutorial.
Edit Scene Structure
Scene files are materialized under each card:
my-deck/
cards/
<card-id>/
scene/
actors.yaml
variables.yaml
blueprints/
main.yaml
main.json
Use these files to inspect actors, variables, blueprints, and generated scene data. For structural scene changes such as adding actors, changing blueprint components, editing rules, or updating drawing assets, use castle edit.
After a structural edit, run:
castle restart
Cards
Add a card:
castle add-card my-deck --title "Second Card"
Remove a card:
castle remove-card <card-id> my-deck --force
The CLI updates deck.json and the cards/ directory for these commands.
Screenshots
Save a screenshot from the running local preview:
castle screenshot screenshot.png
For a new saved deck, castle save-deck tries to capture a preview image from the running local preview. If that fails, the save still completes and tells you how to set a preview image later.