Invisible Tokens - The Control Token
The Control Token is simply a specialized use of the Notes Token. It really requires the API, since it is used to control scenario specific events. In the previous tip, I showed how to place and retrieve info from the GMNotes field of a token. That info can be used with other scripts to play sounds, change graphics, create mood lighting, control doors and much more.
Useful scripts for the control token are:Token-mod
Roll20 Audio Master
SimpleDoorControlsThe first two are available as One-Click installation.
How does this work?Here is an
example of a control token. This is for an acid trap in a kobold lair. It contains notes for how the trap is activated, rolls damage and finally, contains two control buttons at the bottom. I have a graphic indicating the acid pool they can encounter. The two buttons reveal or hide the acid pool. When the PCs get close to the trap and the nearby control token, I call up the notes on the Control Token which reminds me of the details, rolls damage in case I need it, and gives me buttons to hide or reveal the trap without mucking about with moving graphics from layer to layer manually. If I were ambitious, I would find a good acid splash sound effect and add a Roll20AM call to play it when the trap is revealed.
Here is the code:
Description
The ceiling of this chamber is filled with numerous holes through which the goblins can rapidly empty a cistern of acid into the room below.
Detection
The holes are cunningly disguised and require a specific DC 15 Investigation roll to be discovered. Any character proceeding more than ten feet into the room will trigger the trap and have gallons of acid poured upon them, covering the floor with several feet of the substance.
Damage
Once the trap is triggered, any character in the area can take half damage with a DC15 Dexterity saving throw. Failure deals [[6d6]] acid damage.
Any character who ends their turn in the resulting pool of acid will need to make a DC15 Con save or also take [[6d6]] points of acid damage. In either case, success indicates half damage.
[REVEAL ACID PIT](!token-mod --ids -LC7WuFLtQAzi5Y3R6_B --ignore-selected --set layer|map)
[HIDE ACID PIT](!token-mod --ids -LC7WuFLtQAzi5Y3R6_B --ignore-selected --set layer|gmlayer)
And here is the resulting GM note as it appears in chat:

I couldn't possibly list
all of the possible uses here, but here is a short list of possibilities:
Canned text for an encounterJust a list of API buttons with responses an NPC might give in a certain area
Special Mood Lighting
Turn on or off a huge aura to give a color cast to an area
Rotate a specific graphic
Such as a door or room on a map.
Move an entire group of tokens from the GM layer to the token layer
Ambush!
Lock a selected token
Used with the map lock script, this could entangle or immobilize any token. Click on your notes token to call up the command button, then select the token you want to stick in a web or vines or what have you and click the button to lock them.
Tiny soundboard
Haunted mansion adventure? Put a bunch of spooky sound buttons that make Roll20AM calls. Bonus—tie one to a mood lighting token so the lights go out and they hear a high pitched scream.
Or put a Combat Soundtrack player of your choice in each fight area, so that the music matches the opponent, creepy for the spider fight, epic for the boss battle.
Controlling an unselected object
Some of these tricks work on tokens that are on other layers, the map layer for example. The token mod examples in the code work on the token id, shown by the --ids option. To get the token id of any graphic, just select it and run @{selected|token_id} in the chat panel. It will return the token id that you can past into your macro. Remember to get the beginning hyphen—that's part of the code.
Just remember, anything you can do with a script call, you can put into a control token.