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

Creating a Rolltable that Rolls Dice

1559509135
Julien De Lucca
Pro
Marketplace Creator
Hello everyone, I'm kinda new to macros in Roll20 and even after reading the wiki I could not find a way to compare values. What I mean is that I wanna automate the roll tables from the D&D Dungeon Master Guide for treasures, but it needs to first roll a D100, compare the value rolled and then roll a table or another macro that rolls for Gold Pieces. For those that have DMG 5e, I mean the roll tables on page 136. It should roll 1d100, and if its (as an example for CR17 Individual Treasure) 01-15 it should then roll 2d6x1000 EP and 8d6x100 GP. If it has magic itens it would also pull the name from a rolltable (that I'll use with weighted options to simulate the D100 roll). Can anyone help me? Thanks!!
1559509280
The Aaron
Roll20 Production Team
API Scripter
That isn't possible without an API script.&nbsp; As it happens, I wrote RecursiveTable for this exact case:&nbsp; <a href="https://app.roll20.net/forum/post/5954076/script-update-recursivetables-now-with-rollable-table-images-and-better-prefixing-rules-for-roll-templates" rel="nofollow">https://app.roll20.net/forum/post/5954076/script-update-recursivetables-now-with-rollable-table-images-and-better-prefixing-rules-for-roll-templates</a> Cheers!
1559584862
Julien De Lucca
Pro
Marketplace Creator
Dude, this is effing awesome! I just spent 3 hours messing with macros and using your API. This is fantastic! Thank you oh so very much!!
1559596805
The Aaron
Roll20 Production Team
API Scripter
No problem. =D&nbsp; Let me know if you have any other pain points, I've written a few scripts to help people out. =D
1559619520
Julien De Lucca
Pro
Marketplace Creator
Roger that! And I didnt want to bother you, but since you asked, I've got a couple of questions: 1) Im using the following script for my "Treasure Hoard - Small" macro which is supposed to list a small amount of money and itens for my 7th level players. (Im brazilian so everything is in portuguese, Moedas = coins, Gemas = duh! gems hehehe, Objetos de Arte = Art Objects) !rt[Delimiter:BR|EmptyDefault:Nada] /w gm &amp;{template:default}{{name=Loot}} {{Moedas=[[40d6*10]]sp e [[10d10*10]]gp}}{{Gemas=[[1t[THoard1Gems]]]}}{{Objetos de Arte=[[1t[THoard1Art]]]}}{{Itens Mágicos=[[1t[THoard1Magic]]]}} And on my rolltables I have the rolls I want them to make, recuring other tables through your fantastic API, using multiple rolls with weighted values: As you can see, the highlighted option rolls on 3 different tables to gimme a result on the macro above. However, even with delimeter set to BR, it does not jump a line when I have multiple rolls on the same table value: In this case, since all 3 values are on the same table option, it just gives me a space (obviously) and then sets the other itens one per line. Any way to work around this? 2) I was thinking on the cleverest or most non-moronic way of replicating the rolltable for the DMG treasure hoard: How would you do this? Because I need a table with the weighted options (to simulate the d100 roll) and then it needs separate rolls on the gems table + a separate roll on the magic item table. Which means I cannot just create a table that will have a GEM+Nothing or GEM+MAGICITEM on the rolltable option because it wouldnt split them up on the template above. I know I can do exactly that I just mentioned and it would gimme a feedback on the same line, separated by commas, but not neatly spread as my template shown. Any ideas? Thanks a lot for your attention and support. I noticed you wrote that script YEARS ago and R20 should have implemented this as default. So, really, thanks for giving answers to noobs such a long time after the original idea. JDL
1559622979
The Aaron
Roll20 Production Team
API Scripter
For 1), it's likely because they are all part of a single entry from the point of view of the script. You could try replacing the spaces between the items on that row with: &amp;#13; And see if that splits them across lines in the final output. I'll have to try that out as it's been a while since I used the script. For 2), I'd probably duplicate the coins part on each row of the lower table, so 1-6 would be just the coins, 7-16 would be the coins plus the gems, 17-26 would be the coins plus the art objects, etc.&nbsp;