-
Notifications
You must be signed in to change notification settings - Fork 7
Adding new content from third party code
INVESTIGATOR is written to be extended by Foundry modules. There are three main ways to do this:
- Compendium packs for abilities. The core INVESTIGATOR system can only contain abilities referenced in the GUMSHOE SRD, so it's up to add-in modules to provide full ability lists.
- "Trade dress" themes. INVESTIGATOR comes with a bunch of cool themes, but they are visually distinct from the graphic design of any published character sheet.
- Presets. These are short snippets of configuration tying together compendium packs, themes, and optional GUMSHOE-related settings. Using a preset sets up the game for a particular GUMSHOE variant on one click.
Compendium packs are how Foundry organises library of reusable stuff. The core INVESTIGATOR system ships with some ability conmpendiums for various GUMSHOE-soundalike games, but we are limited only including abilities which appear in the GUMSHOE SRD.
You can create a compendium pack in Foundry and include it in your add-on module. Make sure to list it under packs
in your manifest (module.json
).
If you want to just chuck some JSON in a folder, see Adding new themes from local data.
-
You create a Foundry module.
-
Said module defines a "theme seed", which is the minimal set of values required to define a theme.
- If you're using TypeScript, you can use the type definitions from @lumphammer/investigator-fvtt-types.
-
Your module then calls
CONFIG.Investigator?.installTheme("name-of-theme-goes-here", themeSeed);
And that's basically it!
A theme seed is expressed using CSS-in-JS, using @emotion/react-compatible syntax. If you're familiar with CSS you'll get it quickly.
Theme seed structure is versioned! At the time of writing, there's only one schema version, V1. In future, there may be more. But the important thing is that as we add new schema versions
Rather than document all the parts here, I'll link you to the type definition for the V1 Schema - even if you don't use TypeScript (you should start, probably) this will give you a reference for everything.
I'll also link the actual code of the example legal notebook theme project below
For an example project that use the API to inject a new theme into INVESTIGATOR at runtime, see Legal Notebook Theme. It's not meant to be pretty, but it contains "one of everything" to produce a theme module.
A "preset" is INVESTIGATOR's term for a snippet of configuration which can set the system up for a particular GUMSHOE variant.
For example, here's the preset for "Path of Cthulhu":
export const pathOfCthulhuPreset: PresetV1 = {
schemaVersion: "v1",
displayName: "Path of Cthulhu",
defaultTheme: "tealTheme",
investigativeAbilityCategories: ["Academic", "Interpersonal", "Technical"],
generalAbilityCategories: ["General"],
combatAbilities: ["Scuffling", "Weapons", "Firearms", "Athletics"],
occupationLabel: "Occupation",
shortNotes: ["Drive"],
longNotes: ["Notes, Contacts etc.", "Occupational Benefits", "Pillars of Sanity", "Sources of Stability"],
newPCPacks: [`${systemName}.${packNames.pathOfCthulhuAbilities}`],
newNPCPacks: [`${systemName}.${npcPackName}`],
useBoost: false,
useMwStyleAbilities: false,
mwUseAlternativeItemTypes: false,
};
The elements of this should speak for themselves, but for reference, I recommend looking at the Typescript type: https://gitlab.com/n3dst4/investigator-fvtt-types/-/blob/main/index.d.ts