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

how to format the description paramter in a query macro?

1661021374

Edited 1661022121
typically to get a more fancy output in the chat I have macros formatted like the following: /w gm &{template:npcaction} {{rname= Random Encounters}}{{name= Underdark }} {{description= Each day of travel through the Underdark, check twice to see if the characters encounter anything unusual: once while they are traveling, and again while they are camped or resting. 1-13 means no encounter, 14-15 means terrain, 16-17 means creatures, 18-20 meams both. Your result is [[1d20]]. If the Party is traveling: 1-2 means a narrow passageway, 3—4, means a standard passageway, S—6 means the encounter occurs in a large open area. Your Result is [[1d6]]. The terrain is (a) [[1t[Ch02-RE-Terrain-Types]]]. Any random encounter that occurs while the party is camped is automatically a creature encounter: [[1t[Ch02-CE-Creature-Types]]].}} Result is: Unfortunately as soon as I add them into a nested query the description seems to break the processing of the macro. Macro: ?{ Choose environment and Level |Upperdark,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= Upper Regions of the Underdark}} {{description= description= Each day of travel through the Underdark, check twice to see if the characters encounter anything unusual: once while they are traveling, and again while they are camped or resting. 1-13 means no encounter, 14-15 means terrain, 16-17 means creatures, 18-20 meams both. Your result is [[1d20]]. If the Party is traveling: 1-2 means a narrow passageway, 3—4, means a standard passageway, S—6 means the encounter occurs in a large open area. Your Result is [[1d6]]. The terrain is (a) [[1t[Ch02-RE-Terrain-Types]]]. Any random encounter that occurs while the party is camped is automatically a creature encounter: [[1t[Ch02-CE-Creature-Types]]]. }} |Underdark,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= The underdark, home of the Drows, Duergars, MIndflayers, etc}} {{description= Each day of travel through the Underdark, check twice to see if the characters encounter anything unusual: once while they are traveling, and again while they are camped or resting. 1-13 means no encounter, 14-15 means terrain, 16-17 means creatures, 18-20 meams both. Your result is [[1d20]]. If the Party is traveling: 1-2 means a narrow passageway, 3—4, means a standard passageway, S—6 means the encounter occurs in a large open area. Your Result is [[1d6]]. The terrain is (a) [[1t[Ch02-RE-Terrain-Types]]]. Any random encounter that occurs while the party is camped is automatically a creature encounter: [[1t[Ch02-CE-Creature-Types]]]. }} |Lowerdark,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= Deep Regions of the Underdark, home of the Aboleths}} {{description= description= Each day of travel through the Underdark, check twice to see if the characters encounter anything unusual: once while they are traveling, and again while they are camped or resting. 1-13 means no encounter, 14-15 means terrain, 16-17 means creatures, 18-20 meams both. Your result is [[1d20]]. If the Party is traveling: 1-2 means a narrow passageway, 3—4, means a standard passageway, S—6 means the encounter occurs in a large open area. Your Result is [[1d6]]. The terrain is (a) [[1t[Ch02-RE-Terrain-Types]]]. Any random encounter that occurs while the party is camped is automatically a creature encounter: [[1t[Ch02-CE-Creature-Types]]]. }} |The Deep,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= The utter Depths of the Underdark}} {{description= description= Each day of travel through the Underdark, check twice to see if the characters encounter anything unusual: once while they are traveling, and again while they are camped or resting. 1-13 means no encounter, 14-15 means terrain, 16-17 means creatures, 18-20 meams both. Your result is [[1d20]]. If the Party is traveling: 1-2 means a narrow passageway, 3—4, means a standard passageway, S—6 means the encounter occurs in a large open area. Your Result is [[1d6]]. The terrain is (a) [[1t[Ch02-RE-Terrain-Types]]]. Any random encounter that occurs while the party is camped is automatically a creature encounter: [[1t[Ch02-CE-Creature-Types]]]. }} |--------------------------------------, [[ 1t[-------------------------] ]] |Encounter Elements,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= Encounter Elements}} {{description=[[ 1t[Encounter-Elements]]] }} |Items and Trinkes,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= Lost Items and Trinkets}} {{description=[[ 1t[Item-Trinkets-Table]]] }} |Social Encounters,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= Social Encounters}} {{description=[[ 1t[Social-Encounters]]] }} |Travel Sceneries,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= Travel Sceneries}} {{description=[[ 1t[Travel-Scenery]]] }} |Wild Magic Zone,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= Wild Magic Zone}} {{description=[[ 1t[Wild-Magic-Zones]]] }} } result looks like the last chat entry: Am now terribly lost, and wonder what am missing, would it be possible at all? Any help is very welcome :)
I see two issues. 1, Upperdark has  {{description= description= But that's not specifically breaking anything. it'd just print the second one in the chat. Where your actual problem lies, is that you're not escaping any commas in the template to be printed. , Edit: To be more clear, the only unescaped commas should be the ones separating the query option from the output (like here:  |Upperdark , ) . The commas in the templates you want printed in chat must be escaped, just as the right curly brackets } are
Thanks for looking into it Crimson Decoded, the commas has been replaced by the escape characters, unfortunately  it is still not displayed  in the chat :/  ?{ Choose environment and Level |Upperdark,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= Upper Regions of the Underdark}} {{description= Each day of travel through the Underdark, check twice to see if the characters encounter anything unusual: once while they are traveling, and again while they are camped or resting. 1-13 means no encounter, 14-15 means terrain, 16-17 means creatures, 18-20 means both. Your result is [[1d20]]. If the Party is traveling: 1-2 means a narrow passageway, 3—4, means a standard passageway, S—6 means the encounter occurs in a large open area. Your Result is [[1d6]]. The terrain is (a) [[1t[Ch02-RE-Terrain-Types]]]. Any random encounter that occurs while the party is camped is automatically a creature encounter: [[1t[Ch02-CE-Creature-Types]]]. }} |Underdark,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= The underdark, home of the Drows, Duergars, MIndflayers, etc}} {{description= Each day of travel through the Underdark, check twice to see if the characters encounter anything unusual: once while they are traveling, and again while they are camped or resting. 1-13 means no encounter, 14-15 means terrain, 16-17 means creatures, 18-20 means both. Your result is [[1d20]]. If the Party is traveling: 1-2 means a narrow passageway, 3—4, means a standard passageway, S—6 means the encounter occurs in a large open area. Your Result is [[1d6]]. The terrain is (a) [[1t[Ch02-RE-Terrain-Types]]]. Any random encounter that occurs while the party is camped is automatically a creature encounter: [[1t[Ch02-CE-Creature-Types]]]. }} |Lowerdark,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= Deep Regions of the Underdark, home of the Aboleths}} {{description= Each day of travel through the Underdark, check twice to see if the characters encounter anything unusual: once while they are traveling, and again while they are camped or resting. 1-13 means no encounter, 14-15 means terrain, 16-17 means creatures, 18-20 means both. Your result is [[1d20]]. If the Party is traveling: 1-2 means a narrow passageway, 3—4, means a standard passageway, S—6 means the encounter occurs in a large open area. Your Result is [[1d6]]. The terrain is (a) [[1t[Ch02-RE-Terrain-Types]]]. Any random encounter that occurs while the party is camped is automatically a creature encounter: [[1t[Ch02-CE-Creature-Types]]]. }} |The Deep,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= The utter Depths of the Underdark}} {{description= Each day of travel through the Underdark, check twice to see if the characters encounter anything unusual: once while they are traveling, and again while they are camped or resting. 1-13 means no encounter, 14-15 means terrain, 16-17 means creatures, 18-20 means both. Your result is [[1d20]]. If the Party is traveling: 1-2 means a narrow passageway, 3—4, means a standard passageway, S—6 means the encounter occurs in a large open area. Your Result is [[1d6]]. The terrain is (a) [[1t[Ch02-RE-Terrain-Types]]]. Any random encounter that occurs while the party is camped is automatically a creature encounter: [[1t[Ch02-CE-Creature-Types]]]. }} |--------------------------------------, [[ 1t[-------------------------] ]] |Encounter Elements,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= Encounter Elements}} {{description=[[ 1t[Encounter-Elements]]] }} |Items and Trinkes,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= Lost Items and Trinkets}} {{description=[[ 1t[Item-Trinkets-Table]]] }} |Social Encounters,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= Social Encounters}} {{description=[[ 1t[Social-Encounters]]] }} |Travel Sceneries,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= Travel Sceneries}} {{description=[[ 1t[Travel-Scenery]]] }} |Wild Magic Zone,!rt /w gm &{template:npcaction} {{rname= Random Encounter}} {{name= Wild Magic Zone}} {{description=[[ 1t[Wild-Magic-Zones]]] }} } What is still preventing the output ?
Looks like you missed a few commas, right after the 3-4 for travel type for each of the first four lines If the Party is traveling: 1-2 means a narrow passageway, 3—4, means a standard passageway, I will admit, I don't have your roll tables, and even if I did, I don't have have the ability to use scripts, so I'm testing with a super simple roll table I made, and without being able to use recursive tables. But, after fixing those last 4 commas and removing the script prefix, it seems to work for me. And perhaps this may be unwarranted advice, so forgive me if you did not want it, but you can also use weighted roll tables for whether or not they get encounters and what they're travelling through. e.g. a rolltable with 13(65%) weight for "no encounter", 2(10%) for "terrain", 2(10%) for "creatures" and 3(15%) for "both" It would shorten your output, since it would only list what they find, not needing to list the options and still roll to determine which of the options happens.
Advice is always welcome, that is perfectly fine :)  There is always room for improvements and I will implement it for sure.  I have definitely a half dozen times looked through the text, and yet these nasty commas escaped me again, apologies. Yes and now it's working as expected. Because of the above I am so happy to not be a professional programmer :D  Thank you so much    Crimson Decoded