Hey Everyone, I'm trying to make my Serenity character sheet play nice with Roll20. Serenity works with die steps. So you increase from d2 up through d12+d12 depend on how badass you are. In order to be able to do any macro math I need to be able to do work with whole numbers. Currently the attributes are stored as whole numbers but I need to convert the whole number value over to the analogous dice roll. So 22 becomes "1d12 + 1d10". More specifically, if someone has an attribute of 20 then I need to check to see if the value is greater than 12. If True then I need to "/roll 1d12 + 1d" + (@{Attribute}-12} to display roll for that stat. Else "/roll 1d" + @{Attribute} In code-ish: If ( @{Attribute} > 12 )
{
Print "/roll 1d12 + 1d" + (@{Attribute} - 12) }
Else {
Print "/roll 1d" + @{Attribute} }
Please excuse my syntax, I'm sure it's atrocious. It's been 15 years since I've coded for real and a lot of that knowledge has been replaced with Stranger Things episodes, parenting, and bad politics. Anyone who has experience utilizing the API or simple javascript in custom character sheets I'd love to hear from you. I've googled and I can find scripts for days but very little information on how to implement them.