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

Ability Check Token Macro for Community Contributed 5e D&D character sheet discussion...

So I have working code (best feeling ever) it's not fancy but it works.It creates a dropdown of the ability checks and skill that I have. I have my rolls roll 2 sets of dice (trying to call a variable that's also a query is a nightmare to get to work, so I avoided that like the plague) here is my following code: &{template:5eDefault} {{subheader=@{selected|character_name}}} {{subheaderright=Ability Check}} {{ability=1}} {{simple=1}} {{title=?{Type of Check? |Acrobatics (DEX)|Animal Handling (WIS)|Arcana (INT)|Athletics (STR)|Deception (DEX)|History (INT)|Insight (WIS)|Intimidation (CHR)|Investigation (INT) |Medicine (WIS)|Nature (INT)|Perception (WIS)|Performance (CHR)|Persuasion (CHR)|Religion (INT)|Sleight of hand (DEX)|Stealth (DEX)|Survival (WIS)|@{selected|custom_skill_1_name}|@{selected|custom_skill_2_name}|@{selected|custom_skill_3_name}|@{selected|custom_skill_4_name}|Basic Strength|Basic Dexterity|Basic Constitution|Basic Intelligence|Basic Wisdom|Basic Charisma } }} {{rollname=Result}} {{noadvroll=1}} {{roll1=[[1d20 + ?{What Ability? |Acrobatics,[[@{selected|acrobatics}]] + [[@{selected|global_check_bonus}]] [ACRO] |Animal Handling,[[@{selected|animalhandling}]]+[[@{selected|global_check_bonus}]] [ANIM] |Arcana,[[@{selected|arcana}]]+[[@{selected|global_check_bonus}]] [ARC] |Athletics, [[@{selected|athletics}]]+[[@{selected|global_check_bonus}]] [ATHL] |Deception, [[@{selected|deception}]]+[[@{selected|global_check_bonus}]] [DECEPT] |History,[[@{selected|history}]]+[[@{selected|global_check_bonus}]] [HIS] |Insight,[[@{selected|insight}]]+[[@{selected|global_check_bonus}]] [INS] |Intimidation,[[@{selected|intimidation}]]+[[@{selected|global_check_bonus}]] [INTIM] |Investigation, [[@{selected|investigation}]]+[[@{selected|global_check_bonus}]] [INVEST] |Medicine, [[@{selected|medicine}]]+[[@{selected|global_check_bonus}]] [MED] |Nature, [[@{selected|nature}]]+[[@{selected|global_check_bonus}]] [NAT] |Perception, [[@{selected|perception}]]+[[@{selected|global_check_bonus}]] [PERCEPT] |Performance, [[@{selected|performance}]]+[[@{selected|global_check_bonus}]] [PERF] |Persuasion, [[@{selected|persuasion}]]+[[@{selected|global_check_bonus}]] [PERS] |Religion, [[@{selected|religion}]]+[[@{selected|global_check_bonus}]] [REL] |Sleight of Hand,[[@{selected|sleightofhand}]]+[[@{selected|global_check_bonus}]] [SoH] |Stealth, [[@{selected|stealth}]]+[[@{selected|global_check_bonus}]] [STEA] |Survival,[[@{selected|survival}]]+[[@{selected|global_check_bonus}]] [SURV] |@{selected|custom_skill_1_name},[[@{selected|custom_skill_1}]]+[[@{selected|global_check_bonus}]] [CUS1] |@{selected|custom_skill_2_name},[[@{selected|custom_skill_2}]]+[[@{selected|global_check_bonus}]] [CUS2] |@{selected|custom_skill_3_name},[[@{selected|custom_skill_3}]]+[[@{selected|global_check_bonus}]] [CUS3] |@{selected|custom_skill_4_name},[[@{selected|custom_skill_4}]]+[[@{selected|global_check_bonus}]] [CUS4] |Basic Strength,[[@{selected|basic_strength_check_mod}]]+[[@{selected|global_check_bonus}]] [STR] |Basic Dexterity,[[@{selected|basic_dexterity_check_mod}]]+[[@{selected|global_check_bonus}]] [DEX] |Basic Constitution,[[@{selected|basic_constitution_check_mod}]]+[[@{selected|global_check_bonus}]] [CON] |Basic Intelligence,[[@{selected|basic_intelligence_check_mod}]]+[[@{selected|global_check_bonus}]] [INT] |Basic Wisdom,[[@{selected|basic_wisdom_check_mod}]]+[[@{selected|global_check_bonus}]] [WIS] |Basic Charisma,[[@{selected|basic_charisma_check_mod}]]+[[@{selected|global_check_bonus}]] [CHR] } ]] | [[1d20 + ?{What Ability? |Acrobatics,[[@{selected|acrobatics}]] + [[@{selected|global_check_bonus}]] [ACRO] |Animal Handling,[[@{selected|animalhandling}]]+[[@{selected|global_check_bonus}]] [ANIM] |Arcana,[[@{selected|arcana}]]+[[@{selected|global_check_bonus}]] [ARC] |Athletics, [[@{selected|athletics}]]+[[@{selected|global_check_bonus}]] [ATHL] |Deception, [[@{selected|deception}]]+[[@{selected|global_check_bonus}]] [DECEPT] |History,[[@{selected|history}]]+[[@{selected|global_check_bonus}]] [HIS] |Insight,[[@{selected|insight}]]+[[@{selected|global_check_bonus}]] [INS] |Intimidation,[[@{selected|intimidation}]]+[[@{selected|global_check_bonus}]] [INTIM] |Investigation, [[@{selected|investigation}]]+[[@{selected|global_check_bonus}]] [INVEST] |Medicine, [[@{selected|medicine}]]+[[@{selected|global_check_bonus}]] [MED] |Nature, [[@{selected|nature}]]+[[@{selected|global_check_bonus}]] [NAT] |Perception, [[@{selected|perception}]]+[[@{selected|global_check_bonus}]] [PERCEPT] |Performance, [[@{selected|performance}]]+[[@{selected|global_check_bonus}]] [PERF] |Persuasion, [[@{selected|persuasion}]]+[[@{selected|global_check_bonus}]] [PERS] |Religion, [[@{selected|religion}]]+[[@{selected|global_check_bonus}]] [REL] |Sleight of Hand,[[@{selected|sleightofhand}]]+[[@{selected|global_check_bonus}]] [SoH] |Stealth, [[@{selected|stealth}]]+[[@{selected|global_check_bonus}]] [STEA] |Survival,[[@{selected|survival}]]+[[@{selected|global_check_bonus}]] [SURV] |@{selected|custom_skill_1_name},[[@{selected|custom_skill_1}]]+[[@{selected|global_check_bonus}]] [CUS1] |@{selected|custom_skill_2_name},[[@{selected|custom_skill_2}]]+[[@{selected|global_check_bonus}]] [CUS2] |@{selected|custom_skill_3_name},[[@{selected|custom_skill_3}]]+[[@{selected|global_check_bonus}]] [CUS3] |@{selected|custom_skill_4_name},[[@{selected|custom_skill_4}]]+[[@{selected|global_check_bonus}]] [CUS4] |Basic Strength,[[@{selected|basic_strength_check_mod}]]+[[@{selected|global_check_bonus}]] [STR] |Basic Dexterity,[[@{selected|basic_dexterity_check_mod}]]+[[@{selected|global_check_bonus}]] [DEX] |Basic Constitution,[[@{selected|basic_constitution_check_mod}]]+[[@{selected|global_check_bonus}]] [CON] |Basic Intelligence,[[@{selected|basic_intelligence_check_mod}]]+[[@{selected|global_check_bonus}]] [INT] |Basic Wisdom,[[@{selected|basic_wisdom_check_mod}]]+[[@{selected|global_check_bonus}]] [WIS] |Basic Charisma,[[@{selected|basic_charisma_check_mod}]]+[[@{selected|global_check_bonus}]] [CHR] } ]] }} I was wondering, in my above code I have to basically specify twice so it prints nicely, cause the title is dependent on the choice. I use the same Key item in my query, but a different output (for the title I output text, for the actual roll I output the appropriate modifiers)  I was just curious if anyone knew of a way (without the API, would prefer not to have to use it if I don't have to for this specifically) of utilizing 1 choice that would use the same query, but output both sets correctly. If this is not possible that's fine. I also posted this simply to allow others who are looking to do the same thing perhaps a guideline to getting it to work (I look at several different examples and used multiple methods to get this to work) My code is not versatile enough to be used with npc's (I already have a basic npc code for skills so didn't need it, not to mention most of my npc just need perception and stealth for the most part...). The part that I like the most from the above is that it keeps, for the most part, the same format as if my players pressed the roll button (without asking/prompting to roll for adv, again not worth trying to get that to work...) Hope someone else finds the above code useful even if i can't get an answer to my question :)
1594707237
Oosh
Sheet Author
API Scripter
I'm not familiar with that template, but you can reduce it to a single query like this (and throw advantage in): &{template:default} {{ [[ ?{Roll Type?|Normal,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + ?{What Ability?| Acrobatics,@{selected|acrobatics}[ACRO] + @{selected|global_check_bonus}[GLOB] ]] }} {{name=Acrobatics Check| Animal Handling,@{selected|animalhandling}[ANIM] + @{selected|global_check_bonus}[GLOB] ]] }} {{name=Animal Handling} }} Obviously that's only the first two skills, and it's in the wrong template. You probably want something like this, but I don't have a community sheet game to test it in right this minute: &{template:5eDefault} {{subheader=@{selected|character_name}}} {{ability=1}} {{simple=1}} {{title=[[ ?{Roll Type?|Normal,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + ?{What Ability?| Acrobatics,@{selected|acrobatics}[ACRO] + @{selected|global_check_bonus}[GLOB] ]] }} {{subheaderright=Acrobatics Check| Animal Handling,@{selected|animalhandling}[ANIM] + @{selected|global_check_bonus}[GLOB] ]] }} {{subheaderright=Animal Handling} }} Does that work at all for you?
I have tried using the html replacements with some degrees of success, I will tinker with your concept :) The biggest Mindblown moment was noticing that I could use a simple Query to Simulate the 1d20, can't believe I didn't think of that. That's just amazing :). I can't mess with it today But ill try doing something with it tomorrow. Thank you :) <-- knows I'm the only weirdo that insist on using the Community Contributed 5e DND Sheet. Eventually will get it working with all the bells and whistles :) Oosh said: I'm not familiar with that template, but you can reduce it to a single query like this (and throw advantage in): &{template:default} {{ [[ ?{Roll Type?|Normal,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + ?{What Ability?| Acrobatics,@{selected|acrobatics}[ACRO] + @{selected|global_check_bonus}[GLOB] ]] }} {{name=Acrobatics Check| Animal Handling,@{selected|animalhandling}[ANIM] + @{selected|global_check_bonus}[GLOB] ]] }} {{name=Animal Handling} }} Obviously that's only the first two skills, and it's in the wrong template. You probably want something like this, but I don't have a community sheet game to test it in right this minute: &{template:5eDefault} {{subheader=@{selected|character_name}}} {{ability=1}} {{simple=1}} {{title=[[ ?{Roll Type?|Normal,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + ?{What Ability?| Acrobatics,@{selected|acrobatics}[ACRO] + @{selected|global_check_bonus}[GLOB] ]] }} {{subheaderright=Acrobatics Check| Animal Handling,@{selected|animalhandling}[ANIM] + @{selected|global_check_bonus}[GLOB] ]] }} {{subheaderright=Animal Handling} }} Does that work at all for you? Although it does do the Advantage by asking, I kind of like the aesthetic of it showing both dice rolls, feels better as a player when you know advantage has helped without hovering over the dice roll. But I will keep that in mind. looking at your code it does look a smidgen more complicated (having all the depending template fields inside the one title field.. Would definitely be coding that in something like notepad++ to ensure that all my brackets are completed *[and keeping track of the html replacements :(] again I'll probably try the rest of that tomorrow. 
1594772389
Oosh
Sheet Author
API Scripter
Yep, you can do that too, though it's getting a little more complicated: &{template:default} {{Roll=[[ [[?{Roll Type?|Normal,{[[1d20]]+[[1d0cs1cf1]]}kh1|Advantage,{[[1d20]],[[1d20]]}kh1|Disadvantage,{[[1d20]],[[1d20]]}kl1}]] + ?{What Ability?| Acrobatics,@{selected|acrobatics}[ACRO] + @{selected|global_check_bonus}[GLOB] ]] -- ($[[0]]/$[[1]]) }} {{name=Acrobatics| Animal Handling,@{selected|animalhandling}[ANIM] + @{selected|global_check_bonus}[GLOB] ]] -- ($[[0]]/$[[1]]) }} {{name=Animal Handling} Check}} Really, if you wanted to use it you wouldn't need to worry about HTML replacement. Just copy the Acrobatics line and replace the word 'acrobatics' with each skill name, no need to type it all manually. The biggest Mindblown moment was noticing that I could use a simple Query to Simulate the 1d20, Yep, the biggest trick is keeping your Advantage Query outside your other queries. That way madness lies!
1594791959

Edited 1594792063
Oosh said: Yep, you can do that too, though it's getting a little more complicated: &{template:default} {{Roll=[[ [[?{Roll Type?|Normal,{[[1d20]]+[[1d0cs1cf1]]}kh1|Advantage,{[[1d20]],[[1d20]]}kh1|Disadvantage,{[[1d20]],[[1d20]]}kl1}]] + ?{What Ability?| Acrobatics,@{selected|acrobatics}[ACRO] + @{selected|global_check_bonus}[GLOB] ]] -- ($[[0]]/$[[1]]) }} {{name=Acrobatics| Animal Handling,@{selected|animalhandling}[ANIM] + @{selected|global_check_bonus}[GLOB] ]] -- ($[[0]]/$[[1]]) }} {{name=Animal Handling} Check}} Really, if you wanted to use it you wouldn't need to worry about HTML replacement. Just copy the Acrobatics line and replace the word 'acrobatics' with each skill name, no need to type it all manually. The biggest Mindblown moment was noticing that I could use a simple Query to Simulate the 1d20, Yep, the biggest trick is keeping your Advantage Query outside your other queries. That way madness lies! You are going to have to explain that voodoo.... you can use literal string replacements in roll20? O.o I am confused by the bolded text above... as to what it is doing... I am unfamiliar with ${} syntax within roll20, again I know what it does in a `` situation (which is very handy) but in this situation what would the 0 and 1 argument represent? If that represents which skill I am using would I need all 28 of those for that line? (18 skills, 4 custom skills, and 6 basic ability checks) Looking for more mind blown events...
1594792834
GiGs
Pro
Sheet Author
API Scripter
J.C said: You are going to have to explain that voodoo.... you can use literal string replacements in roll20? O.o I am confused by the bolded text above... as to what it is doing... I am unfamiliar with ${} syntax within roll20, again I know what it does in a `` situation (which is very handy) but in this situation what would the 0 and 1 argument represent? If that represents which skill I am using would I need all 28 of those for that line? (18 skills, 4 custom skills, and 6 basic ability checks) Looking for more mind blown events... That's not a template literal, unfortunately. It's an example of an undocumented 'feature' of roll20:&nbsp; <a href="https://app.roll20.net/forum/permalink/8747581/" rel="nofollow">https://app.roll20.net/forum/permalink/8747581/</a>