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 query macro for players using DnD 5e character sheet

May 28 (5 years ago)

Edited May 30 (5 years ago)

****EDIT***

Some things were wrong in the original macro, so I corrected it. Just to be clear, this macro is intended FOR PLAYERS, not for NPCs. I made an other one for monsters and NPCs, here is the link to it :

https://app.roll20.net/forum/post/8747010/slug%7D

You have to consider that I create every player character from a template with all the macros they need. This is with the 5e DnD sheet. Special thanks to Oosh for suggesting the corrections and Scott M. for spotting errors. :


@{selected|wtype}&{template:npc} @{selected|rtype}+?{Skills|Acrobatics,[[@{selected|acrobatics_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|acrobatics_bonus}]]}}{{rname=Acrobatics Check}}{{name=@{selected|character_name}}}{{type=Roll}} |Animal Handling,[[@{selected|animal_handling_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|animal_handling_bonus}]]}}{{rname=Animal Handling Check}}{{name=@{selected|character_name}}} {{type=Roll}} |Arcana,[[@{selected|arcana_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|arcana_bonus}]]}}{{rname=Arcana Check}}{{name=@{selected|character_name}}} {{type=Roll}} |Athletics,[[@{selected|athletics_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|athletics_bonus}]]}}{{rname=Athletics Check}}{{name=@{selected|character_name}}} {{type=Roll}} |Deception,[[@{selected|deception_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|deception_bonus}]]}}{{rname=Deception Check}}{{name=@{selected|character_name}}} {{type=Roll}} |History,[[@{selected|history_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|history_bonus}]]}}{{rname=History Check}}{{name=@{selected|character_name}}} {{type=Roll}} |Insight,[[@{selected|insight_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|insight_bonus}]]}}{{rname=Insight Check}}{{name=@{selected|character_name}}} {{type=Roll}} |Intimidation,[[@{selected|intimidation_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|intimidation_bonus}]]}}{{rname=Intimidation Check}}{{name=@{selected|character_name}}} {{type=Roll}} |Investigation,[[@{selected|investigation_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|investigation_bonus}]]}}{{rname=Investigation Check}}{{name=@{selected|character_name}}} {{type=Roll}} |Medicine,[[@{selected|medicine_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|medicine_bonus}]]}}{{rname=Medicine Check}}{{name=@{selected|character_name}}} {{type=Roll}} |Nature,[[@{selected|nature_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|nature_bonus}]]}}{{rname=Nature Check}}{{name=@{selected|character_name}}} {{type=Roll}} |Perception,[[@{selected|perception_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|perception_bonus}]]}}{{rname=Perception Check}}{{name=@{selected|character_name}}} {{type=Roll}} |Performance,[[@{selected|performance_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|performance_bonus}]]}}{{rname=Performance Check}}{{name=@{selected|character_name}}} {{type=Roll}} |Persuasion,[[@{selected|persuasion_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|persuasion_bonus}]]}}{{rname=Persuasion Check}}{{name=@{selected|character_name}}} {{type=Roll}} |Religion,[[@{selected|religion_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|religion_bonus}]]}}{{rname=Religion Check}}{{name=@{selected|character_name}}} {{type=Roll}} |Sleight Of Hand,[[@{selected|sleight_of_hand_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|sleight_of_hand_bonus}]]}}{{rname=Sleight Of Hand Check}}{{name=@{selected|character_name}}} {{type=Roll}} |Stealth,[[@{selected|stealth_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|stealth_bonus}]]}}{{rname=Stealth Check}}{{name=@{selected|character_name}}} {{type=Roll}} |Survival,[[@{selected|survival_bonus}]]]]}}{{r1=[[@{selected|d20}+@{selected|survival_bonus}]]}}{{rname=Survival Check}}{{name=@{selected|character_name}}} {{type=Roll}}}

Just tried this and got a `TypeError: c is undefined` error. :( Anyone have luck?

May 30 (5 years ago)

Edited May 30 (5 years ago)
Oosh
Sheet Author
API Scripter

The @{character_name} calls are all missing the selected|

You can use it as is, pasting it into every single character sheet under Abilities (which seems to be how Ozzy uses it), in which case it doesn't really need the selected| under all the other template fields.

A better way would be to use Notepad or something to replace all instances of "character" with "selected|character".

So the second last template field under each skill should be:

{{name=@{selected|character_name}}}

It will then work as a universal macro for whatever token you have selected, either saved under a macro mule and on the main macro bar, or saved in Collections and used as a token action. Obviously it's calling npc_ Attributes so it isn't going to work for PCs.

Thanks  OOsh! That's *almost* working properly. But it's not applying the bonus properly.


I tried applying it to a goblin which has a +6 to stealth, but it only applied it to the second roll.


The actual rolls were `1d20+2` and `1d20+6`.

May 30 (5 years ago)
Oosh
Sheet Author
API Scripter

Oh, interesting. I didn't notice that sorry.

It's calling on two different Attributes for r1 and r2. If you look at Acrobatics:

Acrobatics,[[@{selected|npc_acrobatics}]]]]}}{{r1=[[@{selected|d20}+@{selected|acrobatics_bonus}]]}}{{rname=Acrobatics Check}}{{name=@{character_name}}}{{type=Roll}}

The first call in bold is the correct one for an NPC which goes to r2 via the {rtype} call outside the query, right at the start. The second one is a Player Character skill bonus call. Essentially you will need to replace all the <skillname>_bonus instances with npc_<skillname> to get this to work properly for NPCs.

May 30 (5 years ago)

Edited May 30 (5 years ago)


Scott M. said:

Thanks  OOsh! That's *almost* working properly. But it's not applying the bonus properly.


I tried applying it to a goblin which has a +6 to stealth, but it only applied it to the second roll.


The actual rolls were `1d20+2` and `1d20+6`.


This macro is for the players. I corrected the macro in the original post. I am using an other one for monsters, here is the link to it :

https://app.roll20.net/forum/post/8747010/slug%7D


May 30 (5 years ago)

Edited May 30 (5 years ago)

Thanks Ozzy!

I originally was going to post the NPC version, but it looks like you took care of that. Great work


Scott M. said:

That was it! Here is the final macro with all the changes



@{selected|wtype}&{template:npc} @{selected|rtype}+?{Skills|Acrobatics,[[@{selected|npc_acrobatics}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_acrobatics}]]&#125;&#125;{{rname=Acrobatics Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125;{{type=Roll&#125;&#125; |Animal Handling,[[@{selected|npc_animal_handling}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|animal_handling_bonus}]]&#125;&#125;{{rname=Animal Handling Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |Arcana,[[@{selected|npc_arcana}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_arcana}]]&#125;&#125;{{rname=Arcana Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |Athletics,[[@{selected|npc_athletics}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_athletics}]]&#125;&#125;{{rname=Athletics Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |Deception,[[@{selected|npc_deception}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_deception}]]&#125;&#125;{{rname=Deception Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |History,[[@{selected|npc_history}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_history}]]&#125;&#125;{{rname=History Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |Insight,[[@{selected|npc_insight}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_insight}]]&#125;&#125;{{rname=Insight Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |Intimidation,[[@{selected|npc_intimidation}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_intimidation}]]&#125;&#125;{{rname=Intimidation Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |Investigation,[[@{selected|npc_investigation}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_investigation}]]&#125;&#125;{{rname=Investigation Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |Medicine,[[@{selected|npc_medicine}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_medicine}]]&#125;&#125;{{rname=Medicine Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |Nature,[[@{selected|npc_nature}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_nature}]]&#125;&#125;{{rname=Nature Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |Perception,[[@{selected|npc_perception}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_perception}]]&#125;&#125;{{rname=Perception Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |Performance,[[@{selected|npc_performance}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_performance}]]&#125;&#125;{{rname=Performance Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |Persuasion,[[@{selected|npc_persuasion}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_persuasion}]]&#125;&#125;{{rname=Persuasion Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |Religion,[[@{selected|npc_religion}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_religion}]]&#125;&#125;{{rname=Religion Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |Sleight Of Hand,[[@{selected|npc_sleight_of_hand}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|sleight_of_hand_bonus}]]&#125;&#125;{{rname=Sleight Of Hand Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |Stealth,[[@{selected|npc_stealth}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_stealth}]]&#125;&#125;{{rname=Stealth Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125; |Survival,[[@{selected|npc_survival}]]]]&#125;&#125;{{r1=[[@{selected|d20}+@{selected|npc_survival}]]&#125;&#125;{{rname=Survival Check&#125;&#125;{{name=@{selected|character_name}&#125;&#125; {{type=Roll&#125;&#125

The version you posted with corrections is indeed for monsters. If you want the version for your players, go see original post, I modified it. Also, Scott M., can you tell me if you are able to use this macro (the one you posted) as a general one or did you include it directly in the monster sheet.


Thank you !


I added that macro directly to my monster template sheet