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

Can the Sheetworker to setDefaultToken(values) be used when a token us added to a specific character sheet?

1576814465
Mike W.
Pro
Sheet Author
When adding a token to a character sheet, it is possible to use the sheet worker  setDefaultToken(values)  be used like the example in the Sheet Worker script for a compendium drop on ( "sheet:compendium-drop" , function () { var default_attr = {}; default_attr[ "width" ] = 70 ; default_attr[ "height" ] = 70 ; default_attr[ "bar1_value" ] = 10 ; default_attr[ "bar1_max" ] = 15 ; setDefaultToken (default_attr); }); Since this was made for the compendium drop and Default Game Settings does not have the capability of assigning a value to say bar_1 in reference to a character sheet. What  I am hoping to do is that when the GM assigns a Token to a player's character  sheet, it assigns bar1_max to @{current_move}, bar2_max to @{fatigue_points}, etc. Is this possible? If so, what  would  be used for the trigger in the on("...? Thanks.
1576816122
GiGs
Pro
Sheet Author
API Scripter
It would be really useful for sheet creators to be able to use that to set a default token's attributes, but i dont think there's any way to set any token attributes from a sheetworker. Other than the compendium drop, of course.
1576816770
Mike W.
Pro
Sheet Author
Yeah I thought so, it was just a random thought I had.