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

Help with Recursive's Script

I am trying to figure out how to make a Macro that does a random roll to choose another Macro which has the rolltable in it. This is for a loot table in my 5e campaign, I have written out multiple rolltables for that and I have Macros that choose the specific rolltables I want to use. I have figured out how to use multiple Macros in another Macro but I need to be able to have it choose between, lets say three, different at random. I am sorry if I repeated myself, I have been at this for about 6 hours and my eyes are glazed over honestly. Thank you in advance for any and all help, even if it is just to tell me that it is impossible.
What are your table names? What is the macro you’re using?
Okay so this one will be a bit long, but here we go. The Macro I am trying to make is call Basic-Loot and the code I have for it right now is #Loot-common #Loot-uncommon I was learning all about Macros in just those 6 hours, I never messed with them before and the last time I used anykind of Syntax language was 12 years ago when I was making websites for people. The Macro Loot-common code looks like this !rt [[ 1t[common-loot] ]] , [[ 3t[common-coin] ]] I tried copy pasting the code in game that gave Headers and boxes to it but it wouldn't work properly for some reason so I abandoned that Idea because this worked. The Loot-uncommon Macro is the exact same except the tables say uncommon instead of common. Now that I am awake and rested I will be trying to look and see how I can make this work, help is still appreciated though.
Jarren said: What are your table names? What is the macro you’re using? I totally forgot to quote you I am sorry. Still have made zero progress on this, I might just have to give up.
1651432168
GiGs
Pro
Sheet Author
API Scripter
Standard macros cant have rolls from one table causing rolls on another. No recursive behaviour is possible. As a Pro user, you have access to Aaron's Recursive tables script which gets around this issue.
1651493878
The Aaron
Roll20 Production Team
API Scripter
Are you getting any output at all?  What version of RecursiveTable does it say you have in the API Console output?
The Aaron said: Are you getting any output at all?  What version of RecursiveTable does it say you have in the API Console output? It says the latest version, when I open the list the highest is 2.5.
1651560043
The Aaron
Roll20 Production Team
API Scripter
Are you getting any sort of output?
The Aaron said: Are you getting any sort of output? The only kind of output I have reached is it being able to roll multiple Macros at once, I have made zero progress on trying to get it to randomly choose 1 macro.
The Aaron said: Are you getting any sort of output? Hey Aaron, have you made any progress? I swear it seems like I'm almost using the wrong language of code or something because nothing seems to be working.
If I'm understanding you correctly, you need to make several tables: common-loot common-coin uncommon-loot uncommon-coin etc. You want to have macros that will combine all of the 'common' tables into a single output, 'uncommon' into a single output, etc.: #Loot-common !rt [[ 1t[common-loot] ]] , [[ 3t[common-coin] ]] #Loot-uncommon !rt [[ 1t[uncommon-loot] ]] , [[ 3t[uncommon-coin] ]] And you want another macro that will randomly select which 'level' of loot to roll, such as common, uncommon, etc.? Then you'll need another table: loot-rarity #Loot-common #Loot-unommon Etc. Then you should only have to create a single macro that is rolling on the 'Loot-rarity' table, and will recursively roll on subsequent 'Loot-common' tables: !rt [[ 1t[loot-rarity] ]]
Jarren said: If I'm understanding you correctly, you need to make several tables: common-loot common-coin uncommon-loot uncommon-coin etc. You want to have macros that will combine all of the 'common' tables into a single output, 'uncommon' into a single output, etc.: #Loot-common !rt [[ 1t[common-loot] ]] , [[ 3t[common-coin] ]] #Loot-uncommon !rt [[ 1t[uncommon-loot] ]] , [[ 3t[uncommon-coin] ]] And you want another macro that will randomly select which 'level' of loot to roll, such as common, uncommon, etc.? Then you'll need another table: loot-rarity #Loot-common #Loot-unommon Etc. Then you should only have to create a single macro that is rolling on the 'Loot-rarity' table, and will recursively roll on subsequent 'Loot-common' tables: !rt [[ 1t[loot-rarity] ]] This is correct, I just can't get it to choose and roll the different Macros, it says no table found with that name when I try to troll it specifying a macro but if I try to set it so the rolltable rolls the macro it just says #loot-rarity. I am really thinking that this is too complex or impossible with the limitations of roll20 macro script. Thank you for helping though.
1651932911
The Aaron
Roll20 Production Team
API Scripter
It's a little hard to parse without concrete examples, but are you saying your table rows contain macro references? Can you post a screenshot of the tables you're rolling on, and the command you're executing?
1651937949

Edited 1651938043
The Aaron said: It's a little hard to parse without concrete examples, but are you saying your table rows contain macro references? Can you post a screenshot of the tables you're rolling on, and the command you're executing? There you go, I hope it helps the current result of testing Loot-Rarity is  No table found with that name!
You need to only put table names in the 1t[Table-Name]  not the macro name.  it won't call the macro when it is looking for a table. if that makes sense.