Repository navigation
Macro API
PrinceWitherdick edited this page Oct 25, 2026
·
1 revision
The module puts a small API on its module entry once the world is ready, for macros and other modules.
const api = game.modules.get("relationship-map-pwd").api;| Call | What it does |
|---|---|
api.open() |
Opens the map you were last on, the same as the Relationship Maps button. In a world with no collection yet, it asks for a name for the first one. |
api.open("The Valley") |
Opens a collection by its name or its id. If nothing matches, it opens the map you were last on. |
api.choose() |
Shows the Collections list and opens the one you pick. |
Both open and choose are async.
A hotbar macro that opens one collection:
game.modules.get("relationship-map-pwd").api.open("The Valley");A macro that asks which collection to open:
game.modules.get("relationship-map-pwd").api.choose();-
The names here are collection names, not the names of the maps (tabs) inside a collection. Use the tabs to move between maps once the window is open.
-
In a world with no collection yet, a player who can't make one is told to ask the GM instead of being asked for a name.
-
apiis set during Foundry'sreadyhook. Code that runs earlier than that should wait for it:Hooks.once("ready", () => { const api = game.modules.get("relationship-map-pwd")?.api; // ... });
Start here
Using the map
Reference