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

Generating an effect number in a custom character sheet rollTemplate

1679857264

Edited 1679857448
I want to be able to subtract the die roll from the character stat to givean effect number that can be reported back with a rollTemplate. I know the calculation can not be done within the template, but can it be done when calling the rollTemplate? I have tried the following, but do not know how to reference the value of the roll. … {{roll=[[1d20]]}} … {{EffectNo=[[@{STRbcs}-{roll}]] }}   so in this case the effect number would be 4. if the roll is failed the effect number would be negative. I have spent quite some time looking at lots of posts and have come to the conclusion that it cant be done, however on the off chance that I have missed something, I thought I would put it out here to ask if anyone has any ideas   Thanks
1679859234
Gauss
Forum Champion
Could you supply the current macro?  You can reuse rolls . If that is not enough it can be done via a Mod (API Script).
1679861894

Edited 1679861905
GiGs
Pro
Sheet Author
API Scripter
Custom Roll Parsing can probably resolve this, too. But Resuse Rolls will be a lot simpler. … [[@{STRbcs}-[[1d20]] ]] {{roll=$[[0]]}} … {{EffectNo=$[[1]] }} Notice no {{ }} brackets around the roll at the start - that's to make sure that roll isn't displayed in the output.
Many thanks for the prompt replies. I managed to get it using the  reuse rolls . however it took some time because i had to factor in some other modifiers to the attribute for the comparison.  &{template:statRoll}  [[ [[@{STRbcs}[bcs]+@{level}[level]+?{Modifier|0}[Mod]]] - [[1d20]] ]] {{name=@{character_name}}} {{statvalue=$[[0]]}} {{fumble=[[20]]}} {{crit=[[{round(([[@{STRbcs}+@{level}+?{Modifier|0}]])/10),1}kh1]]}} {{failed=[[@{STRbcs}+@{level}+1]]+?{Modifier|0}[Mod] }} {{roll=$[[1]]}} {{statname=Strength}} {{EffectNo=$[[2]]}} However until tonight i had no idea you could reuse rolls. The code doesn't look pretty but at least it works. When i get the time I'll have another play and try to tidy it up some more.