Advertisement Create a free account

Custom helper functions

Hello, On my custom sheet, i need to compare the unit digit of a roll. (Crits are defined by a 0) Is possible to defined custom helper function (as rollWasCrit) ? Thanks
1521046534
Scott C.
Pro
Sheet Author
API Scripter
No, it isn't.
1521047197
Finderski
Pro
Sheet Author
Scott C. said: No, it isn't. But there are a bunch of other Helper Functions (which you probably already know about) that allow you to compare the roll to change the display. For example  {{#rollGreater() <rollname>}} {{#rollLess() <rollname>}} And don't forget that you can use the ^ to mean the opposite, which does come in handy at times.
1521047556

Edited 1521047625
Jakob
Sheet Author
API Scripter
Mathieu V. said: Hello, On my custom sheet, i need to compare the unit digit of a roll. (Crits are defined by a 0) Is possible to defined custom helper function (as rollWasCrit) ? Thanks Depending on the range of results, you could also hardcode the unit digit cases, by baking them into the rolltemplate with a bunch of rollTotal() functions (rollTotal() roll 10, rollTotal() roll 20, ...) OR depending on how your rolls are set up, you can change what crits mean by changing your roll commands, e.g. [[d100cs10cs20cs30cs40cs50cs60cs70cs80cs90cs100]]
Thanks to all. Yep, i can use [[d100cs10cs20cs30cs40cs50cs60cs70cs80cs90cs100]] to specify all the crits (i didn't know i can cumulate cs values, thanks), but ideally, i want to add the unit digit to the damage. For exemple, a player roll the dice (d20) for sword attack, he obtains 15, then the damage of the sword will be : 7 (base damage of sword) + 5 (unit digit of the roll) How can i do that, if i can ?
1521396422
GiGs
Pro
Sheet Author
Since you're a pro user, you might be able to do this with the Power Cards script.