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

NPC Generator Macro Help

Hello! I'm very new to making macros. I've been trying to convert a Google Sheets I made to macros. On the Google Sheet I would create large tables of names and descriptors then use a formula creating a random number that searched the table, returned the result, and concatenated all the results together into a sentence structure. I'm trying to replicate this same process and have run into an issue. I've created the rollable tables for all the descriptors. Here's the macro I have so far: /w gm &{template:default} {{title=NPC Generator}} {{Species=[[1t[Species]]]}} {{Gender=[[1t[Gender]]]}} {{Motivation=[[1t[Motivations]]]}} {{Name=[[1t$[[0]]-First-$[[1]]]] [[1t$[[0]]-Last]]]}} {{Description=A [[1t$[[0]]-Size]] and/yet [[1t$[[0]]-Build]] $[[0]], with [[1t$[[0]]-Skin/Scales]] Skin/Scales, [[1t$[[0]]-Beard/Hair-Style]] [[1t$[[0]]-Beard/Hair-Color]] Beard/Hair/Horns, [[1t$[[0]]-Eyes]] Eyes, [[1t$[[0]]-Features]] Features, a [[1t$[[0]]-Voice]] Voice, [[1t$[[0]]-Clothing]] Clothing, and a [[1t$[[0]]-Temperament]] Temperament.}} {{Quirk=[[1t[Quirks]]]}} {{Attitude Towards Party=[[1t[Party-Attitude]]]}} {{Motivation=$[[2]]}} It's returning results like this for the description: A [[1tTiefling-Size]] and/yet [[1tTiefling-Build]] Tiefling, with [[1tTiefling-Skin/Scales]] Skin/Scales, [[1tTiefling-Beard/Hair-Style]] [[1tTiefling-Beard/Hair-Color]] Beard/Hair/Horns, [[1tTiefling-Eyes]] Eyes, [[1tTiefling-Features]] Features, a [[1tTiefling-Voice]] Voice, [[1tTiefling-Clothing]] Clothing, and a [[1tTiefling-Temperament]] Temperament. I'm kinda at a loss at what to do next or if this is even solvable in a macro. I've been using Gemini to help me iterate and test but this is the farthest I've been able to get before it starts going around in circles. The process I need is essentially this: Roll a Species, Gender, and Motivation. Use those rolls to fill in the appropriate rollable table names and return the result in line with other text to form the description statement. Any help is appreciated!
1743438894
timmaugh
Forum Champion
API Scripter
First, don't use derivative AI. You've got a whole community here willing to help without resorting to a tech that likely didn't have rights to what it was trained on and which doesn't understand the Roll20 ecosystem. Second, these constructions: [[1tTiefling]] ...will break because they aren't referring to the "Tiefling" table. That would be: [[1t[Tiefling]]] So what you're trying to do (if you sent the first formation through) would produce a parsing error. Third, you can't reuse rolls like this in native Roll20 syntax: [[1t$[[0]]-Build]] ...even if you included the inner set of braces: [[1t[$[[0]]-Build]]] ...the parser doesn't understand references to other rolls in this way. This will also break. Finally, you can't natively expand returns from a table that also contain rolls. So if you have a table of entries and some of those entries have further inline rolls, those won't expand. You'll be left with the inline roll syntax in your table return, without having been resolved. There are ways to do what you want to do with either a more expansive table setup and/or with scripts. Any of RecursiveTables, the MetascriptToolbox, or ScriptCards can do this without much effort... but to get a better answer, you'd have to describe your table setup.
Thank you for your reply! I saw several mentions of ScriptCards in other places so I'll look into the scripts you've mentioned. That's a good point about Gemini that I didn't think of. Do you recommend any specific resources as a more comprehensive guide to learning the Roll20 syntax?
All the descendant tables are descendants of the initial race roll? You can do this scriptless with Inverse Overwrite, and with a two-step process to make it resolve faster: &{template:default} {{name=NPC generator [ ](#" hidden null=) }} {{[0]=[ ](#" hidden null=) }} {{[1]=[A tiefling, who is...](!/
 &{template:default} {{description=[[1t[tiefling-size]]] and/yet [[1t[tiefling-build]]], with [[1t[tiefling-skin/scales]]] skin/scales, [[1t[Tiefling-Beard/Hair-Style]]] [[1t[tiefling-Beard/Hair-Color]]] Beard/Hair/Horns...}}) [ ](#" hidden null=) }} {{[2]=Another race filled in like the one above [ ](#" hidden null=) }} {{[[[1d2-1]]]=[ ](#) }} I didn't fully fill it in, but you should get the picture and be able to modify it to your needs.