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

I need Help with recursive macros doing several things

I’m trying to automate foraging in D&D 2014 character sheets using the rules from the Complete crafter. He has tables that I can set up no problem but all the other stuff is over my head. So, here’s what I want it to do. Player selects their token then hits the forage button. Roll20 then ask them what terrain they are in, forest, swamp, mountain, Ect. (That’s the tables I have) Then it prompts if the roll is made with advantage,  Then it ask what skill they are using for this check. Nature or survival.  Using this information it makes the appropriate roll checks it against a DC 15 and responds with either “You fail to find anything useful” or Sucess and roll the appropriate table to display “ You found 2d4+skill mod used in the check berrys”  I’m to old to learn where all the (,[&#* go, thanks In Advance
1753378668
Gauss
Forum Champion
Hi Isaac,  Please post the macro you have currently. 
1753384594

Edited 1753384796
I don't have a lot to work with.  This one points to the region macros &{template:default} {{name=Forage}} {{Select Region= [Forest](!
 #Forest) [Cave](!
 #Cave) [Dessert](!
 #Dessert)}}  this is an example of a region that points to the tables !rt &{template:default}{{name=Forest}}{{You Found=[[1t[Forest]]]}} that's my output I just dnt know how to add all the other stuff
1753387205
GiGs
Pro
Sheet Author
API Scripter
Roll20 macros cat handle conditional tests, like asking what terrain it is, whether advantage is used,etc. The only way to do this wih a standard macro is to generate  every single  possible roll that  might  needed (like check for all terrains, with and without advantage, etc.) then hide all the rolls you don't need. If you're separation the terrains out into separate macros that helps a lot.
1753387514
Gauss
Forum Champion
It looks like you are using an API Script, which one are you using? 
1753387674

Edited 1753387688
Gauss
Forum Champion
GiGs, it looks like they are using Chat Menu buttons to select the terrain, then it rolls a Rollable Table with an API Script which is probably handling the rolls from inside the Rollable Table.  What I think they want is to add to that a skill check with a text output. That is fine, it can be added to each terrain type. I just need to verify which API Script is being used so as not to trip over it. 
it is the RecursiveTable script
1753396080
Gauss
Forum Champion
Ok, thanks.  So you should be able to do this:  !rt &{template:default} {{name=Forest}} {{You Found=[[1t[[[{[[?{Advantage?|Normal,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1}+?{Nature or Survival?|Nature,@{selected|nature_bonus}|Survival,@{selected|survival_bonus}}]],0}>15]]Forest]]]}} {{Dice Roll=$[[0]]}} Note: I also added a dice roll section so you can see what the roll was.  You will need to do the following to make this work:  1) Rename the "Forest" Rollable Table to "1Forest" (without quotes). 2) Create a Rollable Table named "0Forest" (without quotes). 3) In 0Forest create a single entry with the failure message you want as the name of that entry.  Repeat this process for the other terrain types.  Also, you will need to take the above macro and replace your existing Chat Menu macros with it. Replace "Forest" with the appropriate terrain name.  How this works.  This rolls the appropriate number of d20s, adds the bonus from the D&D 5e 2014 sheet that is associated with the selected token.  It then compares that to the target number.  On a success it is a "1" which is then the table 1Forest while on a failure it is a "0" which is then the table 0Forest. 
Awesome! Thanks so much. I'm away from my computer right now so ill have to test it later this evening
Ok, the test worked great when I ran the individual terrain macro but when I picked it from the list of terrain types macro it fails to roll the inline dice roll for the amount of items found.  see image 
1753409717

Edited 1753409772
Gauss
Forum Champion
Please send me an invite so I can come take a look. I was hoping I got around it but...apparently not. It will be easiest to test in your game so I don't have to set up Rollable Tables.
1753414105

Edited 1753414223
Gauss
Forum Champion
For anyone following, the problem was somewhere in the Collection Tab macro. I set up Isaac with a Macro Mule version instead since it is easier to get help for that than it is for Collection Tab macros. :) It should be working now.