repair_terrain
Repairs an empty terrain splat lost after a map resize mismatch, restoring a usable surface for repainting. Destructive: existing painted terrain is not recovered.
Instructions
Rebuild a level's terrain splat when the engine dropped it. Destructive.
Only needed on a map whose terrain has already been lost. Symptom: every
terrain call answers "the terrain splat image is empty", and Dungeondraft's
log carries `Expected data size of N bytes in Image::create()` at load.
That happens when a map was resized while its terrain was not. The splat
keeps the pixel dimensions it was created with, the mismatch is silent
until the map is next opened, and Godot then refuses the image and drops
every painted stroke — while the save that produced it reported success.
set_map_size now resizes the rasters with the map, so new maps do not reach
this state; this repairs one that already did.
It does not recover anything. The painted terrain is gone before this runs;
all it restores is a usable surface to paint on, so the terrain has to be
laid down again afterwards. Nothing else on the map is touched.
force: blank a splat that is already usable. This throws away working
terrain, so it is off by default.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "repair_terrain"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No |