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

Skill Check Macro

So I found this a skill check macro for NPCs and was wondering if there was a way to convert it to work for PCs. I attempted to use the @{selected|"Skill"} with no result. Macro: @{selected|wtype} &{template:simple}{{always=1}}?{Ability?|Acrobatics,{{rname=Acrobatics}}{{mod=@{npc_acrobatics}}} {{r1=[[1d20+@{npc_acrobatics}]]}}{{r2=[[1d20+@{npc_acrobatics}]]}}|Animal Handling,{{rname=Animal Handling}}{{mod=@{npc_animal_handling}}} {{r1=[[1d20+@{npc_animal_handling}]]}}{{r2=[[1d20+@{npc_animal_handling}]]}}|Arcana,{{rname=Arcana}}{{mod=@{npc_arcana}}} {{r1=[[1d20+@{npc_arcana}]]}}{{r2=[[1d20+@{npc_arcana}]]}}|Athletics,{{rname=Athletics}}{{mod=@{npc_athletics}}} {{r1=[[1d20+@{npc_athletics}]]}}{{r2=[[1d20+@{npc_athletics}]]}}|Deception,{{rname=Deception}}{{mod=@{npc_deception}}} {{r1=[[1d20+@{npc_deception}]]}}{{r2=[[1d20+@{npc_deception}]]}}|History,{{rname=History}}{{mod=@{npc_history}}} {{r1=[[1d20+@{npc_history}]]}}{{r2=[[1d20+@{npc_history}]]}}|Insight,{{rname=Insight}}{{mod=@{npc_insight}}} {{r1=[[1d20+@{npc_insight}]]}}{{r2=[[1d20+@{npc_insight}]]}}|Intimidation,{{rname=Intimidation}}{{mod=@{npc_intimidation}}} {{r1=[[1d20+@{npc_intimidation}]]}}{{r2=[[1d20+@{npc_intimidation}]]}}|Investigation,{{rname=Investigation}}{{mod=@{npc_investigation}}} {{r1=[[1d20+@{npc_investigation}]]}}{{r2=[[1d20+@{npc_investigation}]]}}|Medicine,{{rname=Medicine}}{{mod=@{npc_medicine}}} {{r1=[[1d20+@{npc_medicine}]]}}{{r2=[[1d20+@{npc_medicine}]]}}|Nature,{{rname=Nature}}{{mod=@{npc_nature}}} {{r1=[[1d20+@{npc_nature}]]}}{{r2=[[1d20+@{npc_nature}]]}}|Perception,{{rname=Perception}}{{mod=@{npc_perception}}} {{r1=[[1d20+@{npc_perception}]]}}{{r2=[[1d20+@{npc_perception}]]}}|Performance,{{rname=Performance}}{{mod=@{npc_performance}}} {{r1=[[1d20+@{npc_performance}]]}}{{r2=[[1d20+@{npc_performance}]]}}|Persuasion,{{rname=Persuasion}}{{mod=@{npc_persuasion}}} {{r1=[[1d20+@{npc_persuasion}]]}}{{r2=[[1d20+@{npc_persuasion}]]}}|Religion,{{rname=Religion}}{{mod=@{npc_religion}}} {{r1=[[1d20+@{npc_religion}]]}}{{r2=[[1d20+@{npc_religion}]]}}|Sleight of Hand,{{rname=Sleight of Hand}}{{mod=@{npc_sleight_of_hand}}} {{r1=[[1d20+@{npc_sleight_of_hand}]]}}{{r2=[[1d20+@{npc_sleight_of_hand}]]}}|Stealth,{{rname=Stealth}}{{mod=@{npc_stealth}}} {{r1=[[1d20+@{npc_stealth}]]}}{{r2=[[1d20+@{npc_stealth}]]}}|Survival,{{rname=Survival}}{{mod=@{npc_survival}}} {{r1=[[1d20+@{npc_survival}]]}}{{r2=[[1d20+@{npc_survival}]]}}}{{charname=@{character_name}}} 
1602524996
GiGs
Pro
Sheet Author
API Scripter
You never replace characters inside an attribute call. Dont replace that "|", just use "". So just change, say, @{npc_acrobatics} to @{selected|acrobatics} (assuming the pc skill name is actually acrobatics - i dont use that sheet).
I think this is what you're looking for:&nbsp;<a href="https://app.roll20.net/forum/post/5591526/5e-ogl-universal-skill-check-macro-updated-for-v2-dot-0" rel="nofollow">https://app.roll20.net/forum/post/5591526/5e-ogl-universal-skill-check-macro-updated-for-v2-dot-0</a>
Jarren K. said: I think this is what you're looking for:&nbsp; <a href="https://app.roll20.net/forum/post/5591526/5e-ogl-universal-skill-check-macro-updated-for-v2-dot-0" rel="nofollow">https://app.roll20.net/forum/post/5591526/5e-ogl-universal-skill-check-macro-updated-for-v2-dot-0</a> I just tested that one and it isn't working for me.&nbsp; And GiGs, won't that mess up the macro? Since this is a drop down list, most of the time the options are seperated by a | hence the reason I attempted the &amp;#124;
1602528185
David M.
Pro
API Scripter
According to the macro order of operations , attribute expansion occurs pretty very early on (step 3), so the | in the attribute portion should be fine. It'll grab the right value before roll query values are substituted (step 5).
1602528730
GiGs
Pro
Sheet Author
API Scripter
Draconais said: And GiGs, won't that mess up the macro? Since this is a drop down list, most of the time the options are seperated by a | hence the reason I attempted the &amp;#124; David is correct to point out the order of operations. Attribute calls are substituted with their values before any other processing is done. By replacing any characters in an attribute call, you break those calls. This is why the very first subheading under&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> &nbsp;is: Roll Query Troubleshooting: NEVER REPLACE ATTRIBUTES &nbsp; (followed by an explanation why).
Draconais said: I just tested that one and it isn't working for me.&nbsp; Which character sheet are you using? I'm using the DnD 5e by Roll20 and just tried it on both an NPC and PC and it worked for both.&nbsp; (I'm assuming you're using the same character sheet based on the attribute names... but possibly another sheet uses the same attribute names.). If it isn't working, what error are you getting? Are you pasting the code directly into the chat window, or creating a global macro, or a character ability?
GiGs said: Draconais said: And GiGs, won't that mess up the macro? Since this is a drop down list, most of the time the options are seperated by a | hence the reason I attempted the &amp;#124; David is correct to point out the order of operations. Attribute calls are substituted with their values before any other processing is done. By replacing any characters in an attribute call, you break those calls. This is why the very first subheading under&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> &nbsp;is: Roll Query Troubleshooting: NEVER REPLACE ATTRIBUTES &nbsp; (followed by an explanation why). Just attempted this as per yours and David's recommendation, and figured out that 1) Skills on the OGL page are not attributes, but abilities (Requiring % instead of @), but the macro itself still isn't working. I am not sure if it is due to the the template or the rolls that it is trying to make, but instead of a dropdown menu, I am getting a text box with "Acrobatics, {{rname=Acrobatics&amp;#125;&amp;#125;{{r1=[[&amp;{template:simple" in it. To call up the acrobatics roll itself, I can use %{selected|acrobatics} and it will roll it as normal.
1602532070
GiGs
Pro
Sheet Author
API Scripter
You wont be able to put Abilities in that query, because they'll have their own characters in them that need html substitution. Looking at the thread linked earlier by Jarren, I see the skills are in the form acrobatics_bonus, so try changing each @{npc_acrobatics} to @{selected|acrobatics_bonus}
I got it figured out, thank you. When I tried Jarren's macro suggestion the first time, it didn't work for some reason, but I just tried it again and it worked fine. Thanks guys for the help, again.