Skip to main content

Tag

Tags are a way of referring to Actors while playing a deck. Tags consist of a word, such as #wall or #player, which can then be referenced inside Rules.

A screenshot of the inspector showing the #ball tag for a golf ball blueprint

A screenshot of the Inspector showing a blueprint with the tag #ball

Adding and removing tags

When editing a deck, you can add tags to a Blueprint by opening the Inspector and navigating to the General tab. Blueprints can have many tags. All actors created from this blueprint will begin with this set of tags.

While a deck is playing, you can use the Add tag and Remove tag Responses to change tags on specific actors.

Common uses for tags

Colliding with certain actors

A screenshot of a collision trigger that filters by tag

An example of a collision trigger filtering by tag #wall

The Trigger for When this collides with an actor has an optional tag parameter. For example, if you want to do something when the player hits a wall (but not any other time), you could change the trigger to When this collides with tag #wall. Now the trigger will only fire when the player hits actors tagged #wall.

Telling certain actors

The Tell actors with tag Response causes only those actors to perform whatever logic you want. For example, to destroy all oxen in the card, you can say: Tell all actors with tag #ox: Destroy this actor.

Moving toward another actor

The Move toward another actor Response can be filtered by tag. For example, to make the enemies chase the player, you could say: Move toward the closest actor with tag #player.

Passing messages between actors

Tags can be used as a generic form of message passing using the When this gains a tag Trigger.

Actor A: Tell another actor to add tag #do-something
Actor B: When this gains tag #do-something:
Remove tag #do-something
Now do something...

This pattern is useful for defining reusable Rules that might want to fire from a variety of circumstances. Instead of rewriting the Rule in several places, just add the tag in each place, then write the Rule once with the trigger When this gains tag.

Running multiplayer logic

Multiplayer decks have special considerations around which device controls each shared actor. Only the controlling device can modify the properties of an actor. However, the Add tag response runs on all devices. In this circumstance, the tag-message-passing pattern becomes useful for ensuring that the controlling device is told to modify the state of an actor. For more details, see the list of multiplayer examples.