- Knownframe
- battlemap-mcp
- Docs
- v1.4.2
- Lighting and map style
Lighting and map style
Generated from battlemap-mcp v1.4.2. Your assistant gets these same names, descriptions and parameters from the server when it connects; the server is named battlemap, so a client may show a tool as battlemap:ping or similar.
add_light
Add a light at a woxel position. Returns the new element id.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | number | null | null | |
y | number | null | null | |
color | string | "" | '#rrggbb' (default warm). |
energy | number | 1 | brightness. |
range | number | 2 | the Range Dungeondraft's own Light tool shows, which its saved map and a VTT export record too. get_element and list_elements report it in the same units. |
shadows | boolean | true | |
asset | string | "" | optional Lights gradient/cookie texture path. |
snap | string | "" | 'none', 'grid' or 'auto'; see get_snap_settings. |
lights | PlacedLight[] | null | null | up to 100 {x, y, color, energy, range, shadows, asset} entries, added as ONE undo step and all-or-nothing; the other arguments are then ignored. Returns ids. A light for an object: place_object(light=...). modify_object changes a placed light's color, energy, range and shadows. |
set_ambient_light
Set the map's ambient light colour — the single biggest lever on mood.
A cold blue-grey reads as night or a dungeon; warm amber reads as lamplight or dusk; a neutral grey lets the placed sources carry the colour. A fresh map's white is flat glare rather than daylight, so decide rather than leave it. Whatever you pick, look at a render afterwards: the mood is yours, but every zone that hosts play has to read at the table. This is map-wide, not a placed light source (use add_light for those).
It is also functional, not just cosmetic: Universal VTT exports carry lighting into Foundry and similar tools, so this affects the map at its destination.
| Parameter | Type | Default | Description |
|---|---|---|---|
color required | string | '#rrggbb'. |
get_map_style
Read map-wide building wear and grid style from the world's actual textures.
Returns canonical names, texture paths, and available choices. A custom texture with no built-in name is reported as null with its path retained. Grid style chooses the line pattern; it does not toggle grid visibility.
No parameters.
set_map_style
Set optional finishing effects across the map, as one undoable edit.
Omitted fields keep their current values. Both fields are validated before editing, and the response reads actual world textures. Use get_map_style before changing a map and inspect a screenshot/export afterwards. Undo and redo restore both values together, even after switching levels.
| Parameter | Type | Default | Description |
|---|---|---|---|
building_wear | string | null | null | none, dust, grime, noise, scratched. Applies to building floors/walls across every level; use only when that global effect fits. |
grid_style | string | null | null | dashes, dotted, narrow_line, thick_line. Changes the grid's line pattern, not whether the grid is visible or included in an export. |
set_grid
Show or hide the grid in the editor view. Returns {grid_visible, grid_toggle}.
It works the View menu's own grid checkbox, so the menu and the screen agree; grid_toggle is that checkbox's state. This changes only what the editor (and so screenshot) shows. Exports keep their own grid option and put the editor grid back afterwards.
It is not saved: neither the map file nor Dungeondraft's settings keep it, so opening a map or restarting Dungeondraft shows the grid again.
| Parameter | Type | Default | Description |
|---|---|---|---|
visible required | boolean |
set_trace_image
Put a reference image under the map to trace over. Returns what applied.
For reconstructing an approved sketch, a published floor plan, or a hand-drawn dungeon. Load it, size it against the grid, drop its opacity so your own work reads over it, then build on top — and hide it before the final render, because it is a guide, not part of the map.
Loading an image shows it and clear hides it. visible says whether it is drawn now and image_size is null if the image did not load. Exports never include it.
The trace SAVES with the map: its absolute path, scale, opacity and position go into the file and it reloads next time. Anyone else who opens the map gets a path that doesn't exist on their machine, and a large reference makes every open slow. Call set_trace_image(clear=true) before the final save_map.
A path Windows can't open (260+ characters, typical of agent temp folders) is copied to a short path in the bridge's output folder first; the response says so under copied_from.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | string | "" | an ABSOLUTE path to an image on the machine running Dungeondraft. |
scale | number | null | null | size multiplier. Set it so a known distance on the image matches the grid; guessing here is what makes a traced plan come out the wrong size. |
opacity | number | null | null | 0 invisible, 1 opaque. Around 0.3-0.5 is usually enough to follow without drowning what you are drawing. |
center | boolean | false | centre the image on the map. |
clear | boolean | false | remove the trace image. |
position | number[] | null | null | [x, y] in woxels (256 per grid square): where the image's centre sits, applied after center and scale. Centre it, read the reply's position, then set a position that puts a grid line drawn on the image on a map grid line. It sets rather than nudges, so repeating the call is harmless. A later center moves the image back to the map's centre and discards it. |
set_soft_shadow
Add, change or remove Moulk's Soft Shadows on objects, walls and paths.
Needs the Soft Shadows mod (ping reports soft_shadows); refused without it. One undo step for all ids; all are checked before any changes.
the mod's current defaults for its kind; one with a shadow keeps its other settings.
where the shadow falls. color: '#rrggbb'.
objects, or softness and spread for walls and paths. get_element(id) lists an element's soft_shadow keys once it has one; an unknown key is refused. Prefer a modest offset (20-60) and opacity (0.4-0.8).
| Parameter | Type | Default | Description |
|---|---|---|---|
ids required | integer[] | ||
enabled | boolean | true | false removes the shadow. An element without one starts from |
opacity | number | null | null | 0-2 (above 1 darkens the blurred edge). |
offset | number[] | null | null | [x, y] in woxels, |
color | string | null | null | |
settings | object | null | null | any other key of that element's shadow, such as blur for |