Fix issue #109: Add map sync
All checks were successful
Test / test (push) Successful in 2s

This commit is contained in:
Gitea OpenCode Agent
2026-10-16 16:06:21 +00:00
parent 013c3512fe
commit cd1e3cb125
14 changed files with 940 additions and 6 deletions

View File

@@ -49,3 +49,18 @@ the actor it stands for, and **Enter** does the same on a token focused with the
Tokens belong to the map, not to the actor: the same character can stand on several maps, and taking a
token off does not remove the character from the campaign.
## Maps from a linked Foundry world
With a Foundry world linked to the campaign, its scenes arrive as maps of their own: each one with the
scene's background picture and the grid laid over it, in the scene's own cell size and where the world
shifts that grid onto the picture. That is all a scene lends a map — what one of your cells stands
for, the folder a map stands in, and whatever you pin or stand on it stay yours, and nothing about a
map goes back to the world.
A scene renamed in Foundry, or its grid moved, updates its map. Take the background picture off a
scene and its map keeps the one it has; delete the scene and its map goes with it the next time the
world sends its whole scene list, which is when the world loads. For the same reason a map you delete
in the campaign comes back on the next world load while its scene is still there — take the scene off
in Foundry to be rid of the map. A map you made yourself is never doubled by the scene of it: a scene
arriving with the name of an unmapped map adopts that one. See [Foundry VTT](/docs/foundry).

View File

@@ -1,8 +1,8 @@
# Foundry VTT
The Foundry integration keeps a Dragonroll campaign and a Foundry world in step: the world's
characters and item directory arrive in the campaign, and what you change in Dragonroll goes back to
the world.
characters, item directory and scenes arrive in the campaign, and what you change in Dragonroll of
those characters and items goes back to the world.
There are two separate parts, and you only need the first of them:
@@ -51,6 +51,7 @@ Worth knowing:
| The world's **item directory** (the items tab) | The campaign's item list, with category, rarity, quantity, weight, properties and description |
| The folders grouping that item directory | Item folders with the same names and nesting |
| A folder's colour | The campaign's folder colour — and the other way round, what you colour in Dragonroll lands on the world's folder |
| The world's **scenes** | The campaign's maps: the scene's background picture and the grid laid over it, in the scene's own cell size |
| A journal called **Dragonroll** — one page per note | Your campaign's notes. They arrive **from** Dragonroll: what you write in the journal does not go back |
The item list is the world's item directory and nothing else. The gear a character carries is that
@@ -58,6 +59,15 @@ character's inventory: it travels with the character and stays on its sheet, so
does not turn up in the campaign's item list. Spells, classes, subclasses, backgrounds, feats and
species are not gear and are not imported.
The world's scenes are the campaign's maps, and only their **background picture** and their **grid**
cross over: a map arrives with the scene's picture and its cell size, and with the grid where the
world shifts it. That is where the two stop — what one of your cells stands for, the folder a map
stands in, the notes pinned onto it and the characters standing on it as tokens stay in the campaign,
and nothing about a map is written back into the world. The scene list goes over when the world links
and when it loads, which is also when the map of a scene the GM deleted goes with it; scenes changed
afterwards arrive as they happen. A scene with no background picture makes no map, and the full list
leaves a map the campaign already had alone, so a grid you lined up yourself survives a reload.
An actor or item keeps the Dragonroll id it was given in a `dragonroll-foundry.actorId` /
`dragonroll-foundry.itemId` flag, and that is what makes the two sides recognise each other. A world
item that carries no flag is matched by name, so a hand-written item in Dragonroll is adopted instead of