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

Critical Hit Help with Scipt Cards

I am using this for my custom system, and I was making a generic roller that any of my players can use and I can use as a simple but helpful tool. I was wondering if there was a way to have the dice light up green on other numbers besides a 20. Then being able to modify that in the script, is kinda like entering your modifier except you enter your crit range. In a sense a player or GM rolls this, sets the modifier, sets the crit range, and then chooses if they have an advantage, then it rolls. So on one attack, they could have a crit range of 18-20; then on another attack, they can have a crit range of 14-20, all while using the same macro. Would that be possible?  !scriptcard {{     --#overridetemplate|scroll     --#title|D20 Check     --=Modifier|?{Mod|0}     --=Skill Check| ?{Skill Check|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1|Double Advantage, 3d20kh1| Double Disadvantage, 3d20kl1} + [$Modifier]     --+Skill Check|[$Skill Check] }}
Looks like appending cs>?{critical range|20|19|18|17|16|15|14} to the dice expression right after the advantage query should do the trick, though as I don't mess with scripts, I can't say if this works in your implementation. So, in effect, that line should look like this: --=Skill Check| ?{Skill Check|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1|Double Advantage, 3d20kh1| Double Disadvantage, 3d20kl1} cs>?{critical range|20|19|18|17|16|15|14}  + [$Modifier] If you want the options to go further down than 14, just keep adding numbers separated by pipes.
1731514561
Kurt J.
Pro
API Scripter
ScriptCards doesn't use the built-in Roll20 dice engine, and doesn't support the 'cs&gt;' clause on dice rolls. However, the latest GitHub version of ScriptCards (2.7.31 at <a href="https://github.com/kjaegers/ScriptCards/blob/main/ScriptCards_API/scriptcards.js" rel="nofollow">https://github.com/kjaegers/ScriptCards/blob/main/ScriptCards_API/scriptcards.js</a> ) has a mechanism for supporting the ability to recolor a roll highlight for any reason. The example below is just a straight roll that won't show a blue (fumble) but will show a crit (green) when the base die is above the indicated range. You would need to manually install this version since it is not yet on OneClick. !script {{ --=Roll|1d20 --?[$Roll.Base] -ge ?{critical range|20|19|18|17|16|15|14}|&gt;SetRoll;Roll;crit|&gt;SetRoll;Roll;none --+Roll|[$Roll] --X| --:SetRoll|(rollvar);(mode) --~|roll;sethilight;[%1%];[%2%] --&lt;| }}
1731534728
Andrew R.
Pro
Sheet Author
Phew! I’d read through the wiki page and couldn’t see anything about roll highlights except how to turn them on &amp; off. Nice to see a mechanism for adjusting them. I’ll be using it with my 13th Age monster abilities.&nbsp;
Kurt J. said: ScriptCards doesn't use the built-in Roll20 dice engine, and doesn't support the 'cs&gt;' clause on dice rolls. However, the latest GitHub version of ScriptCards (2.7.31 at <a href="https://github.com/kjaegers/ScriptCards/blob/main/ScriptCards_API/scriptcards.js" rel="nofollow">https://github.com/kjaegers/ScriptCards/blob/main/ScriptCards_API/scriptcards.js</a> ) has a mechanism for supporting the ability to recolor a roll highlight for any reason. The example below is just a straight roll that won't show a blue (fumble) but will show a crit (green) when the base die is above the indicated range. You would need to manually install this version since it is not yet on OneClick. !script {{ --=Roll|1d20 --?[$Roll.Base] -ge ?{critical range|20|19|18|17|16|15|14}|&gt;SetRoll;Roll;crit|&gt;SetRoll;Roll;none --+Roll|[$Roll] --X| --:SetRoll|(rollvar);(mode) --~|roll;sethilight;[%1%];[%2%] --&lt;| }} How would I manually install it?