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

Macros & Rolling Tables. How to get if X then Y?

Hey there! I'm wondering if it's possible for a macro that calls on a table to "check" the result and then roll again from other tables? I've installed Recursive Tables by Aaron, though if I'm honest I'm a massive noob and have no idea what I'm doing beyond surface level stuff. I'm attempting to make a random character generator for 5e d&d. I've currently got two macros. One that pulls from 3 tables (race, class, and background) and outputs them. (Might end up having more in here.) !rt &{template:default} {{name=CharacterO'Mancer}} {{Race=[[1t[Race]]]}} {{Class=[[1t[Class]]]}} {{Background=[[1t[Background]]]}} And then a second one with a dropdown selection where you select a background and it fires the macro associated with that background. (Obviously haven't inputted all of the backgrounds yet)  !rt ?{Select Background|Acolyte,[Acolyte](!&#13#BAcol)|Anthropologist,[Anthropologist](!&#13#BAnthro)|Archaeologist,[Archaeologist](!&#13#BArcha)} The above triggers this macro. Gives basic info about the background, with a couple buttons in that will generate more info, such as your languages, characteristics, etc. &{template:default} {{name=Background: Acolyte}} {{Proficiencies:=Insight, Religion}} {{Languages:=[Two of your choice](!&#13#Lang)}} {{Equipment:=A holy symbol (a gift to you when you entered the priesthood), a prayer book or prayer wheel, 5 sticks of incense, vestments, a set of common clothes, and a belt pouch containing 15 gp}} {{Feature:=[Shelter of the Faithful](!&#13#FAcol)}} {{Characteristic Generator:=[Acolyte](!&#13#CAcol)}} The characteristic generator looks like this. !rt &{template:default} {{name=***Characteristics: Acolyte***}} {{Personality: [[1t[AcolP]]]}} {{Personality: [[1t[AcolP]]]}} {{Ideal: [[1t[AcolI]]]}} {{Bond: [[1t[AcolB]]]}}{{Flaw: [[1t[AcolF]]]}} I'm intending to do the same for races that have sub-races, and maybe also classes and their sub-classes. I'm wondering if it's possible to do away with the second macro and just incorporate it all into the "Character O'Mancer". So you roll it and it gives you "Elf, Cleric, Acolyte" and then it either automatically populates the Elf sub-race, the specifics of the background and rolls for it's characteristics, OR  it just turns "Elf" and "Acolyte" into buttons that you can click and it then generates it. I'm fairly sure that something like this is possible, at least from what I've read and my limited understanding. Though again, I have no idea what I'm doing. I'm also using the link feature added by   Recursive Tables  (my god do I love it), to link to the race, class, background, etc. I'm wondering if there's a way to make it more clear that it's a link, like colouring it a different colour, or giving it an underline (or both).  Thank you in advance for any and all help that you are able to give me! This has kinda gone beyond I need this, to I know it's possible and I can't sleep until I get it perfect even though I'm the only one who will care about it...
1661453923

Edited 1661455737
I've tried [Acolyte](!&#13#CAcol )  Within the table itself, and while it does turn into a button when rolled, it doesn't execute the #CAcol macro it just outputs !&#13#CAcol
Okay I've somehow managed to make it work so that the generated background will display as a button. I would like for it all to be in one big text box, auto populate, or just look cleaner in general, so if there are any smarter people who know better please still chime in! It would be incredibly appreciated! For those like me in the future. Background Table: [Acolyte](!
#BAcol) - #BAcol is a macro that randomly generates a set of characteristics from the Acolyte background Macro: !rt &{template:default} {{name=CharacterO'Mancer}} {{Race=[[1t[Race]]]}} {{Class=[[1t[Class]]]}} {{Background=[[1t[Background]]]}} - You NEED !rt for the button to display.
1661831717
timmaugh
Pro
API Scripter
Going to start off the top saying that a dedicated, custom build solution would be best for this. That said... Sooo... I'm not an expert on recursive tables, but Muler & ZeroFrame are metascripts that are capable of this sort of magic, too. Muler creates lists of variables in key=value pairs. You can think of the mules as static-access tables -- where Roll20 gives you rollable (random) tables, Muler gives you dictionary style retrieval (which you can randomize various ways). ZeroFrame passes over your command line in cycles of the other metascripts you have installed (like Muler). If anything changes, it gives the metascripts time to take action, if they need to. That means you could randomly draw an Elf, Cleric, Acolyte... ...which you use in the Background Mule to return more verbiage... ...any of which might then reference a Mule for Characteristics... ...or languages... skills... proficiencies... Every retrieval from a mule could return more command syntax to the line and have it continue to process, until it eventually output your resulting character. 
1661841913
Julexar
Pro
API Scripter
It honestly might be easier to create a script for this that has some macro buttons that do what you want. But the Solution from timmaugh would work too.