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

Problem of rolling dice

1536597795

Edited 1536597842
Kinower
Sheet Author
I have the following code /r 1d100cs<5%cf>96,97,98,99,100 this formula means that when I get less than 5% of the result of the d100 is a critic and the result looks green and that when the result is 96.97,98,99,100 the result is blunder, because when I release less than 5% it works fine except when a result of "1" comes out then it turns blue. ?¿?¿?¿?¿?¿? In addition, when a result of 96,97,98,99,100 does not appear, the red color does not appear Does anyone know what is going on??
To my knowledge, you cannot use % in a dice expression. Nor, can you use commas to denote additional instances. You could accomplish what you are expecting (critical success on a value of 5 or lower and critical failure on a result of 96 or higher) with the following expression. /r 1d100cs<5cf>96
1536598782
The Aaron
Pro
API Scripter
Take out the "%" and the ",97,98,99,100".  They cause the roll to be interpreted as "1d100cs<5 [%cf>96,97,98,99,100]", which means the default cf of 1 is active.  When cf and cs overlap, the outline color for inline rolls is blue (the red overrides for /r rolls). Incidentally, because of historic reasons cf<5 means "Critical Failure on 5 or less", not "less than 5".  cf>96 will give you critical failure on 96 and greater.  If you need to specify individual numbers, you'd give them each their on cs, like "cs96cs98cs100". So, your formula should be: 1d100cs<5cf>96 which you can supply to /r or [[ ]] as you prefer.
1536603428

Edited 1536603447
Kinower
Sheet Author
great, for the values ​​of 96-100 run perfect the problem is that I'm using the formula for a skill, so the value of that skill is not always 100%, the value is relative, so when the skill is for example 50% the result of the critic is not from 1 to 5, but from 1 to 3 (rounding)
You could make the success a calculated value. So for example if you new that it was a success on 10 or lower modified by their skill level which I will just use 50% here (use as a decimal not a percentage). I could make the macro /r 1d100cs<[[10*0.5]]cf>96
I do not know what happens, but this formula keeps giving results 1-5 regardless of the value
1536611570
The Aaron
Pro
API Scripter
What formula are you using now?
this is a example <td><input type="number" name="attr_alquimia"/></td> <td><button type="roll" name="roll_alquimia" value="&{template:default} {{name=Alquimia}} {{Valor=@{alquimia}}} {{Resultado=[[1d100cs<[[10*0.5]]cf>96]]}}" /></td>
1536616202
GiGs
Pro
Sheet Author
API Scripter
It looks like this bit {{Resultado=[[1d100cs<[[10*0.5]]cf>96]]}} should be {{Resultado=[[1d100cs<[[round(@{alquimia}*0.05)]]cf>96]]}} SECOND METHOD Since you are using a rolltemplate, you could also build the comparison into your rolltemplate by adding a critical parameter {{critical=[[round(@{alquimia}/20)]]}} And then use it in the rolltemplate to check for criticals. But the first method is simple enough and easier to build. BOTH METHODS Your code might have another problem. You might also need to wrap Valor in square brackets if you are using a comparison in the rolltemplate, like so {{Valor=[[@{alquimia}]]}} If you dont do this, the rolltemplate treats it as text, not a number.
1536652142

Edited 1536652166
Kinower
Sheet Author
G G said: It looks like this bit {{Resultado=[[1d100cs<[[10*0.5]]cf>96]]}} should be {{Resultado=[[1d100cs<[[round(@{alquimia}*0.05)]]cf>96]]}} SECOND METHOD Since you are using a rolltemplate, you could also build the comparison into your rolltemplate by adding a critical parameter {{critical=[[round(@{alquimia}/20)]]}} And then use it in the rolltemplate to check for criticals. But the first method is simple enough and easier to build. BOTH METHODS Your code might have another problem. You might also need to wrap Valor in square brackets if you are using a comparison in the rolltemplate, like so {{Valor=[[@{alquimia}]]}} If you dont do this, the rolltemplate treats it as text, not a number. thanks, with the second method that worked