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

#RollwasCrit() Function

1513272698

Edited 1513272750
I've been trying to make sense of what it says on the Wiki... and it's just confusing me.  Or maybe I'm trying to use it in the wrong fashion. Basically, the homebrew system I am designing a sheet for will automatically double the damage of an attack on a crit. What I was thinking was something like this: (@{primary-ttldmg}) * (1 + @{primary-crit}) How would I program this? The code used to do the template is as follows: &{template:default}{{name= Attack!}}{{character= @{character_name}}}{{Weapon= @{primary-name}}}{{Attack= [[1d20cs>@{primary-crit}cf<@{primary-fail}+@{primary-atk}]]}}{{Damage= [[@{primary-ttldmg}]]}} Please ignore the fact that the attributes are undefined in this segment of code.  That isn't important.
1513273145
The Aaron
Pro
API Scripter
I'm far from an expert on this, but I believe that you'd output an inline roll in your #RollwasCrit() section: {{#rollWasCrit() attack}} <span class="tcat">Crit: </span>[[ 2 * {{dmgcrit}} ]] {{/rollWasCrit() attack}} Probably this question is better asked in the Character sheets forum, where I will now move it...
The Aaron said: I'm far from an expert on this, but I believe that you'd output an inline roll in your #RollwasCrit() section: {{#rollWasCrit() attack}} <span class="tcat">Crit: </span>[[ 2 * {{dmgcrit}} ]] {{/rollWasCrit() attack}} Probably this question is better asked in the Character sheets forum, where I will now move it... I'm still confused, I have no idea how to properly implement this into the code.
1513283861
GiGs
Pro
Sheet Author
API Scripter
Can you perform rolls and calculations within rolltemplate blocks? I was under the impression this was impossible.
G G said: Can you perform rolls and calculations within rolltemplate blocks? I was under the impression this was impossible. You'd need to make a custom template to implement these functions.  They cannot be implemented into the Default Template.
1513321464
Jakob
Sheet Author
API Scripter
G G said: Can you perform rolls and calculations within rolltemplate blocks? I was under the impression this was impossible. You're right, what The Aaron wrote there wouldn't work. The best thing one could do would be to just display the same damage roll again, but calculations are not possible.