Register

Tagger

An Add-on Module for Foundry Virtual Tabletop

Author: Wasp Project Source: Project URL Versions 12+ (Verified 12) Last Updated 5 months, 1 week ago

Tagger

This module allows you to tag PlaceableObjects in the scene and retrieve them just as easy.

All major PlaceableObjects' configuration dialogues (such as actor prototype tokens, tokens, tiles, walls, lights, etc), now has a "Tags" field.

Each tag is separated by a comma.

Example of Sequencer finding tagged objects in the scene and playing effects on them:

 

Get By tag

Get Documents with matching tags provided to the method.

Tagger.getByTag(String|Array, Object)

Docstring

@param    {String|Array}     inTags      An array of tags or a string of tags (separated by commas) that will be searched for
@param {Object} inOptions An optional object that can contain any of the following:
- matchAny {Boolean} - whether the Documents can contain any of the provided tags
- matchExactly {Boolean} - whether the tags on the Documents must contain ONLY the tags provided
- caseInsensitive {Boolean} - whether the search is case insensitive (capitals vs lowercase is not considered)
- allScenes {Boolean} - whether to search in all scenes, this will return an object with the key
as the scene itself, and an array for objects found within that scene
- objects {Array} - an array of PlaceableObjects or Documents to test
- ignore {Array} - an array of PlaceableObjects or Documents to ignore
- sceneId {String} - a string ID for the scene to search in

@returns {Array} Returns an array of filtered Documents based on the tags

Examples:

 

Get Tags

Get all tags from a given PlaceableObject or Document

Tagger.getTags(PlaceableObject|Document)

@param    {PlaceableObject|Document}  inObject   The PlaceableObject or Document get tags from

@returns  {array}                                An array of tags from the PlaceableObject or Document

 

Has Tags

Check if a PlaceableObject or Document has the given tags

Tagger.hasTags(PlaceableObject|Document, String|Array, Object)

@param    {PlaceableObject|Document}    inObject       The PlaceableObject or Document to check
@param {String|Array} inTags An array of tags or a string of tags (separated by commas) that will be searched for
@param {Object} inOptions An optional object that can contain any of the following:
- matchAny {Boolean} - whether the Documents can contain any of the provided tags
- matchExactly {Boolean} - whether the tags on the Documents must contain ONLY the tags provided
- caseInsensitive {Boolean} - whether the search is case insensitive (capitals vs lowercase is not considered)

@returns {Boolean} Returns a boolean whether the Document has the given tags

 

Set Tags

Set the tags on a PlaceableObject or Document

Tagger.setTags(PlaceableObject|Document|Array, String|Array)

@param    {PlaceableObject|Document|Array}  inObjects   PlaceableObjects or Documents to set tags on (array, or a single of either)
@param {String|Array} inTags An array of tags or a string of tags (separated by commas) that will override all tags on the Documents

@returns {Promise} A promise that will resolve when the Documents' tags have been updated
Examples:
  • Tagger.setTags(_token, "skeleton")
  • Tagger.setTags(_token, ["tags", "to", "set"])

 

Add Tags

Adds tags to a PlaceableObject or Document

Tagger.addTags(PlaceableObject|Document|Array, String|Array)

@param    {PlaceableObject|Document|Array}  inObjects   PlaceableObjects or Documents to add tags on (array, or a single of either)
@param {String|Array} inTags An array of tags or a string of tags (separated by commas) that will be added to the Documents

@returns {Promise} A promise that will resolve when the Documents' tags have been updated
Examples:
  • Tagger.addTags(_token, "skeleton")
  • Tagger.addTags(_token, ["tags", "to", "add"])

 

Remove Tags

Removes tags from a PlaceableObject or Document

Tagger.removeTags(PlaceableObject|Document|Array, String|Array)

@param    {PlaceableObject|Document|Array}  inObjects   PlaceableObjects or Documents to remove tags from (array, or a single of either)
@param {String|Array} inTags An array of tags or a string of tags (separated by commas) that will be removed to the Documents

@returns {Promise} A promise that will resolve when the Documents' tags have been updated
Examples:
  • Tagger.removeTags(_token, "skeleton")
  • Tagger.removeTags(_token, ["tags", "to", "remove"])

 

Clear All Tags

Removes all tags from a PlaceableObject or Document

Tagger.clearAllTags(PlaceableObject|Document|Array)

@param    {PlaceableObject|Document|Array}  inObjects   PlaceableObjects or Documents to remove all tags from (array, or a single of either)

@returns {Promise} A promise that will resolve when the Documents' tags have been updated

Categories

Available Versions

  1. Version 1.5.1

    5 months, 1 week ago
    Foundry Version 12+ (Verified 12) Manifest URL Read Notes
  2. Version 1.5.0

    5 months, 3 weeks ago
    Foundry Version 12 - 12 (Verified 12) Manifest URL Read Notes
  3. Version 1.4.6

    6 months, 1 week ago
    Foundry Version 10 - 12 (Verified 12) Manifest URL Read Notes
  4. Version 1.4.5

    1 year, 6 months ago
    Foundry Version 10+ (Verified 11) Manifest URL Read Notes
  5. Version 1.3.8

    Foundry Version 0.8.9+ (Verified 10.000) Manifest URL Read Notes