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 Question - Bar Location Resetting With Script

Just wondering if anybody else has encountered this and if there is a way to resolve an issue I'm having. In my Game Default Settings for Token Defaults, I set the Bar Location to 'Bottom Overlapping'. If I manually save the token as the default token and then pull the token from the Journal character sheet onto the map, the bar is bottom overlapping as expected. However after I run a TokenMod script and then pull from the character sheet onto the map, the bar has been reset to the 'Above' location. Here is my TokenMod script: !token-mod {{   --on light_hassight     showname   --off isdrawing   --set     bar1_link|None     bar2_link|npc_ac     bar3_link|None     bar3_value|@{selected|hp|max}     bar3_max|@{selected|hp|max}     defaulttoken }} After I run this script, the bar still appears on the bottom of the selected token, but if I drag the token from the Journal character sheet, the bar is now set to 'Above'. Just wondering if I'm doing something wrong with this script that is causing this behavior? Thanks for any help.
1587577724
The Aaron
Roll20 Production Team
API Scripter
This functionality is not exposed to the API yet. I'll definitely add it when it is. 
Hi Aaron, thanks for the response. I had read in other threads it was not exposed to the API yet, however in this case it does seem to be resetting the bar location. I'm just wondering if this behavior is a bug or something I'm doing in my script? Also, thanks for the great mod, it's such a big time saver!
1587578415
The Aaron
Roll20 Production Team
API Scripter
Oh, sorry about that lack of clarity (and reading comprehension on my part!).  The function the API uses to set the default token (setdefaulttoken()) is implemented in such a way that it is unaware of the new bar settings. When the API passes if a token and says (make a default from this) it does not extract the specific bar settings from it. That means that when the token is created by dragging it out, those settings are not present, resulting in the bars being set to default. This is entirely within Roll20 code, which makes it impossible for us to even shim in the new behavior. Furthermore, since we can't even set those options on the token, we can't correct them on creation either. 
Thank Aaron!