FoundryVTT: Multilevel Tokens

Foundry Virtual Tabletop v.0.7.5
Multilevel Tokens v.1.3.4
Creator/Maintainer: FVTT: Grandfunk; GitHub: STU grandseiken

The Multilevel Tokens module for FoundryVTT is game system agnostic. Expanding on the existing Drawing function within Foundry, this module allows GM’s to setup areas for a variety of things, such as: 

  • Teleport tokens to another location when they move into a particular region (on the same scene or different scenes, say like moving on staircases).
  • Clone tokens from one region to another, syncing movement and other property updates (e.g. allowing players to “see” what is happening on floors below).
  • Trigger macros when a token enters or leaves a particular region.

Multilevel Tokens Project Source URL

Teleport

Using the drawing tools, create drawing areas where you want to teleport to\from. Make both the same size. Right click to access the Drawing Configuration > Multilevel > Set if the image is an IN region to teleport to an OUT region or both. Give it a unique Teleport Identifier

Pit Trap

Great also for making Pit Traps. Create a 5×5 square somewhere else on the map (in a wall next to the area) and have characters teleport there if they land on that square.
Could also setup a macro to reveal an image, change elevation, etc.

Create a Drawing for where the pit trap will be > Multilevel > In > [PitTrap]
Another location of the same size walled in and with image > Multilevel > Out > [PitTrap]

Cloning Regions

These allow you to setup areas that clone the actions in another region. Like showing whats happening below on multiple level maps (out windows, over balconies, etc.).

Its the same as setting up Teleportation areas, just commonly much larger and using the section on Token Cloning. This allows you to scale as well.

Pit Trap (Continued Clone)

Token cloning > Source > Clone identifier: InPit1

Target > Clone identifier: InPit1
Cloned token scaling factor: 0.5

Trigger Macros

I’m certain there are several things people would like to trigger when tokens move onto an area, but I’ll only cover a few here:

Change Token Height

First, create a macro script called TokenHeight:

// if a token enters the area…
if (event === MLT.ENTER) {
// update its height to match the additional argument field provided in the drawing
token.update({"elevation": args[0]});
//if a token leaves…
} else if (event === MLT.LEAVE) {
// remove the elevation previously set
token.update({"elevation": 0})
}

This allows arguments to be placed within the Multilevel Token as the elevation of that actor token, put into the “Additional arguments” field. Draw the area you want this to take effect, like up a ladder and the balcony overlooking an area.

If you have the Wall Height module installed as well, this can change how much on an area tokens could see as well.

Pit Trap (Continued Macro)

Create a macro with a unique name (PitTrap1)

// select a tile, open the console and type canvas.tiles.controlled.
//Get the ID (0: Tile >
// data: {_id: "[the unique ID]", …
let tile = canvas.tiles.get("wMOfCRN6Xd3gaHEC")
tile.update({"hidden" : false})
// pit trap damage
new Roll('1d6[bludgeoning]').roll().toMessage({ flavor : 'You fall down a pit taking taking' });

Place the image you want to use and mark it not visible to players. You place this in the same location as your drawing that activates the teleport. Follow the macro directions to get the unique ID of that Tile.

Go into the settings of the drawing and go down to Macro triggers > check Trigger on enter.

On the PitTrap teleport location, set the MacroTriggers > Check Trigger on enter AND leave > Macroname “TokenHeight” > Additional arguments “-10”

Now when a token enters the space, they are teleported to the hole, the hole is revealed, the token indicates that its down 10 ft, and dmg is rolled for the fall.

Additional Settings

Trigger on enter: Actor gets the effect when entering the space
Trigger on leave: Effect on Actor is removed when leaving the space

This allows you to set the effect to happen and continue effecting the target – say when Actors go up a set of stairs (Only Trigger on enter checked), or the effect only takes effect well on something, on a platform or up a ladder into a tower (Both enter and leave are checked).

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.