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

Using TokenMod to Place "1d4" in a Bar's Value?

Hello! I'm looking at some possibilities to help me out in tracking bless/bane and similar abilities to NPCs, and I'm right now looking at tracking the roll bonus/penalty in bar 3. Whenever I try to add "1d4" to bar3 via TokenMod, though, it defaults to "1". Is there a way to force it to put exactly what I want in Bar 3? Thanks in advance!
1600548538
GiGs
Pro
Sheet Author
API Scripter
Whats the text of the command you use to do that? Have you tried putting the 1d4 in inline roll brackets like [[1d4]]?
I'm currently using: !token-mod --set bar3_value|1d4 The problem with replacing 1d4 with [[1d4]] is that it will choose a random number between 1 and 4 and then put that number in to bar 3. I am looking at putting "1d4" into bar 3 so it can be referenced in a die roll when the NPC attacks or makes a saving throw.
1600552190
David M.
Pro
API Scripter
GiGs' response was to the more typical application we see on the forums. After your clarification, you could try  !token-mod --set bar3_value|d4 Then after it is set call it like  /roll 1@{selected|bar3} or put a query instead of the "1" if you want a variable number of d4's rolled, or whatever.
Adding "d4" and switching the roll verbiage worked great! I'm also looking to be able to quickly remove this from tokens, and before I had it switching between 1d4 and 0. So the roll would essentially be 1d20 + [monster attack bonus] + (either 1d4 or 0). Changing the 'off' value to d0 does work, but it also shows each attack roll as a critical hit. Any advice there? :)
1600553551
David M.
Pro
API Scripter
Instead of d0, try d0cs1. You can never roll a 1 on a d0, so no crit should ever happen. !token-mod --set bar3_value|d0cs1 [[1d20 + 1@{selected|bar3}]]
After further messing around, I've realized rolling a 4 on the 1d4 will ALSO cause the attacks to read as crits, which is not what I want. I'll just throw a "Add [[1d4]] to Attack Roll" in the attack description. I suppose I was trying to be too clever for my own good.
1600553917
David M.
Pro
API Scripter
Similarly, you could use "d4cs5" to suppress the critical successes
Oh, that's a great idea David! Thanks to you and everyone who chipped in :)