Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Turning vision types on and off. Shadowrun 5e, TokenCondition API

Hello, I am trying to make a macro that will allow my players to turn on and off certain vision types, although that isn't exactly right.  I am using TheAaron's TokenCondition api to assign vision types such as thermographic, ultrasound, radar, and astral to my players.  This involves giving control of tokens representing that type of vision to the players. I am using a blank character sheet named Vision with an ability macro for each type of vision I want to be able to turn on and off instead of using a Macro from the collections tab. Idealy, I would like to have a player facing option that allows them to click the appropriate vision macro from their macro bar and it will just ask them on/off.  The question I have is this, Is there a way with api and character ability macros to know the player that called the macro?  I know I can make a DM facing option where I pick the player I want to have it from a list, but I want this to be player facing instead. Thank you for you time, let me know if I can provide more details or explain something better.
1633918185
timmaugh
Pro
API Scripter
You can use meta script constructions in the command line to get this information. Provided the player is speaking as the character, this will get the character name: @(speaker.character_name) ...or character id... @(speaker.character_id) If you need a token id, you can nest these to arrive at a token for that character on the current page: @\(speaker.character_id).token_id) REQUIRED SCRIPTS: Fetch, ZeroFrame, SelectManager