Skip to content

Module Builder Information

CPTN_Cosmo edited this page May 30, 2026 · 4 revisions

As with any Foundry system, you make a module and define a few compendiums to store your items, journals or other entities in to distribute them to others. There are however some extra considerations if you are adding specific homebrew, and some help on those is found below:

Attribution Sources

You can add attribution information to mark where your adversaries, items etc. are coming from, accessed from the tree-dot context menu on the sheet.

This can be done via freeform typing it in, but when you have a lot of things it can be handy to define an Attribution Source to allow you to just pick your options in a dropdown. You would do this in the init hook:

Hooks.once('init', () => {
   CONFIG.DH.GENERAL.attributionSources.deadlyBeasts = { 
      label: "Deadly Beasts", 
      values: [
         { label: "Deadly Beasts - Volume 1" }, 
         {label: "Deadly Beasts - Volume 2"}
      ] 
   };
})
image

Custom Resources

In the init hook, you can register custom resources for characters. This is done by defining new key/object pairs on CONFIG.DH.RESOURCE.character.custom. The data structure is:

{
	id - the resource key
	initial - the initial numerical value of the resource (stress starts at 6 for instance)
	max  - the maximum numerical value the resource can reach
	label - the label shown for the resource, preferably a i18n localizable string
}

Optionally, you can also define custom full and empty icons for the resource together with the above,

{
	images: {
		full: {
			value - the FontAwesome icon class or the filepath to the image if 'isIcon' is false 
			isIcon - if the image is a fontAwesome icon or an image in your filesystem
			noColorFilter - normally a uniform color is applied to the image via a css filter. If you're using a non-transparent background or just don't want it, then set this to true
		},
		empty: {
			value - see above
			isIcon - see above
			noColorFilter - see above
		}
	}
}

Example

Hooks.once('init', () => {
	CONFIG.DH.RESOURCE.character.custom.corruption = {
		id: 'corruption',
		initial: 0,
		max: 4,
		label: 'Corruption',
		images: {
		  full: {
			 value: 'systems/daggerheart/assets/icons/domains/sage.svg',
			 isIcon: false
		  },
		  empty: {
			 value: 'systems/daggerheart/assets/icons/domains/sage.svg',
			 isIcon: false
		  }
		}
	};
}

Custom Domains

If you are adding custom domains for your classes and domain cards, then those domains need to always be present when the module is active. Simply add your new domains as keys on the config path CONFIG.DH.DOMAIN.domains in the Foundry init hook for your module:

Hooks.once('init', () => {
   CONFIG.DH.DOMAIN.domains.test = {
      id: 'test',
      label: 'Test', // Alternatively a translation string if the module uses lang files
      description: 'A test domain', // Alternatively a translation string if the module uses lang files
      src: 'modules/test-module/assets/test-domain-image.png',
   };
});

Custom Adversary Types

If you are adding additional adversary types to the existing list of bruiser, leader etc, then you add additional keys to the config path CONFIG.DH.ACTOR.adversaryTypes in the Foundry init hook.

Hooks.once('init', () => {
    CONFIG.DH.ACTOR.adversaryTypes.superMonster = {
        id: 'superMonster',
        label: 'Super Monster', // Alternatively a translation string if the module uses lang files
        description: 'Thunderbolts and lightning, very very frightening', // Alternatively a translation string if the module uses lang files
        bpCost: 4
    };
});

Clone this wiki locally