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

Tokenmod API Help

I have seen this as an important API I have no idea what it does or how to use it I read the API description and I’m still confused can someone give me a simple breakdown and why it’s helpful.
1585942073
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Here is what token mod does in a nutshell: You know all of those things you can do by opening up the settings for a given token? Token mod can set all of those by macro. It can also use macro commands to set almost anything you could do by right-clicking, or using the token's radial menus. One example out of many: It takes about 30 steps to set up a token manually: resizing, assigning bars, linking to character, setting it as default token. This can be done with one token mod command.
Sweet I’ll just have to figure it all out that sounds amazing 
1585944666

Edited 1585944693
The Aaron
Roll20 Production Team
API Scripter
Probably easiest to start with a specific task you need to do, like flipping all tokens horizontally and vertically so they face toward the rotation handle (and toward the middle of restricted light cones).  You would do that by right clicking, clicking advanced, then clicking flip horizontal.  Then repeat for vertical. You can then search the documentation for TokenMod: !token-mod --help and find what refers to vertical and horizontal.  (Bad example since those words aren't used!)  Failing that, you can look for flip, since that's part of the name.  You'll find there's a --flip argument and also fliph and flipv properties. --flip turns off things on, and on things off.  You can then construct: !token-mod --flip fliph flipv Which will make that change on any selected tokens.
So Flip shuts the API off? 
1585944949

Edited 1585944974
Joey, Keith is right. There are a million cool things TokenMod can do. You can find out how lots of GMs use them by looking at the script's discussion thread . What TokenMod allows you to do is automate with buttons or macros any of the cool things you want to display on a token (auras, lights, statuses). This can speed up gameplay, but it also can standardize visuals for things like spells and affects in your games, so the features are more meaningful. Here are a couple of my favorite uses that help make games more fun (these are D&D-based): 1. Use a macro to set vision & lighting on Tokens. Say the player lights a torch, or get a new bullseye lantern. Or is stuck in fog or blinded: !token-mod {{ --set ?{Vision| Normal, light_radius# light_dimradius# light_hassight#yes light_angle#360 light_otherplayers#no| Darkvision, light_radius#60 light_dimradius#=0 light_hassight#yes light_angle#360 light_otherplayers#no| Dusk (No light source), light_radius#60 light_dimradius#=0 light_hassight#yes light_angle#360 light_otherplayers#no| Fog, light_radius#5 light_dimradius#=0 light_hassight#yes light_angle#360 light_otherplayers#no| Blinded, light_hassight#no light_angle#360 light_otherplayers#no| Torch, light_radius#40 light_dimradius#20 light_hassight#yes light_angle#360 light_otherplayers#yes| Hooded Lantern, light_radius#60 light_dimradius#30 light_hassight#yes light_angle#360 light_otherplayers#yes| Hooded Lantern Pull Hood, light_radius#8 light_dimradius#0 light_hassight#yes light_angle#360 light_otherplayers#yes| Bullseye Lantern, light_radius#120 light_dimradius#60 light_angle#53 light_hassight#yes light_otherplayers#yes| Lamp, light_radius#30 light_dimradius#15 light_hassight#yes light_angle#360 light_otherplayers#yes| Candle, light_radius#5 light_dimradius#=0 light_hassight#yes light_angle#360 light_otherplayers#yes} }} 2. Set a status marker on a token to show stuff like a Hunter's Mark target, set a reminder icon that a token/player has Bardic Inspiration. The GM can set these, or you can create macro buttons for players to do them when they cast spells. !token-mod {{ --set statusmarkers|!chained-heart }}
1585945012
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Flip flips the token.
1585945171
The Aaron
Roll20 Production Team
API Scripter
Man... I picked a really confusing example... =D --flip changes a property from off to on, or from on to off.  So if light_hassight is true, it will become false: !token-mod --flip light_hassight fliph and flipv are properties that flip a token's image either horizontally or vertically.
Man I feel dumb reading this stuff, and I’m college educated 😶
1585945319
The Aaron
Roll20 Production Team
API Scripter
We have the benefit of years of context.  Don't even worry about it. =D  This is making me realize I need to fix the help more than ever...
I can’t seem to get the api to launch for help
1585945909
The Aaron
Roll20 Production Team
API Scripter
Have you installed the TokenMod script?  you should see something like this in the API Console Log:
Joey, have you installed the TokenMod script into your game? That one often trips up new API users. Once it's running, you can simply type the !token-mod command into the chat line.
Yes I think I it’s added just not doing anything 
Yeah I double checked it last night I can’t seem to get it to do anything thing. Should I delete the script and try to reload it?
1586016379
The Aaron
Roll20 Production Team
API Scripter
If you want to PM me an invite and GM me, I can come take a look at it.