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

Roll20 Tips and Tricks (Innovative Solutions to Common Problems)

1622231228
Kraynic
Pro
Sheet Author
This is not a general help, thread.  To continue your topic, you should start your own thread, so that this thread can remain dedicated to specific finished tips and tricks and refinements of those tips and tricks.
1622238736
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Dan and Unliked Dean, Although I understand your need for assistance, this thread is for the sharing of innovative tricks that people have come up with, not for asking for help. If you post your questions in their own thread, they will be answered.
1623616800

Edited 1623620747
Inserting a new line into chat  This may have been posted elsewhere, but I couldn't find it on any other thread. To get a new line in the chat you can use %NEWLINE% (including the percent symbols). That will get parsed out and replaced with a new line charter. This can be faster than using a macro. One other benefit is that reusing dice (aka $[[0]]) only works on the same line, so if a new line is copied in then the reusing format will not work. It does however work with adding %NEWLINE%  in the middle. Hopefully, this helps someone! 
@Kyle, that's awesome! I never knew about that, and was able to use it as a delimiter in an API command that normally can't use other forms of line breaks. Only downside is it seems to put one blank line between each line, rather than just separating the list with line breaks.
1624058831
Andreas J.
Forum Champion
Sheet Author
Translator
Inline Roll inside a Tooltip The tooltip -trick can be expanded to include inline rolls : [**Burn**](#" class="showtip" title="Causes damage at start of turn, **Reflex** save of [[3d6+2]] to end condition.) Related In a recent thread , I played around with the %NEWLINE% trick and other things, and is when I discovered this.
Here is a really simple trick to make rotating battle cries. If you are not the GM, you will need to get them to make a rollable table for you with the different battle cries you want to make; for this punny character I had two, one for ice spells and one for fire spells.  Once the table is in place for you, you can embed the roll against the table right into your weapon or spell description like so: When ever you use that attack, the random saying will appear in chat like this:
Thankyou.
I don't know if this is useful, but I've come up with a macro that allows a DM to do the common rolls that would go behind the screen, such as perception, investigation etc. You select the token and click the macro button. It looks like this. The fomula for it is: &{template:default} {{name=**GM doing secret roll for @{selected|token_name}**}} /w gm &{template:default} {{name= @{selected|token_name}}} &{template:default} {{perception = [[d20+[[@{selected|perception_bonus}]]]]}} &{template:default} {{Investigation= [[d20+[[@{selected|investigation_bonus}]]]]}} &{template:default} {{Insight= [[d20+[[@{selected|Insight_bonus}]]]]}} &{template:default} {{Stealth= [[d20+[[@{selected|Stealth_bonus}]]]]}} 
Thanks for this! Miles said: I don't know if this is useful, but I've come up with a macro that allows a DM to do the common rolls that would go behind the screen, such as perception, investigation etc. You select the token and click the macro button. It looks like this. The fomula for it is: &{template:default} {{name=**GM doing secret roll for @{selected|token_name}**}} /w gm &{template:default} {{name= @{selected|token_name}}} &{template:default} {{perception = [[d20+[[@{selected|perception_bonus}]]]]}} &{template:default} {{Investigation= [[d20+[[@{selected|investigation_bonus}]]]]}} &{template:default} {{Insight= [[d20+[[@{selected|Insight_bonus}]]]]}} &{template:default} {{Stealth= [[d20+[[@{selected|Stealth_bonus}]]]]}} 
Wheeling Formations for Rank-and-File Wargames This is going to be a cool trick for Roll20's very small wargaming scene. Roll20 can only rotate tokens and images from the center of that image. This is more than adequate for games like Age of Fantasy: Regiments and Kings of War. But for games like Warhammer Fantasy Battles and The 9th Age which require units to "wheel" their formation if they want to change directions. Wheeling is simply rotating a group of units around a corner rather than from the center. The trick is to use a large square (preferably transparent) token with a marking to denote the image's center. We'll call this the Rotator Tool. Basically you place the Rotator Tool over the unit you wish to wheel, making sure that the central marking is over the corner that you wish to turn. You would then drag select the unit and the Rotator Tool and when you rotate everything, the unit will turn on a corner rather then the center.  In this example, we have a unit of Empire Knights declaring a charge upon a unit of Dark Elf Cold One Riders who are stuck in melee with a unit of State Troopers. I placed the Rotator Tool on the upper right corner of the Knights since they will have to wheel a bit to the right in order to face the Dark Elves. Next, I drag select the knights and the Rotator Tool and then use my mouse cursor to rotate everything. You can see that the Knights are pivoting on the front right corner of the formation. Then I set aside Rotator Tool and have the Knights make the rest of their charge. Of course, I need to complete the charge action by maximizing base to base contact with the engaging units so I use the Rotator Tool as I did earlier. Now, the Dark Elves have been flanked and we run them down with our lances (assuming RNGesus is on our side).
1628057771
GiGs
Pro
Sheet Author
API Scripter
What is the Rotator Tool you are referring to?
1628064392
Ziechael
Forum Champion
Sheet Author
API Scripter
GiGs said: What is the Rotator Tool you are referring to? It's the semi-transparent token used as a guide: a large square (preferably transparent) token with a marking to denote the image's center. We'll call this the Rotator Tool. Nice, simple solution that even free users can employ with little effort! And a nice flanking charge into those cold ones should see them routing in no time too... well played :)
GiGs said: What is the Rotator Tool you are referring to? Its an ad-hoc tool that I made. The first thing I did was use roll20's Art Library and made a search for "Square" and I found this image that worked really well. It's a completely clear square with a "+" in the center.  I put the image down on the objects layer as a token and set the dimensions to 12x12 inches (it needs to be big enough to envelope all of the models in a unit) then made a character sheet entry with that square as the default token. I also added a circle aura around it so that its easier to see.  Ziechael said: GiGs said: What is the Rotator Tool you are referring to? It's the semi-transparent token used as a guide: a large square (preferably transparent) token with a marking to denote the image's center. We'll call this the Rotator Tool. Nice, simple solution that even free users can employ with little effort! And a nice flanking charge into those cold ones should see them routing in no time too... well played :) Thanks!
1628094076
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Yet another good use for an Invisible Token. [ wiki ][ thread ]
Miles said: I don't know if this is useful, but I've come up with a macro that allows a DM to do the common rolls that would go behind the screen, such as perception, investigation etc. You select the token and click the macro button. It looks like this. The fomula for it is: &{template:default} {{name=**GM doing secret roll for @{selected|token_name}**}} /w gm &{template:default} {{name= @{selected|token_name}}} &{template:default} {{perception = [[d20+[[@{selected|perception_bonus}]]]]}} &{template:default} {{Investigation= [[d20+[[@{selected|investigation_bonus}]]]]}} &{template:default} {{Insight= [[d20+[[@{selected|Insight_bonus}]]]]}} &{template:default} {{Stealth= [[d20+[[@{selected|Stealth_bonus}]]]]}}  You can shorten your macro code. The &{temlate:default} is just necessary at the beginning of your macro. You can remove all the others ;)
I have seen in many PFS 2e games that some combat rolls have included graphics for the effect.  A 30' cone, or 60' line.  Some have included gifs in the chat.  I was wondering if anyone can point me to how this is done?  
1628279835
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Gregory, That would be better posted in its own thread. This thread is for publishing finished tricks. I'm sure there are lots of folks who could give you some good answers.
1628784584
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Chris M. said: Is anyone else having trouble with SHIFT-DOUBLE CLICK top open a character sheet? Chris, that's the sort of thing that should be posted in the bugs forum and reported on the  helpdesk . This thread is for sharing unknown tips and tricks for using the Roll20 system.
Random NPC Tokens One of the things I often loathe about setting up certain scenes, like a bar map or crowded room, is setting up NPC tokens. Usually, I have tokens ready for named characters I expect players to interact with, or to be a part of the story or scene in any way, but it always feels weird to me just putting those down and pretending the rest of the room is crowded or has other patrons around. In fact, I often find it breaks immersion sometimes - are the players trying to have a sneaky conversation about a taboo subject - if they are how can they tell if the seat next to them is already taken or someone might overhear? To solve this, in come roll tables! Or just one big roll table, for that matter. I've set up a table called "NPC-Tokens" which has just that - a ton of NPC token images. (I'd note that my game world is pretty open on the kinds of races you'd find in a typical place - if you were running an underdark campaign you might want to have separate tables for drow tokens and human tokens so you have a bit more fine-tuned control, for example.) Clicking the "Token" button places a token on the page. I can then right-click on it, go to "Multi-Sided" then click "Random Side" and it'll change into one of the many tokens available. Even better than that, I can drop a lot of these tokens at once, select them all and do the same - they'll all change to different random tokens. With a large number of tokens in the pool, hopefully, the same tokens won't be reused very often - and definitely infrequently enough for players to notice any repeated tokens. Now if only they didn't ask for every random person's name...
How do you make field of vision work with light sources such as torches? For example, my character has 60ft dark vision, so when there is no light source, and with field of vision enabled, I see dim light only in the direction im facing. However, if you introduce a light source, such as a torch, and place it behind me, it allows you to see even if you aren't facing in that direction. It basically ruins the field of vision setting. What would be the fix to this?
1629131603
GiGs
Pro
Sheet Author
API Scripter
This isnt a thread for general questions, its a thread for already solved solutions. You should create a new thread to ask that, to avoid cluttering this thread.
1629384134

Edited 1629556774
CSS Styled Text In a similar vein to the tooltip trick, style elements can be set in links. From my limited testing, not all CSS works but a fair bit does. Coloured Text The following code would produce output red text. [Red](#" style="color:red;) Setting a macro as the following would allow any text to be used with any colour: [?{Text|}](#" style="color:?{Colour|};) For the colour input, you can use the English names of some colours or a hex colour code. Decorated Text You can add text decoration in a similar way. The following macro allows you to apply various text decorations to inputed text: [?{Text|}](#" style="text-decoration:?{Decoration|Underline, underline|Overline, overline|Strikethrough, line-through};) General CSS The following macro will allow any CSS to be aplied to the text. From my limited testing, not everything works but a fair bit does: [?{Text|}](#" style="?{CSS Styling|};) Hopefully someone will find a practical use for this. Edit Looking back though this thread it turns out this has been done in much more depth already here .  
Hi all by no means am I good at coding and all that. But I play around with it and I was wondering if there is a way to have a lookup find how many cantrips, 1 st level ect… spells a NPC or selected player has and have it show in the chat. This is what I have as on now, I wanted to see if you can call up an attribute like “spells_count_cantrip” to get the count of cantrips and have the macro just get that amount so I do not get errors like the one in the screen shot " selected|repeating_spell-cantrip_$4_spellname" . Thanks w gm &{template:default}{{name=@{selected|character_name} Spellcasting }}{{ Spell DC [[@{selected|spell_save_dc}]] = +[[@{selected|spell_attack_bonus}]] spell attacks }}{{ Cantrips = [@{selected|repeating_spell-cantrip_$0_spellname}](~selected|repeating_spell-cantrip_$0_spell)[@{selected|repeating_spell-cantrip_$1_spellname}](~selected|repeating_spell-cantrip_$1_spell) [@{selected|repeating_spell-cantrip_$2_spellname}](~selected|repeating_spell-cantrip_$2_spell) [@{selected|repeating_spell-cantrip_$3_spellname}](~selected|repeating_spell-cantrip_$3_spell) [@{selected|repeating_spell-cantrip_$4_spellname}](~selected|repeating_spell-cantrip_$4_spell) }}{{ 1st (SLOTS) = [@{selected|repeating_spell-1_$0_spellname}](~selected|repeating_spell-1_$0_spell) }}{{ 2nd (SLOTS) = [@{selected|repeating_spell-2_$0_spellname}](~selected|repeating_spell-2_$0_spell) }}{{ 3rd (SLOTS) = [@{selected|repeating_spell-3_$0_spellname}](~selected|repeating_spell-3_$0_spell) }} Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:8.0pt; mso-para-margin-left:0in; line-height:107%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}
1631332555
GiGs
Pro
Sheet Author
API Scripter
This isnt a general help thread. You should create a new thread for that question (where I'll point you to the Universal Chat menu script).
1631584294

Edited 1631636165
Displaying Images Based On Roll Results A simple trick to conditionally display images, but it may require a little setting up. Prerequisites File Hosting Service -&nbsp; You'll need some degree of control over image URLs. I use an&nbsp; Amazon S3 Bucket &nbsp;for this trick. Images -&nbsp; Need to be of the same file type. Their filename format should be something like "[x]", where x is the associated roll result. The images need to be uploaded to the same folder in the hosting service. For this example, after uploading we have the following image URLs: <a href="https://not-real.fake.com/some-folder/[" rel="nofollow">https://not-real.fake.com/some-folder/[</a> 1 ].gif <a href="https://not-real.fake.com/some-folder/[" rel="nofollow">https://not-real.fake.com/some-folder/[</a> 2 ].gif <a href="https://not-real.fake.com/some-folder/[" rel="nofollow">https://not-real.fake.com/some-folder/[</a> 3 ].gif <a href="https://not-real.fake.com/some-folder/[" rel="nofollow">https://not-real.fake.com/some-folder/[</a> 4 ].gif Since the only difference between these URLs is the roll result, we can select one randomly by rolling a d4 for the x value: [random image](<a href="https://not-real.fake.com/some-folder/[[[1d4]]].gif" rel="nofollow">https://not-real.fake.com/some-folder/[[[1d4]]].gif</a>) We can also use a bigger dice size: [random image](<a href="https://not-real.fake.com/some-folder/[[[ceil(1d100" rel="nofollow">https://not-real.fake.com/some-folder/[[[ceil(1d100</a> / 25)]]].gif) Application We can use this trick in conjunction with the&nbsp; Reusable Rolls &nbsp;trick in templates. For this example, we have the following template: &amp;{template:default} {{name=Buff}} {{amount=[[1d4]]}} We can use the links from the first example to display images based on the roll result: &amp;{template:default} {{name=Buff}} {{[img](<a href="https://not-real.fake.com/some-folder/[[[1d4]]].gif" rel="nofollow">https://not-real.fake.com/some-folder/[[[1d4]]].gif</a>)}} {{amount=$[[0]]}} As an optional step, we may utilize another trick to&nbsp; overwrite template fields &nbsp;in order to show the image last: &amp;{template:default} {{name=Buff}} {{amount}} {{[img](<a href="https://not-real.fake.com/some-folder/[[[1d4]]].gif" rel="nofollow">https://not-real.fake.com/some-folder/[[[1d4]]].gif</a>)}} {{amount=$[[0]]}} Advanced Application We can add some variance to the previous example by associating multiple images with every roll result. First, we need a filename format that supports multiple parameters. We can expand the filename format from the first example to "[y]_[x]", where x is (still) the associated roll result. y indicates which image variant should be displayed. Assuming we're using the same files from the first example, our image URLs should now be: <a href="https://not-real.fake.com/some-folder/[" rel="nofollow">https://not-real.fake.com/some-folder/[</a> 1 ]_[1].gif <a href="https://not-real.fake.com/some-folder/[" rel="nofollow">https://not-real.fake.com/some-folder/[</a> 1 ]_[2].gif <a href="https://not-real.fake.com/some-folder/[" rel="nofollow">https://not-real.fake.com/some-folder/[</a> 1 ]_[3].gif <a href="https://not-real.fake.com/some-folder/[" rel="nofollow">https://not-real.fake.com/some-folder/[</a> 1 ]_[4].gif Next, we upload some variant images for every roll result. For simplicity, we will use two variants for every roll result, so we only need to upload 4 more images. Their URLs: <a href="https://not-real.fake.com/some-folder/[" rel="nofollow">https://not-real.fake.com/some-folder/[</a> 2 ]_[1].gif <a href="https://not-real.fake.com/some-folder/[" rel="nofollow">https://not-real.fake.com/some-folder/[</a> 2 ]_[2].gif <a href="https://not-real.fake.com/some-folder/[" rel="nofollow">https://not-real.fake.com/some-folder/[</a> 2 ]_[3].gif <a href="https://not-real.fake.com/some-folder/[" rel="nofollow">https://not-real.fake.com/some-folder/[</a> 2 ]_[4].gif Now we just need to update the macro from the first example to randomly select one of the two variants by flipping a d2 for the y value: [random variant](<a href="https://not-real.fake.com/some-folder/[[[1d2]]]_[[[1d4]]].gif" rel="nofollow">https://not-real.fake.com/some-folder/[[[1d2]]]_[[[1d4]]].gif</a>) Note that the y value precedes the x value in our macro, so only the x dice will have a 3d animation (which works well for this example). We can add this macro to the template from the previous example: &amp;{template:default} {{name=Buff}} {{amount}} {{[img](<a href="https://not-real.fake.com/some-folder/[[[1d2]]]_[[[1d4]]].gif" rel="nofollow">https://not-real.fake.com/some-folder/[[[1d2]]]_[[[1d4]]].gif</a>)}} {{amount=$[[1]]}} What's Next? We were able to conditionally display images based on roll results and math, but that's only one method of utilizing this trick. While we focused on generating image filenames, we were also generating URLs, and URLs can offer more than just statically hosted images. What if we used the same approach, but instead of hosting our files statically we used a dynamic backend service? Being able to process requests (URI and parameters) using backend code before serving images would solve some of this trick's shortcomings (reusing images, using different file types...). We could even generate SVG images for requests on the fly to simulate custom templates/styles: [custom buff](<a href="https://not-real.fake.com/custom-buff?q=r1=[[[d4]]],r2=[[[d4]]]#.png" rel="nofollow">https://not-real.fake.com/custom-buff?q=r1=[[[d4]]],r2=[[[d4]]]#.png</a>) Thanks for reading, I hope you find this trick useful.
1631594858
Oosh
Sheet Author
API Scripter
Nice work! I never did get around to writing that one up, and this goes into more detail than I would have done anyway :) One thing I would add: if you have a GIF with a limited number of loops, and you want it to refresh each time instead of the using the cached image (which will be stuck on the last frame) you can just add another randomish roll as a parameter. So this: [link](fake-image-host.com/ooshpics/loop3times.gif) becomes this: [link](fake-image-host.com/ooshpics/loop3times.gif?[[[1d100]]]#.gif) Nothing needs to be done to the original file. You do still have a chance of grabbing a cached version using this, so if it's an animation that gets spammed, you'll need a bigger number or a multiplication to increase the pool.
1631636600

Edited 1631636818
That's a good point and a nice trick! Another approach would be to use the tracker on a shared character (called Parameters in this example): [[[ 1 &amp;{tracker:+} ]]](#" style="display: none)[link](<a href="http://fake-image-host.com/fnuxgifs/loop3times.gif?@{tracker|Parameters}#.gif" rel="nofollow">http://fake-image-host.com/fnuxgifs/loop3times.gif?@{tracker|Parameters}#.gif</a>) For the tutorial, I was able to set the response headers to prevent roll20 from caching specific images: cache-control: no-store, no-cache, must-revalidate ofc this can also be achieved using a dynamic backend service as detailed in the final section.
Miles said: I don't know if this is useful, but I've come up with a macro that allows a DM to do the common rolls that would go behind the screen, such as perception, investigation etc. You select the token and click the macro button. It looks like this. The fomula for it is: &amp;{template:default} {{name=**GM doing secret roll for @{selected|token_name}**}} /w gm &amp;{template:default} {{name= @{selected|token_name}}} &amp;{template:default} {{perception = [[d20+[[@{selected|perception_bonus}]]]]}} &amp;{template:default} {{Investigation= [[d20+[[@{selected|investigation_bonus}]]]]}} &amp;{template:default} {{Insight= [[d20+[[@{selected|Insight_bonus}]]]]}} &amp;{template:default} {{Stealth= [[d20+[[@{selected|Stealth_bonus}]]]]}}&nbsp; Thank you for this!
Roll Queries -- Advanced Usage for 4th Edition( &nbsp;Sorry 5e guys, this probably won't help you.) Avoiding duplicate queries for handling crits in 4E The Issue: Many conditional damage bonuses exist, and a lot of them add additional damage in the form of extra dice rolling rather than a straight number.&nbsp; While roll queries are great for this and are often used for just that purpose, an issue arises when there is a critical hit in 4E.&nbsp; Critical hits in 4E maximize all dice rolls that would have been rolled, including the conditional/optional ones.&nbsp; Let's look at a roll query that handles a rogue's sneak attack as an example.&nbsp; In this example, the rogue's basic attack deals 2d4+5 damage. 2d4 + 5 + ?{Use Sneak Attack on the target?|No, 0|Yes, 3d6} Now we use this in the game.&nbsp; The rogue attacks, and as part of the attack, clicks "Yes" when the roll query pops up.&nbsp; Now, the system will roll 2d4+5+3d6.&nbsp; Ok good.&nbsp; But what if the player got a nat 20?&nbsp; At the moment, the game does not have a way detecting a critical hit AND then altering how math is handled.&nbsp; The reason is because all dice are rolled simultaneously, attack-damage together.&nbsp; So by the time it knows that a crit has been rolled, it's too late, the damage has already been rolled as well and cannot be modified further.&nbsp;&nbsp; One thing we can do, is include an extra clause in parentheses or on a new line that gives the figures for critical damage in case we need them, like this: "The target takes [[2d4+5]] damage (or [[13]] damage on a crit)." Ok great. By including the extra clause in parentheses, we can manually calculate in advance what the maximum damage would be, and easily reference the critical damage when we need to.&nbsp; When a crit happens, we just ignore the initial damage roll result it gives and defer to the crit info. However, the fact that we have to manually calculate and input the damage of a critical hit IN ADVANCE , means that we cannot respond to changing damage dice and other such conditional or optional bonuses.&nbsp; Let's replace the simple "2d4+5" in the above example with the full&nbsp; roll query &nbsp;version of sneak attack once more and see what happens with a crit... "The target takes [[2d4 + 5 + ?{Use Sneak Attack on the target?|No, 0|Yes, 3d6}]] damage (or [[13 + ?{Use Sneak Attack on the target?|No, 0|Yes, 3d6}]] damage on a crit)." The player once again choses "yes", and gets a crit.&nbsp; The output might end up like this... "The target takes 21 damage (or 25 damage on a crit)." Doesn't the crit damage seem kinda low?&nbsp; It is.&nbsp; 2d4 maxed becomes 8... then add 5, ... then 3d6 maxed becomes 18, so&nbsp; &nbsp; 8+5+18 should be 31.... so why does it show 25?&nbsp; It's because the system just rolled the 3d6, it didn't maximize them. Okay, so why don't we just manually write "18" in the second roll query above (regarding the critical damage) to read like this? "........(or [[13 + ?{Use Sneak Attack on the target? | No, 0 | Yes, 18 }]] damage on a crit)." Well....while that seems logical, sorry, no.&nbsp; We can't do that.&nbsp; &nbsp;We're using the exact same Question --&nbsp; "Use Sneak Attack on the target?"&nbsp; --- which means when it asks you about it the first time, it will store that in memory as "3d6" when you answer "yes".&nbsp; Any further repetitions of the EXACT same roll query will default to the result of the first instance of the roll query, so again, "3d6".&nbsp;&nbsp; To put this in other words, the system only cares about the very first response that it got, and associates all future queries (of the same question) with the value tied to that first response.&nbsp; So even if we have something like this: [[13 +?{Use Sneak Attack on the target? | No, 0 |&nbsp; Yes, 3d6 } +?{Use Sneak Attack on the target? | No, 0 |&nbsp; Yes, 1d10 } +?{Use Sneak Attack on the target? | No, 0 |&nbsp; Yes, 18 } +?{Use Sneak Attack on the target? | No, 0 |&nbsp; Yes, -14 } ]] The system won't even look at that 1d10, 18 or -14.&nbsp; If you responded with "yes" on the first one, you wouldn't be asked a second, third or fourth time, and the computer will handle it something like this: 13 + ? (ask player to decide) --&gt; player says yes&nbsp; --&gt; 3d6... (rolling.... [1][5][3].... total = 9) + (repeated question-skip it, copy/paste 9) + (repeated question-skip it, copy/paste 9) + (repeated question-skip it, copy/paste 9) Output = 49 (Small note here, I'm not actually sure if the system stores the result of the first roll or the dice formula for the first roll... it might copy/paste 3d6/3d6/3d6... but in either case it's irrelevant, it won't maximize damage.) SO!&nbsp; This means if we want to handle critical rolls dynamically so that they can fluctuate and adjust to conditional bonus die rolls, we would have to double up and write entirely new questions about criticals that the system will ask us about, and apply separately, from the normal damage rolls like this: "The target takes [[2d4 + 5 + ?{Use Sneak Attack on the target? (for normal damage) |No, 0|Yes, 3d6}]] damage (or [[13 + ?{Use Sneak Attack on the target? (for crit) |No, 0|Yes, 18}]] damage on a crit)." This can get really tedious in game because you get a barrage of DOUBLE the number of pop-up questions that ALL must be answered due to all the redundancy.... Use sneak attack on the target for normal damage? Me: Clicks yes. Use sneak attack on the target for critical damage? Me: Clicks yes. Activate your swords fireburst effect for normal damage? Me: Clicks yes. Activate your swords fireburst effect for critical damage? Me: Clicks yes....&nbsp; *sighs* Well my friends, there IS a better way.&nbsp; &nbsp; Math can do some sneaky things with 1's and 0's...&nbsp;&nbsp; Any number multiplied by 0 is 0.&nbsp; &nbsp;Any number multiplied by 1 is itself.&nbsp; Using these two facts, order of operations and the mathematical "ceil" function built into the system (ceil is short for ceiling, which means "round up"), we can do this in the critical clause..... +(18*ceil(?{Use Sneak Attack on the target?|No, 0|Yes, 3d6}/18)) Can you see what this does?&nbsp; Take a moment to try and pick it apart. Like onion layers, let's start from the innermost brace/parentheses layer and resolve this from the inside out. First, let's assume the player chose "no".&nbsp; &nbsp; &nbsp;In this case, the roll query resolves to "0", since No = 0.&nbsp; This gives us... +(18*ceil(0/18)) the next inner onion layer is (0/18).&nbsp; This also resolves to 0, bringing us here... +(18*ceil(0)) next we have to do the rounding up operation "ceil(0)", since the system doesn't know what to multiply 18 with yet.&nbsp; 0 rounded up is still 0, since it's already a whole number...giving us... +(18*0) The asterix (*) is read as a multiplication sign by the system, so this just means 18 x 0.&nbsp; &nbsp;This, of course equals 0. So, the final result, when all is said and done, is... +0 This means that if a player responds with "no" the equation will resolve to 0, and nothing will be added.&nbsp;&nbsp; How about if they answer "yes"?&nbsp; Let's do that next. +(18*ceil(?{Use Sneak Attack on the target?|No, 0|Yes, 3d6}/18)) The player chose "yes", so the system will randomly roll 3d6, and get some number between 3~18, it doesn't matter what it rolls, so let's just say it rolled a total of 10.&nbsp; So that gives us... +(18*ceil(10/18)) Next, the division.... 10/18 is 0.5555555....repeating. So now we have.... +(18*ceil(0.55555555)) Next, we do the round up operation for ceil(0.5555555555), so&nbsp; we round that repeating 0.5555555 up to 1, giving us.... +(18*1) 18 x 1 is of course 18, so we have thus arrived at... +18 ...which is the maximized value of 3d6....a crit. The gist is, no matter what the computer rolls on that 3d6, if we divide that result by the maximum possible number it could have been (in this case 18), we will get a decimal that is less than 1, but greater than 0. &nbsp; We then round up to get 1.&nbsp;&nbsp; In doing this, we don't actually care what the computer rolls, we only care that it rolled at all-- because this means we must have selected "yes" on the roll query.&nbsp; If we selected "No", then nothing would have been rolled, and a 0 would result.&nbsp; So "Yes" gives us a 1, and "No" gives us a 0.&nbsp; We then take that 1 or 0, and multiply it by the number that we DO want... the value of a maximized roll. In this case, we want to add 18 more damage to a critical roll that had sneak attack, BUT add nothing (aka, 0) if no sneak attack was made. The important bits of the equation that you need to attach to the ends of your critical damage roll queries are highlighted below. + (18*ceil( ?{Use Sneak Attack on the target?|No, 0|Yes, 3d6} /18)) The number you insert (in this case, 18) must be the maximized value of the dice roll involved, so if it's 2d10, you'd replace those 18's with 20's.&nbsp; If it was 6d8, you'd replace them with 48's.&nbsp; By doing this, you force it to add either a 0 or the maximized value of the dice roll. Other examples using different die formulas: + (48*ceil( ?{Add super-stinky feet damage?|No, 0|Yes, 6d8} /48)) + (12*ceil( ?{Additional pie in the face damage?|No, 0|Yes, 1d12} /12)) NOW, you can use the same roll query wording for both normal AND critical damage, so there are no redundancies, and you only have to answer your roll query ONCE. TADA!
Very simple one. One of my characters is a hoarder and their inventory is quite large... to deal with that and make it a bit more manageable and organised, I use some unchecked, no weight items to act as headers/dividers to be able to categorise things.
Nice Trick Liam,&nbsp;&nbsp; I can see how it would have very similar applications in other sheets as well, like Pathfinder and Starfinder.&nbsp;&nbsp; Liam said: Very simple one. One of my characters is a hoarder and their inventory is quite large... to deal with that and make it a bit more manageable and organised, I use some unchecked, no weight items to act as headers/dividers to be able to categorise things.
OUTSTANDING!! Thank you! Miles said: I don't know if this is useful, but I've come up with a macro that allows a DM to do the common rolls that would go behind the screen, such as perception, investigation etc. You select the token and click the macro button. It looks like this. The fomula for it is: &amp;{template:default} {{name=**GM doing secret roll for @{selected|token_name}**}} /w gm &amp;{template:default} {{name= @{selected|token_name}}} &amp;{template:default} {{perception = [[d20+[[@{selected|perception_bonus}]]]]}} &amp;{template:default} {{Investigation= [[d20+[[@{selected|investigation_bonus}]]]]}} &amp;{template:default} {{Insight= [[d20+[[@{selected|Insight_bonus}]]]]}} &amp;{template:default} {{Stealth= [[d20+[[@{selected|Stealth_bonus}]]]]}}&nbsp;
Liam dedi ki: Çok basit bir tane. Bazı gösterişli kategorize ürünler için başlıklar/bücücük olarak hareket etmek için kontrolsüz, ağırlıksız pratik kullanımlar. . Good good ;)
Miles said: I don't know if this is useful, but I've come up with a macro that allows a DM to do the common rolls that would go behind the screen, such as perception, investigation etc. You select the token and click the macro button. It looks like this. This is very good. I have made two versions Secret &amp; Super Secret. The former is as written and the latter doesn't even tell the players who the rolls are for. This lets the players know something is up, but doesn't reveal NPC or monster names!
For Sheet Authors who are looking to reverse the value of two digits (specifically Warhammer Fantasy Roleplay in the example). &lt; button class = "debug" value = "&amp;{template:default} {{character-name=@{character_name}}} {{sl=[[ [[ floor(46*0.1) - floor([[ 100 - (100 - ([[ [[d10-1]][[d10-1]] ]]) % 100) ]] * 0.1) ]] ]]}} {{tens=$[[0]]}} {{units=$[[1]]}} {{roll=$[[2]]}} {{required=[[46]]}}" type = "roll" &gt; D100 &lt;/ button &gt; &nbsp; &nbsp; (The characteristic has been changed to 46 in two places to easily visualise what's going on). This will hopefully allow hit locations lookups to be drastically reduced to within ~100 lines, as below: &lt;!-- HUMANOID HIT LOCATION 0--&gt; &lt;div&gt;&lt;b&gt; {{#rollTotal() units 0}} {{#rollGreater() tens 0}}&lt;span&gt;Head&lt;/span&gt;{{/rollGreater() tens 0}} {{#rollTotal() tens 0}}&lt;span&gt;Right Leg&lt;/span&gt;{{/rollTotal() tens 0}} {{/rollTotal() units 0}} {{#rollTotal() units 1}}&lt;span&gt;Left Arm&lt;/span&gt;{{/rollTotal() units 1}} {{#rollTotal() units 2}} {{#rollLess() tens 5}}&lt;span&gt;Left Arm&lt;/span&gt;{{/rollLess() tens 5}} {{#rollGreater() tens 4}}&lt;span&gt;Right Arm&lt;/span&gt;{{/rollGreater() tens 4}} {{/rollTotal() units 2}} {{#rollTotal() units 3}}&lt;span&gt;Right Arm&lt;/span&gt;{{/rollTotal() units 3}} {{#rollTotal() units 4}} {{#rollLess() tens 5}}&lt;span&gt;Left Arm&lt;/span&gt;{{/rollLess() tens 5}} {{#rollGreater() tens 4}}&lt;span&gt;Right Arm&lt;/span&gt;{{/rollGreater() tens 4}} {{/rollTotal() units 4}} {{#rollBetween() units 5 7}}&lt;span&gt;Body&lt;/span&gt;{{/rollBetween() units 5 7}} {{#rollTotal() units 8}}&lt;span&gt;Left Leg&lt;/span&gt;{{/rollTotal() units 8}} {{#rollTotal() units 9}}&lt;span&gt;Right Leg&lt;/span&gt;{{/rollTotal() units 9}} &lt;/b&gt;&lt;/div&gt; This simply works by rolling the two dice separately, then concatenating the two results. {{character-name=@{character_name}}} {{ sl=[[ [[ floor(46*0.1) - floor([[ 100 - (100 - ([[ [[d10-1]][[d10-1]] ]]) % 100) ]] * 0.1) ]] ]] }} {{tens=$[[0]]}} {{units=$[[1]]}} {{roll=$[[2]]}} {{required=[[46]]}} The 100 - (100 - result % ) ensures the result is changed from between 00-99 to 01-100, though retains all (units, tens and roll) values.
1637386008

Edited 1637386054
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
For this, I'd simplify it even more and do it via custom roll parsing. Could make that roll template somewhere in the neighborhood of 6 lines. See Oosh's Adventures with StartRoll thread for more details.
I think this would qualify: a way to roll recharge abilities, whispering the result to the DM and setting an aura on the token that only the DM sees to remind them that the ability is available. It requires a pro-level subscription. If your combat is like mine, after your big baddie goes, you either forget to roll to recharge your ability, or by the time its turn comes back around, you've forgotten that it has the ability or forgotten if its charged, or whether or not you rolled for it, etc... So, after I make token actions for my baddies, I pop over to the attributes and abilities section and do the following: For the recharging ability itself I add this: !token-mod --set aura2_radius| and this: !power {{ --name|recharge --whisper|GM --Recharge|[[ [$REC] [NH] 1d6]] --?? $REC &gt;= 5 ?? Outcome:|Success --?? $REC &gt;= 5 ?? api_token-mod|_ids @{selected|token_id} _ignore-selected _set aura2_radius|5 }} Obviously if the recharge requires a different die roll, that's easy enough to&nbsp; do; replace the 1d6 with the appropriate roll and make sure that the condition for recharge is also the correct number. (In 5e its usually a d6 with a 5 or a 6 being sufficient to recharge.) You can add the second macro at the end of any other action (or part of an action) that you might have to take as an alternative. Sometimes I check the token's aura settings to&nbsp; make sure that the color is something that I like. Now you'll know if your Ancient Dragon can fire off that AOE breath weapon at a group of foolishly clumped up PC's or if you'll be forced to pick off stragglers with bites and claws, and your poor players won't know whether to group up or split up. Muah-ha-ha As a full example, here is my ancient white dragon abilities: Cold Breath %{-MgRg-qWYE3HcPUnQc81|repeating_npcaction_-MgRg0RUNc9Ea28xFef7_npc_action} /fx breath-frost !roll20AM --audio,play,track,nomenu|Creature Gurgle !token-mod --set aura2_radius| !power {{ --name|recharge --whisper|GM --Recharge|[[ [$REC] [NH] 1d6]] --?? $REC &gt;= 5 ?? Outecome:|Success --?? $REC &gt;= 5 ?? api_token-mod|_ids @{selected|token_id} _ignore-selected _set aura2_radius|5 }} and at the end of the Bite portion of the Multiattack: !power {{ --name|recharge --whisper|GM --Recharge|[[ [$REC] [NH] 1d6]] --?? $REC &gt;= 5 ?? Outecome:|Success --?? $REC &gt;= 5 ?? api_token-mod|_ids @{selected|token_id} _ignore-selected _set aura2_radius|5 }}
Reusing Rolls - Computed rolls and order independence With the addition of computed rolls comes new syntax to reference those rolls. So if you have a roll $[[0]] you can access the computed roll based on it via $[[0.computed]] additionally all rolls have a computed roll that defaults to the original roll. You can even use the ".computed" version without requiring a roll template at all. Referencing a roll in this way also doesn't interfere with nested rolls like a standard reference would. So while this breaks: $[[0]] plus $[[1]] equals [[ [[1d10]] + [[2d6]] ]] Using the .computed version allows it to work $[[0.computed]] plus $[[1.computed]] equals [[ [[1d10]] + [[2d6]] ]] This could also be used when Overwriting template fields in macros . Since the fields you overwrite have to be before the ones that do the conditional overwriting you wouldn't have previously been able to reference any of the rolls used in determining the decision but with this you can.
1638631061
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Damn! Nice find Rainbow!
1638651014
David M.
Pro
API Scripter
Sweet! That opens up a lot of options!
Keep Nth; Select from sequence One of the properties of a single sub-roll group roll is when using keep/drop mechanics rather than dropping the entire sub-roll it drops individual dice and those dropped dice become zero in the any calculation they are used in. We can use this to create roll pairs that act as gatekeepers to a given value. 1d1*(1-1d1) is 0 if both dice are kept or dropped, but is 1 if only the first die is kept. This can then be multiplied by any value to only return that value if the appropriate number of dice are kept. Multiple of these can then be added together in the same group roll to create any arbitrary sequence and the keep function used to select a single value. For example [[ { [[1]]*1d1*(1-1d1) +[[-1]]*1d1*(1-1d1) +[[2]]*1d1*(1-1d1) +[[-3]]*1d1*(1-1d1) +[[5]]*1d1*(1-1d1) +[[-8]]*1d1 }k[[1d6*2 -1]] ]] So the first number in the sequence is returned if you keep 1 die The second is returned if you keep 3, the third if you keep 5 and so on. With the Nth entry being returned if you keep (N*2 - 1). The actual values in the sequence can be anything and, as long as they are nested rolls, can even be other rolls. Notes: the final entry only requires the *1d1 since it doesn't need to zero out for the next entry the 1d1 can be replace by&nbsp; { {1} } &nbsp; to avoid crit/fumble colourings Now for some practical examples Cyberpunk Red crit/fumble [[{[[1-1d10]]*1d1*(1-1d1) +[[1d8+1]]*1d1*(1-1d1) +[[10+1d10]]*1d1 }k[[(1d10&gt;10f&lt;1+2)*2-1]] ]] RoleMaster open ended rolls [[{[[1d5-1d100!&gt;96]]*1d1*(1-1d1) +[[1d90+5]]*1d1*(1-1d1) +[[95+1d5+1d100!&gt;96]]*1d1 }k[[(1d100&gt;96f&lt;5+2)*2-1]] ]] Edit: Added details to clarify that single sub-roll drops individual dice and not the entire sub-roll. (As would happen in a multi sub-roll group roll)
Gatekeeper dice, crit/fumble colouring Expanding upon the idea of gatekeeper dice it becomes possible to use the crit/fumble colouring if the probability is moved into the group roll and the gatekeepers have well ordered values. For example the humble d20 [[ { [[1 fumble value]]*1d1cs0 + [[1d18+1 standard value]]*{ {1d20cs0cf0&gt;2f&gt;20*3} }/3 + [[20 crit value]]*1d2/2 }k1 ]] Only the highest gatekeeper (or first on ties) is kept so they have to 'switch off' with an appropriate probability making it more awkward to use. The standard value gatekeeper { {1d20cs0cf0&gt;2f&gt;20*3} } returns a 3 on a 2-19 otherwise returns 0 allowing a fall through to The crit gatekeeper 1d2 which returns a 2 half the time (after a standard value roll has been ruled out) otherwise a 0 since it gets dropped in favour of The fumble gatekeeper 1d1cs0 which always returns a 1 and is the last remaining possibility . Since only one roll gets kept any crit/fumble colouring that has is what gets displayed. Note: Rolls inside group rolls that aren't dropped immediately will show their colours even if the whole group gets dropped by an outer group later So the previous practical examples can be enhanced. Cyberpunk Red crit/fumble, now with colour! [[ { [[1-1d10]]*1d1cs0 + [[1d8+1]]*{ {1d10cs0cf0&gt;2f&gt;10*3} }/3 + [[10+1d10]]*1d2/2 }k1 ]] RoleMaster open ended rolls, now with colour! [[ { [[1d5-1d100!&gt;96]]*1d1cs0 +[[1d90+5]]*{ {1d100cs0cf0&gt;6f&gt;96*3} }/3 +[[95+1d5+1d100!&gt;96]]*1d2/2 }k1 ]]