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

Macro Request: dropdown query that results in a card of info.

Hello,  I'm pretty new to using macros, so I'm hoping this is possible.  What I'm trying to do is make a macro where the player clicks a button and is asked "Strongest Stat?" and gets a dropdown of the standard abilities. Then when they select that they get asked "D20 roll?" and a dropdown 1-20, which each would present a separate card that looks like this (where dropdown 1 is Blacksmith, dropdown 2 is Miner... etc and they get all the info for just that occupation):   So far, I've only been able to figure out how to make the card show, but when I try to make a ? I end up with nothing even close to working.  My thinking was to make a macro for each occupation for a given ability, (all the Str on one, all the dex on one, etc) and have the "strongest stat" query pull up that macro for the info.  If someone could point me in the right direction to start, I can probably figure it out from there. If I'm asking too much of the program, I can figure out a different workaround, but I was hoping to get this to work.  Is anyone able to assist? 
Please post the current macro you have started. What game are you playing and what character sheet are you using?
This is what I had started, but it doesn't work. D&D 5e, regular sheet. &{template:default} {{name=?{Occupation| 1, Blacksmith {{Coin=[[d12]]sp}} {{Proficiency=smiths tools}} {{Weapon=hammer}} {{item=Smiths tools}} {{Clothes=Common}}| 2, Miner {{Coin=[[d20]]cp}} {{Proficiency=Investigation}} {{Weapon=Miners Pick}} {{item=Miner's Pick}} {{Clothes=Common}} 
This is a  Nested Query  issue. You’ll have to use html replacements to escape all vertical pipes, commas, and closing braces if you set up the query this way. I strongly suggest using a  Chat Menu  and/or  Macro Mule character  instead.  There will likely be better/easier (Mod script) ways to set up these tables, such as using the Muler script (since you have a Pro subscription).  I can take a longer look tomorrow on how to best set up a Macro Mule approach if that’s something you’re interested, or if you don’t get any other Mod script alternatives.  Separate from your question, you may be interested in using a Universal Statblock Macro Mule since you are playing D&D 5E, for making rolls and checking stats and so forth. 
I'll take a look, th anks!
I'm not really understanding how a Chat Menu or Macro Mule character is supposed to fix the situation? Clearly I'm not seeing what you are getting at with that suggestion. The players aren't using the character sheet. They make roll to determine their stats, and then a d20 roll will refer them to an occupation (based on whichever is their highest stat) which I want to display for them ideally with just one or 2 inputs from them.  When I use this: &{template:default} {{name=?{Occupation|1,Blacksmith|2,Miner|3,Teamster|4,Bodyguard|5,Plowman/woman|6,Rough|7,Butcher|8,Gladiator|9,Woodcutter|10,Carpenter|11,Milkman/Milkmaid|12,Executioner|13,Mercenary|14,Bone Carver|15,Mason|16,Grinder|17,Plattner(armorer)|18,Porter|19,Jailer|20,Wagoner}}} {{Coin=?{Occupation number|1,[[d12]]sp|2,[[d20]]cp|3,[[d8]]sp|4,[[d10]]gp|5,[[d10]]cp|6,[[d6]]sp|7,[[d10]]sp|8,[[d12]]gp|9,[[d6]]sp|10,[[d6]]gp|11,[[d8]]sp|12,[[d12]]sp|13,[[d12]]sp|14,[[d6]]sp|15,[[d10]]cp|16,[[d8]]sp|17,[[d8]]sp|18,[[d8]]cp|19,[[d4]]sp|20,[[d12]]cp}}] It produces   but the player has to input twice (Occupation and Occupation number) and it's not as clean as the full template. But if I make the query the same: &{template:default} {{name=?{Occupation|1,Blacksmith|2,Miner|3,Teamster|4,Bodyguard|5,Plowman/woman|6,Rough|7,Butcher|8,Gladiator|9,Woodcutter|10,Carpenter|11,Milkman/Milkmaid|12,Executioner|13,Mercenary|14,Bone Carver|15,Mason|16,Grinder|17,Plattner(armorer)|18,Porter|19,Jailer|20,Wagoner}}} {{Coin=?{Occupation|1,[[d12]]sp|2,[[d20]]cp|3,[[d8]]sp|4,[[d10]]gp|5,[[d10]]cp|6,[[d6]]sp|7,[[d10]]sp|8,[[d12]]gp|9,[[d6]]sp|10,[[d6]]gp|11,[[d8]]sp|12,[[d12]]sp|13,[[d12]]sp|14,[[d6]]sp|15,[[d10]]cp|16,[[d8]]sp|17,[[d8]]sp|18,[[d8]]cp|19,[[d4]]sp|20,[[d12]]cp}}] It produces this instead  which is not what I need.  I also tried the suggestion of " You’ll have to use html replacements to escape all vertical pipes, commas, and closing braces"   &{template:default} {{name=?{Occupation|1,Blacksmith|2,Miner|3,Teamster|4,Bodyguard|5,Plowman/woman|6,Rough|7,Butcher|8,Gladiator|9,Woodcutter|10,Carpenter|11,Milkman/Milkmaid|12,Executioner|13,Mercenary|14,Bone Carver|15,Mason|16,Grinder|17,Plattner(armorer)|18,Porter|19,Jailer|20,Wagoner}}}{{Coin=?{Occupation|1,[[d12]]sp|2,[[d20]]cp|3,[[d8]]sp|4,[[d10]]gp|5,[[d10]]cp|6,[[d6]]sp|7,[[d10]]sp|8,[[d12]]gp|9,[[d6]]sp|10,[[d6]]gp|11,[[d8]]sp|12,[[d12]]sp|13,[[d12]]sp|14,[[d6]]sp|15,[[d10]]cp|16,[[d8]]sp|17,[[d8]]sp|18,[[d8]]cp|19,[[d4]]sp|20,[[d12]]cp}}   And that didn't work at all.  I'm hoping someone can help clear up what I'm doing wrong. 
1703312781

Edited 1703312888
Gauss
Forum Champion
Hi DM Kaellie,  The problem is you are getting into Queries that extremely complicated HTML substitution due to what you are trying to put into them. That is not recommended. Most experienced folks won't even go that route anymore due to the problems involved.  Chat Menus are a completely different way of doing things that generally do not involve HTML substitution. It is a vastly simpler solution to write and can do just about anything a query can do, just in different ways.  So lets go back to the beginning, not worry about what you have done so far, and get at the heart of what you are trying to accomplish.  I'd like you to pretend you are at a kitchen table, no computer. Please walk me through the the steps of how your system works, step by step.  Where a Macro Mule comes into it is it streamlines the macro storage. Many folks use the Collection tab Macro system, which for macros like this can be bad (for a number of reasons, the primary reason being a problem HTML substitution but there are others).  Ability macros are generally better, but to avoid doing them over and over on every player's Character a Macro Mule is useful. 
Sure, the process I was trying to create/recreate was  1) Roll a d20. 2) Tell the macro what your best stat is. 3) Tell the macro what you rolled on a d20. 4) The macro gives you occupation + starting equipment. I reached out to another friend, who suggested instead 1) Tell the macro your best stat. 2) Macro rolls a d20 and returns the occupation + starting equipment. He suggested I try RecursiveTable API, which I'm hoping will work.
It worked exactly how I wanted! Moderators how do I close a post?