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 .
×

Turn on Token's Aura with checkbox

A couple of the characters for my custom game have auras that can be activated or deactivated depending on what they do. I'm trying to see if I can use a checkbox to turn on the token's aura, and adjust it's size based on other variables.  Here's what I have.   < select   class = "archInfo"   name = "attr_SwarmType" >     < option   value = 10 > Alpha </ option >     < option   value = 20 > Beta </ option >     < option   value = 30 > Gamma </ option >     < option   value = 50 > Delta </ option >     < option   value = 80 > Epsilon </ option >     < option   value = 100 > Omega </ option > </ select > < input   value = 0   type = "number"   name = "attr_Intellect"   />   input   value = 0   type = "number"   name = "attr_SwarmRadius"  readonly />     < input   type = "checkbox"   value = "1"   name = "attr_SwarmActivated" > < script   type = "text/worker" > on ( "change:swarmactivated change:swarmtype change:intellect   sheet:opened" , function (){      getAttrs ([ "SwarmActivated" , "Intellect" , "SwarmType" ],  function  ( values ){          let   SwarmType  =  parseInt ( values [ "swarmType" ]) ||  0 ;          let   SwarmActivated  =  parseInt ( values [ "SwarmActivated" ]) ||  0 ;          let   Intellect  =  parseInt ( values [ "Intellect" ]) ||  0 ;          let   SwarmRadius  = ( Intellect * 10 )+ SwarmType ;          if ( SwarmActivated ){              //Turn the aura on          } else {              //turn the aura off         }          setAttrs ({              "SwarmRadius" :   SwarmRadius         });     }); }); </ script >
1610821442
Andreas J.
Forum Champion
Sheet Author
Translator
Normally, character sheets can't change settings for tokens beyound the three bars, you need API to do what you are attempting. You'd need to combine this  with some API that listen for changes, that then acts on this swarmradius value and sets the aura. Maybe CustomRollListener + TokenMod can get this done.
That's frustrating, but thank you. When I get the rest of the sheet ready, I'll start digging into APIs then.