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

Sheet Worker To Clear Attributes?

1493123166

Edited 1493123277
Will K.
Sheet Author
Hey fellas, I'm trying to amend a character sheet with a button to set a list of attributes to 0 when clicked.  Any chance this can be done with sheet workers?
1493124647
Ziechael
Forum Champion
Sheet Author
API Scripter
As a pro user (assuming you are the game's creator or the creator is also pro...) you could easily achieve this using the  ChatSetAttr script.
1493142578
Lithl
Pro
Sheet Author
API Scripter
You could style a checkbox to look like  a button. When the attribute associated with that checkbox changes, you can have a sheet worker clear your list of attributes.
1493142696

Edited 1493142741
Finderski
Pro
Sheet Author
Compendium Curator
It is also possible with a Sheet Worker. I did that for the Savage Worlds Tabbed character sheet.  I don't believe you can use a real button, but I used a checkbox with a span to make it look button-like. Then you'd set up your Sheet Worker to watch for a change in that checkbox, and when the specific change you're looking for occurs, then you use setAttrs to set all the values of the fields to 0. You'd likely want to change the value of the checkbox as well to "reset" it. D'oh! Sniped by Brian.
1493152587
Lithl
Pro
Sheet Author
API Scripter
Finderski said: You'd likely want to change the value of the checkbox as well to "reset" it. Not actually necessary. If you're reacting to any change on the checkbox and not checking its value, you don't need to set its value to anything during the 'reset' operation.
1493157446
Finderski
Pro
Sheet Author
Compendium Curator
Brian said: Finderski said: You'd likely want to change the value of the checkbox as well to "reset" it. Not actually necessary. If you're reacting to any change on the checkbox and not checking its value, you don't need to set its value to anything during the 'reset' operation. Good point...I blame fatigue. ;)
Disguise a checkbox to look like a button, make the sheet worker look for changes on the checkbox's attribute then make changes to my list of attributes.  Got it.  Finderski, gonna look through your sheet to see what exactly that should look like.  Appreciate the quick response!