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

@@ -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