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

Re-using rolls and negative numbers

I'm using a lot of useful tips here on the forum and I came across this: In my RPG game, the enemy's defense can be higher than the attack, and when this happens the damage dealt is equal to 1. However, I don't know how to show this in a roll. Is it possible? round a number using this function $[[0]]? Anyone who can help with this issue will solve all my problems. LOL
1645715854
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Raitakamichi! Show your macro (paste the text), and it might be easier to give a specific answer, but you can probably do this with a roll group, if your intent is to show the roll if positive, but return a number no smaller than one: {[[ roll formula ]],[[1d1]]}kh1 1d1 is needed as an alt value since it needs to compare rolls. "kh1" tells the expression to return the formula results or a 1, whichever is higher.
keithcurtis said: Hi Raitakamichi! Show your macro (paste the text), and it might be easier to give a specific answer, but you can probably do this with a roll group, if your intent is to show the roll if positive, but return a number no smaller than one: {[[ roll formula ]],[[1d1]]}kh1 1d1 is needed as an alt value since it needs to compare rolls. "kh1" tells the expression to return the formula results or a 1, whichever is higher. Hi, thanks for the quick response, this is my macro: &{template:default} [[ [[@{selected|Atributo Principal} +@{selected|DanoEquip1} + (floor((@{selected|Nível}/2))) +?{Bônus|0} ]] - [[@{target|Defesa física}]] ]] %NEWLINE% $[[0]] - $[[1]]== $[[2]] {{name= [@{selected|NomeEquip1}!](! #0-Ataque-físico-AC" style="color:#ffffff;font-size:16px;font-family:Vollkorn; background-color:#961212;border:2px solid black;text-align:center;display:block;)}} {{@{selected|Nome} = Golpeia com **@{selected|NomeEquip1}** causando: $[[0]] de **@{selected|NomeEquip1|max}.**}}{{Esquiva= passiva de **@{target|Nome}** é = [[@{Target|Esquiva Passiva}]].}}{{Causando= $[[2.computed]] de **Dano final.**}}{{ =[AEpT](! %{selected|16-AEpT};#" style="color:#ffffff;font-size:16px;font-family:Vollkorn; background-color:#961212;border:2px solid black;text-align:center;display:block;margin-left: -85px;)}} In this case, I want to show the value equal to 1, when the value is negative. Is it possible?
1645718796

Edited 1645718850
keithcurtis said: Hi Raitakamichi! Show your macro (paste the text), and it might be easier to give a specific answer, but you can probably do this with a roll group, if your intent is to show the roll if positive, but return a number no smaller than one: {[[ roll formula ]],[[1d1]]}kh1 1d1 is needed as an alt value since it needs to compare rolls. "kh1" tells the expression to return the formula results or a 1, whichever is higher. My bad, I applied the formula correctly now, and it worked! thank you very much