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

Switching between D20 and D12 in all roll buttons of a sheet

1464796353
Phoxounet
Sheet Author
Translator
Hi ! I am customizing a character sheet for a friend of mine. For his game, when a character has a critical injury (easy to add to the sheet via a checkbox), all rolls are switched from a D20 to a D12. I think I could easily listen to the trigger thanks to sheetworkers to do so (on change <checkbox_value>) but I don't know if/how change html code to switch all D20 occurences to D12. This way, a player checking this checkbox would roll any test using a D12 instead of a D20. Don't know if it is possible. Regards ! :)
1464801712
Kryx
Pro
Sheet Author
API Scripter
You'll want to set a variable named something like "dice_size" in sheetworkers. By default set it to "d20". Listen for the checkbox to be checked or unchecked and set it to "d12" or "d20" as appropriate. Then in your macros replace all d20 with @{dice_size}
1464806487
Phoxounet
Sheet Author
Translator
Well. Pretty smart and easy solution. Shame on me to not have found something soooo simple... Worked like a charm ! Thx a lot :)