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

[DnD5e Character Sheet] Macros and Formatting for Advantage or Disadvantage

Hi there, Please pardon me if this has already been asked; I am new to macros in general and this is my first posting in the Community Forums and could not find anything on this topic in my initial search. I am currently writing macros for the DnD5e Character Sheet developed by by John Myles ( Actoba on Roll20 or @jmyles85 on Twitter ) and had a couple questions on how to format the roll figures for advantage and disadvantage as illustrated in the first template below. The first is accomplished merely by inserting %{selected|Athletics_Check} whereas the second uses the following code. -- /w GM &{template:5eDefault}{{ability=1}}{{title=Athletics (STR)}}{{subheader=@{selected|character_name} • Ability Check}}{{Result= [[1d20 + [[@{selected|Str Mod}+0]] ]] | [[1d20 + [[@{selected|Str Mod}+0]] ]]}}{{outputall=1}} -- (1) Is there a way to replicate the "faded" formatting of the 1 above with the 3 below? In general, I am unsure how to dynamically depict formatting based on comparative results. In other words, how do I tell the system that: the 18 is greater than 3; and (in the case of advantage) to fade out the 3? (2) Where might I find the source code is for %{selected|Athletics_Check}? (3) Is there a way for me to mimic %{selected|Athletics_Check} without calling three separate conditional predicates after asking the user for Normal|Advantage|Disadvantage? (4) What does % mean in general in contrast to @? It seems that the former is used to run a function whereas the latter just looks up a field, but are there any other distinguishing factors? Thanks!
You can learn a lot about the code for rolls by simply pressing the button on the sheet then going to the chat window and hitting the up arrow on the keyboard. That will put the code into chat for you to peruse.  The % is used in calling a button that is built into the sheet, where as the @ symbol calls an attribute. 
So... I tried that and all it did was give me the name of the macro that I had programmed originally. Is there a button on the sheet that allows for advantage/disadvantage that I haven't found?
I'm sorry I was tired when I wrote that, I should have just gone to bed, but what I was trying to say about the up arrow trick is that clicking on the button on the character sheet for, lets say Athletics, will put all the code for that into chat. Then you can go through that and learn quite a bit. To your question on how to set the sheet itself to default to Querying or not for Adv/Dis that is a setting on each character sheet. Click on the little cogwheel up above the class box to set the default behavior for the that character. As you look over the rest of the sheet you will notice that most the the roll buttons have a cogwheel next to them as well. So you can set an specific roll to always be at advantage or disadvantage. As for the faded styling for the Advantage/Disadvantage results, that info from the settings mentioned above is saved on the sheet under the Attributes and Abilities tab. So if the player has the Athletics roll options set to ALWAYS Advantage, then that will be stored in the roll options for Athletics if you go to the Attributes you can find ro_athletics_rolltype and see that is has the value of {{rollhasadv=1}} {{roll2=[[ 1d20 Now I have not had the best luck trying to directly inject the {{rollhasadv=1}} tag into a macro, but you can make a generic macro for Athletics that will read the athletics_ro from the Attributes and pull the correct info from Sheetworkers, which we don't have access to. Here is a generic macro for Athletics to give you an idea &{template:5eDefault} {{character_name=@{Selected|character_name}}} {{title=Athletics (STR)}} {{subheader=@{Selected|character_name}}} {{subheaderright=Ability check}} {{ability=1}} {{simple=1}} {{rollname=Result}} {{roll1=[[ 1d20 + [[ @{selected|athletics} ]] + [[ @{Selected|global_check_bonus} ]] ]]}} @{Selected|ro_athletics} @{Selected|classactionathletics} I hope that make it all a little more clear. It gets complicated, but once you get into it you can do a lot with the macros. Good luck
Thanks Ed! I tried it again from the sheet and found what you were mentioning. I was searching for a way to find information based on my interactions with the sheet and this will be invaluable going forward! One last question on this. What do the following tags specify? @{Selected|global_check_bonus} - Is this whether the character has proficiency regardless of which skill is selected? Like it looks up into an array of proficiency bonuses? @{Selected|classactionathletics} - When I enter this into chat it gives me a series of 0s and then the tag {{showclassactions=1}}
@{Selected|global_check_bonus} is simply pulls any bonus from the characters sheet in the Bonuses and Penalties section under Skill checks @{Selected|classactionathletics} is a code letting the template know what kind of action it was, in this case it's a class action for athletics. It will then pull any class action data that is attached to athletics and append the template with that.  I hope that makes sense. This sheet has some really great features and hidden gems, so it's unfortunate that it's no longer supported. If we could get compendium support with this old sheet it would be great. I still run my 2 year old ongoing campaign with it and it's done great, but all my new games are using the OGL sheet for the compendium drag and drop integration.  Good luck and happy rolling. 
Thanks Ed!