Skip to content

elizeuangelo/fvtt-module-item-linking

Repository files navigation

Foundry VTT - Item-Linking

GitHub release (latest SemVer) GitHub Releases GitHub All Releases

Enables using compendium items as templates, linking them in a similar way to how linked actors work. Players can edit linked items only partially, most fields are disabled.

Currently only compatible with DnD5e system.

Installation

In the setup screen, use the manifest URL https://raw.githubusercontent.com/elizeuangelo/fvtt-module-item-linking/master/module.json to install the module.

How to Use

Presentation

Compendium items become Templates and items can now be linked to them.

This module was comissioned for their Westmeath server as they are trying to create an MMO variant of DnD 5e. You can help them comissioning more MODs: https://ko-fi.com/thecrackedrealms

API

TODO DOCUMENTATION

const actor = ...; // actor to update
const compendiumsFolderToCheck = ['My Compendium Folder Name'] // array of folder names on the compendiums directory
game.modules.get('item-linking').api.tryToUpdateActorWithLinkedDocumentsFromCompendiumFolder(actor, compendiumsFolderToCheck, {
	onlyItems: true,
	typesToFilter: ['weapon', 'equipment', 'consumable', 'tool', 'loot', 'spell', 'backpack', 'feat'],
	compendiumForNoMatch: 'Miscellaneous'
});
const actor = ...; // actor to update
const compendiumsToCheck = ...; // array of compendium collection
game.modules.get('item-linking').api.tryToUpdateActorWithLinkedDocumentsFromCompendiums(actor, compendiumsToCheck, {
	onlyItems: true,
	typesToFilter: ['weapon', 'equipment', 'consumable', 'tool', 'loot', 'spell', 'backpack', 'feat'],
	compendiumForNoMatch: 'Miscellaneous'
});