Package Description

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:

https://cdn.discordapp.com/attachments/734095524822777976/882029504980205628/detect_magic3.mp4

 

Get By tag

Gets objects with matching tags provided to the method.

Tagger.getByTag(string|array, options={})

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:
                                             - matchAll {boolean}        - whether the PlaceableObjects must contain all of the provided tags
                                             - caseInsensitive {boolean} - whether the search is case insensitive (capitals vs lowercase is not considered)
                                             - objects {array}           - an array of PlaceableObjects to test
                                             - ignore {array}            - an array of PlaceableObjects to ignore
                                             - sceneId {string}          - a string ID for the scene to search in

@returns  {Promise}                      A promise that will resolve when all PlaceableObjects have been found, returning an array of PlaceableObjects

Examples:

  • Tagger.getByTag("tags")
  • Tagger.getByTag("tags, TO, LOOK, foR", { caseInsensitive: true })
  • Tagger.getByTag(["tags", "to", "look", "for"], { matchAll: true, sceneId: "8xjy4UUVoRcEYUNy" })

 

Get Tags

Gets all tags from a given object

Tagger.getTags(object)

@param    {PlaceableObject}  inObject    The PlaceableObject get tags from

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

 

Set Tags

Set the tags on an object

Tagger.setTags(object|array, string|array)

@param    {PlaceableObject|array}    inObjects   A PlaceableObject or an array of PlaceableObjects to set tags on
@param    {string|array}             inTags      An array of tags or a string of tags (separated by commas) that will override all tags on the PlaceableObjects

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

 

Add Tags

Adds tags to an object

Tagger.addTags(object|array, string|array)

@param    {PlaceableObject|array}    inObjects   A PlaceableObject or an array of PlaceableObjects to add tags to
@param    {string|array}             inTags      An array of tags or a string of tags (separated by commas) that will be added to the PlaceableObjects

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

 

Remove Tags

Removes tags from an object

Tagger.removeTags(object|array, string|array)

@param    {PlaceableObject|array}    inObjects   A PlaceableObject or an array of PlaceableObjects to remove tags from
@param    {string|array}             inTags      An array of tags or a string of tags (separated by commas) that will be removed from the PlaceableObjects

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

 

Clear All Tags

Removes all tags from an object

Tagger.clearAllTags(object|array)

@param    {PlaceableObject|array}    inObjects   The PlaceableObjects to remove all tags from

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

Tagged Categories

  1. Tools and Controls

Available Versions

  1. Version 1.0.3

  2. Version 1.0.4

  3. Version 1.1.0

  4. Version 1.1.1

  5. Version 1.1.2

  6. Version 1.1.3

  7. Version 1.1.4

  8. Version 1.1.5