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

Game Default Settings Question - linking specific attributes to Bars by default?

1514608824
MrBS
Pro
Sheet Author
API Scripter
Is there a means to set the individual bar values to a particular sheet attribute so that when a token is linked to a character sheet it will automatically set those bar values to the attribute?  currently I need to go in and set each of the bars for each token after it is linked. Example: I have three attributes associated with a character sheet (Avoidance, Fortitude, and Discipline).  After I link a token to a character sheet via Edit and setting the "Represent character" I then need to go through and link each of the bar values (1, 2, and 3) to the three previous attributes.  Campaign Token Defaults has the ability to set values but not the attributes.  Can this be done through scripting somehow?
1514610131
The Aaron
Pro
API Scripter
Indeed it can!  TokenMod to the rescue! This will prompt for the name of the character, then set the token to represent it, link each of the 3 bars as you specified, then set it as the default token.  No need to even go into edit mode on the bio tab. =D !token-mod {{ --set represents|"?{Character Name}" bar1_link|Avoidance bar2_link|Fortitude bar3_link|Discipline defaulttoken }}
1514610236
The Aaron
Pro
API Scripter
I usually do these as 2 separate steps for monsters so I can grab stats from the monster character that I don't necessarily want to be updated for each mook, and set up some other things I want on the critter at the same time: !token-mod --set represents|"?{Monster}" !token-mod {{   --on showname light_hassight    --off isdrawing    --set     name|"@{selected|character_name} %%NUMBERED%%"     bar1_link|AC     bar3_value|@{selected|HP}     bar3_max|@{selected|HP|max}     light_radius|?{Light|60}      light_dimradius|=?{Dim at|-5}      defaulttoken  ?{Player Visible?|No,--off|Yes --on} light_otherplayers }}
1514610352
The Aaron
Pro
API Scripter
I do it in one step for players: !token-mod {{   --on showname      light_hassight      showplayers_name      showplayers_bar1      showplayers_bar2      showplayers_bar3      showplayers_aura1      showplayers_aura2   --off isdrawing    --set represents|"?{Character Name}"      bar1_link|AC     bar2_link|Speed     bar3_link|HP     light_radius|5      light_dimradius|=-5 defaulttoken }} I set players to just have dim sight, but then I give them this macro to let them choose their sight: !token-mod --set ?{Vision|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|Bullseye Lantern, light_radius#120 light_dimradius#60 light_angle#60 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|Darkvision, light_radius#60 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Darkvision (90'), light_radius#90 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Warlock Devil's Sight, light_radius#120 light_dimradius#=120 light_hassight#yes light_angle#360 light_otherplayers#no|No light source(Dusk), light_radius#120 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Fog, light_radius#200 light_dimradius#=5 light_hassight#yes light_angle#360 light_otherplayers#no|No light source, light_radius#5 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Blinded, light_hassight#no light_angle#360 light_otherplayers#no}
1514610759
GiGs
Pro
Sheet Author
API Scripter
Those are great, Aaron. I'm copying some of them.
'Some'?!? I'm blatantly stealing all of them, thankyouverymuch! /me owes TheAaron a pizza
1514612210
MrBS
Pro
Sheet Author
API Scripter
Awesome!  Thanks.
1514655673
The Aaron
Pro
API Scripter
No problem!  =D