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

[Question] is it possible auto connect hp and bar1 by Sheet Worker Scripts?

1520909947
Sad
Sheet Author
API Scripter
It seem bar1_link only work for api. So is it possible connect the bar1 value to hp, bar1_max  to hp_max , when people create a new token. Or when people who edit the bar value, the hp will also change.
1520910948
GiGs
Pro
Sheet Author
API Scripter
Just to be clear - you know you can do all that without using the API? Link bar1 to a character sheet without using the api, so that hp1 currrent and max are set, and then when bar1 is edited, the value on the character sheet changes? Scroll down to the bottom of this page, under the title: Linking Tokens and Characters Together. After you have done the steps listed there, (repeat: after doing that ), open the Journal and set the token as a Default Token. If you have a default token setup already, delete it and re-add it. The number one thing that trips up people with roll20 is how counter-intuitive it is to set up tokens. If you make any changes to the token settings, you have to delete the current character's sheet's token, and reset the updated one.
1520933632
Ziechael
Forum Champion
Sheet Author
API Scripter
You can also just set that up as the games  default settings for tokens :)
1520939135
Jakob
Sheet Author
API Scripter
But to answer the question, you cannot  automatically link bar 1 to hp via sheet worker scripts.* * There may be an exception for compendium-drop events for the Monster Manual and such, but this is only relevant for systems which have  a compendium with monsters in it, i.e. D&D and maybe Pathfinder?
1520941375

Edited 1520941476
GiGs
Pro
Sheet Author
API Scripter
He didn't mention sheet workers, he asked about the API. I was waiting to see if he actually needed the API, before offering advice on that front. Edit: oops just noticed the thread title. Still, I was thinking of suggesting a script to manage it, but was waiting to see if it was really needed.