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

Roll query skill check macro problem

I know this has been asked a 1000 times before but I couldn't seem to find the reason why my macros didn't work in older posts so I thought I'd just ask. Whenever I use the following macro %{@{character_name}|?{Skill check?|Acrobatics|Athletics}} it outputs %{Name|Acrobatics} (or Athletics) but never actually 'rolls' the ability just pushes it out before rolling. I imagine this is to do with the order of operations of roll20, however, whenever I try to make a macro where the abilities come before the roll query, like so: ?{Skill check?|Acrobatics,%{@{character_name}|Acrobatics}|Athletics,%{@{character_name}|Athletics}} it doesn't work either, outputting just the characters name. I understand you can do a similar thing with command buttons, but I prefer roll queries and I didn't want to clog my chat. I'm probably being very stupid and the reasoning is obvious, so thanks to anyone who helps.
The problem is that you cannot nest an attribute call inside of an attribute call or ability call. You will need to use a proper keyword (selected, target, or the actual character name not @{character_name}) if you want the query to work.
I just tried both methods replacing the attribute call with the actual character name and still no luck.
1511923161

Edited 1511923199
The other problem is due to the order of operations. Attributes and Abilities are processed before queries. So if the attribute or ability has characters ("}", ",", or "|") that would normally be encoded to work inside a query, will break your query because they are not encoded inside the attribute/ability. To get around this, most people use ability command buttons, because the only extra work that needs to be done is to click a button in chat. But since you have expressed that you would prefer a query then you have some work ahead of you. You are going to need to recreate what these abilities do and where they differ will become included in the query.
Unless something was update (which someone else may know), I don't think you can call a macro directly in a query. You can replicate the full macro with a lot of effort or put out buttons that link to a macro but no %MACRO or #MACRO calls direclty last I knew.
Fortunately this skills query is a common problem and I have helped people create them. This macro is useable by both PC and NPC using the 5e OGL character sheet. @{selected|wtype}&{template:simple} @{selected|rtype}?{Skill |Acrobatics,+[[(@{selected|acrobatics_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_acrobatics}*@{selected|npc})]][ACRO] ]]}} {{rname=^{acrobatics-u}}} {{mod=[[ [[(@{selected|acrobatics_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_acrobatics}*@{selected|npc})]][ACRO] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|acrobatics_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_acrobatics}*@{selected|npc})]][ACRO] ]] |Animal Handling,+[[(@{selected|animal_handling_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_animal_handling}*@{selected|npc})]][ANIM] ]]}} {{rname=^{animal_handling-u}}} {{mod=[[ [[(@{selected|animal_handling_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_animal_handling}*@{selected|npc})]][ANIM] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|animal_handling_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_animal_handling}*@{selected|npc})]][ANIM] ]] |Arcana,+[[(@{selected|arcana_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_arcana}*@{selected|npc})]][ARC] ]]}} {{rname=^{arcana-u}}} {{mod=[[ [[(@{selected|arcana_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_arcana}*@{selected|npc})]][ARCA] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|arcana_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_arcana}*@{selected|npc})]][ARCA] ]] |Athletics,+[[(@{selected|athletics_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_athletics}*@{selected|npc})]][ARC] ]]}} {{rname=^{athletics-u}}} {{mod=[[ [[(@{selected|athletics_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_athletics}*@{selected|npc})]][ATHL] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|athletics_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_athletics}*@{selected|npc})]][ATHL] ]] |Decpetion,+[[(@{selected|deception_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_deception}*@{selected|npc})]][ARC] ]]}} {{rname=^{deception-u}}} {{mod=[[ [[(@{selected|deception_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_deception}*@{selected|npc})]][DECE] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|deception_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_deception}*@{selected|npc})]][DECE] ]] |History,+[[(@{selected|history_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_history}*@{selected|npc})]][ARC] ]]}} {{rname=^{history-u}}} {{mod=[[ [[(@{selected|history_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_history}*@{selected|npc})]][HIST] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|history_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_history}*@{selected|npc})]][HIST] ]] |Insight,+[[(@{selected|insight_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_insight}*@{selected|npc})]][ARC] ]]}} {{rname=^{insight-u}}} {{mod=[[ [[(@{selected|insight_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_insight}*@{selected|npc})]][INSI] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|insight_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_insight}*@{selected|npc})]][INSI] ]] |Intimidation,+[[(@{selected|intimidation_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_intimidation}*@{selected|npc})]][ARC] ]]}} {{rname=^{intimidation-u}}} {{mod=[[ [[(@{selected|intimidation_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_intimidation}*@{selected|npc})]][INTI] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|intimidation_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_intimidation}*@{selected|npc})]][INTI] ]] |Investigation,+[[(@{selected|investigation_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_investigation}*@{selected|npc})]][ARC] ]]}} {{rname=^{investigation-u}}} {{mod=[[ [[(@{selected|investigation_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_investigation}*@{selected|npc})]][INVE] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|investigation_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_investigation}*@{selected|npc})]][INVE] ]] |Medicine,+[[(@{selected|medicine_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_medicine}*@{selected|npc})]][ARC] ]]}} {{rname=^{medicine-u}}} {{mod=[[ [[(@{selected|medicine_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_medicine}*@{selected|npc})]][MEDI] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|medicine_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_medicine}*@{selected|npc})]][MEDI] ]] |Nature,+[[(@{selected|nature_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_nature}*@{selected|npc})]][ARC] ]]}} {{rname=^{nature-u}}} {{mod=[[ [[(@{selected|nature_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_nature}*@{selected|npc})]][NATU] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|nature_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_nature}*@{selected|npc})]][NATU] ]] |Perception,+[[(@{selected|perception_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_perception}*@{selected|npc})]][ARC] ]]}} {{rname=^{perception-u}}} {{mod=[[ [[(@{selected|perception_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_perception}*@{selected|npc})]][PERC] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|perception_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_perception}*@{selected|npc})]][PERC] ]] |Performance,+[[(@{selected|performance_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_performance}*@{selected|npc})]][ARC] ]]}} {{rname=^{performance-u}}} {{mod=[[ [[(@{selected|performance_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_performance}*@{selected|npc})]][PERF] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|performance_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_performance}*@{selected|npc})]][PERF] ]] |Persuasion,+[[(@{selected|persuasion_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_persuasion}*@{selected|npc})]][ARC] ]]}} {{rname=^{persuasion-u}}} {{mod=[[ [[(@{selected|persuasion_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_persuasion}*@{selected|npc})]][PERS] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|persuasion_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_persuasion}*@{selected|npc})]][PERS] ]] |Religion,+[[(@{selected|religion_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_religion}*@{selected|npc})]][ARC] ]]}} {{rname=^{religion-u}}} {{mod=[[ [[(@{selected|religion_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_religion}*@{selected|npc})]][RELI] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|religion_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_religion}*@{selected|npc})]][RELI] ]] |Sleight of Hand,+[[(@{selected|sleight_of_hand_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_sleight_of_hand}*@{selected|npc})]][ARC] ]]}} {{rname=^{sleight_of_hand-u}}} {{mod=[[ [[(@{selected|sleight_of_hand_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_sleight_of_hand}*@{selected|npc})]][SLEI] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|sleight_of_hand_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_sleight_of_hand}*@{selected|npc})]][SLEI] ]] |Stealth,+[[(@{selected|stealth_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_stealth}*@{selected|npc})]][ARC] ]]}} {{rname=^{stealth-u}}} {{mod=[[ [[(@{selected|stealth_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_stealth}*@{selected|npc})]][STEA] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|stealth_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_stealth}*@{selected|npc})]][STEA] ]] |Survival,+[[(@{selected|survival_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_survival}*@{selected|npc})]][ARC] ]]}} {{rname=^{survival-u}}} {{mod=[[ [[(@{selected|survival_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_survival}*@{selected|npc})]][SURV] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|survival_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_survival}*@{selected|npc})]][SURV] ]] }}} @{selected|global_skill_mod} @{selected|charname_output}
Vanakoji said: Unless something was update (which someone else may know), I don't think you can call a macro directly in a query. You can replicate the full macro with a lot of effort or put out buttons that link to a macro but no %MACRO or #MACRO calls direclty last I knew. You can call macros (#MACRO) and abilities (%MACRO) within a query, you just need to encode any ",", "|", or "}" inside them before they can be used. For macros, you also need to have a space after the name of the macro though. For more information on it see the wiki. <a href="https://wiki.roll20.net/Macros#Nesting_Macros" rel="nofollow">https://wiki.roll20.net/Macros#Nesting_Macros</a> <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_</a>...
1511924604

Edited 1511924706
Vanakoji
KS Backer
Kyle G. said: Vanakoji said: Unless something was update (which someone else may know), I don't think you can call a macro directly in a query. You can replicate the full macro with a lot of effort or put out buttons that link to a macro but no %MACRO or #MACRO calls direclty last I knew. You can call macros (#MACRO) and abilities (%MACRO) within a query, you just need to encode any ",", "|", or "}" inside them before they can be used. For macros, you also need to have a space after the name of the macro though. For more information on it see the wiki. <a href="https://wiki.roll20.net/Macros#Nesting_Macros" rel="nofollow">https://wiki.roll20.net/Macros#Nesting_Macros</a> <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_</a>... #Macro if all it does is text or you do tones of character replacements for a global macro (which isn't as useful as sheet macros, and pretty much the same as doing the macro within the query anyway as then the macro doesn't work itself along). For % macros, if it works I would love to see how as no amount of character replacements has ever worked for me, even now when I tested it still the same old broken queries as I remember.
1511925150

Edited 1511925522
Kyle G. said: Fortunately this skills query is a common problem and I have helped people create them. This macro is useable by both PC and NPC using the 5e OGL character sheet. This was exactly the kind of heavy lifting I was trying to avoid by doing the simpler macros thanks for doing it for us haha. A couple things about the macro though, I'm assuming I can remove all the npc attributes and selected keywords if I'm using this as a PC ability? Also, what does ARC mean? It appears after each of the second rolls (written first in the macro). EDIT: Also, what actually is pbd_safe? It's a shame roll20's set up this way I imagine there's lot of reasons why but a way to temporarily change the order of operations within a macro or something similar to that would go a long way to solving these problems if possible, especially when something like the first macro I tried using is so much simpler than the text wall we have to use. For anyone's reference the closest I got to sleeker solution is by 'commenting out' a query like so: ! ?{Skill check?|Acrobatics|Athletics} %{Name|?{Skill check?}} Unfortunately the second line is checked before the 1st is given an answer but if there was a way to delay the second line I believe this would work.