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 .
Advertisement Create a free account Compendium in Game, Join Today

NPC macro layout (5e OGL)

1605905725

Edited 1605906017
Fellow rollers, I am trying to replicate the layout for the monster manual statblock into my roll20 for pure cosmetics . Is it possible, to get the "red line/divider" to continue in the same box (macro)? I am only able to create it with following " &{template:npcaction} {{name=}} {{rname=}} ." but it creates an unwanted gap. My current macro: &{template:npcaction} {{name=@{selected|npc_type}}} {{rname=@{selected|npc_name}}} {{description=Armor Class @{selected|npc_AC} (@{selected|npc_actype}) Hit Points @{selected|hp} (@{selected|npc_hpformula}) Speed @{selected|npc_speed} --------- red line --------- Senses @{selected|npc_senses} Languages @{npc_languages} Challenge @{npc_challenge} (@{npc_xp}) }} My "Gap" Macro: &{template:npcaction} {{name=@{selected|npc_type}}} {{rname=@{selected|npc_name}}} {{description=Armor Class @{selected|npc_AC} (@{selected|npc_actype}) Hit Points @{selected|hp} (@{selected|npc_hpformula}) Speed @{selected|npc_speed} }} &{template:npcaction} {{name=}} {{rname=}} {{description=Senses @{selected|npc_senses} Languages @{selected|npc_languages} Challenge @{selected|npc_challenge} (@{selected|npc_xp}) }} Thanks in advance.
1605907267
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If you have the red line as an image and store it somewhere on the internet (such as imgur), you can display it on its own line in your first macro as: [redline](imageURL)
1605912885

Edited 1606801614
Using Oosh's HTML Styles in Chat trick : &{template:npcaction} {{name=@{selected|npc_type}}} {{rname=@{selected|npc_name}}} {{description=Armor Class @{selected|npc_AC} (@{selected|npc_actype}) Hit Points @{selected|hp} (@{selected|npc_hpformula}) Speed @{selected|npc_speed} [ ](#" style="border: none; border-top: 0.25em solid transparent; border-bottom: 0.25em solid transparent; border-left: 14em solid #7e2d40; line-height: 1.25em; font-size: 1.05em; display: block)Senses @{selected|npc_senses} Languages @{selected|npc_languages} Challenge @{selected|npc_challenge} (@{selected|npc_xp})}}
WHAT??? Mind officially blown. I had no idea that red line was HTML.... wow!
1605932337
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Very nice trick, Jarren!
1605987612

Edited 1605988343
Jarren, Oosh and Keith thank you for your amazing input! BONUS QUESTION 1: Can one manipulate the "space/gap" above and below the red line by changing something in the code, so the wording is not directly above/beneath the line: [ ](#" style="border: none; border-top: 0.25em solid transparent; border-bottom: 0.25em solid transparent; border-left: 14em solid #7e2d40; line-height: 1.25em; font-size: 1.05em; display: block) BONUS QUESTION 2: Can one change the colour so the text becomes red like the title in the npc sheet/macros?
1605990492
I'll break down the parts of the code: [ ](#" style="border: none; border-top: 0.25em solid transparent; border-bottom: 0.25em solid transparent; border-left: 14em solid #7e2d40; line-height: 1.25em; font-size: 1.05em; display: block) The main part is the hidden anchor tag (an html link, typically for a website): [ ]() Whatever is inside the [ ] is the displayed code, so I just added a blank space there.  Whatever is inside the ( ) is what is linked. The way Roll20 parses this, is it changes things to create proper HTML code.  What Oosh figured out is that you can 'break' the html link by using a fake call of '#"' and add style information, which is what comes afterwards. At that point it's just understanding HTML/CSS style code.  The important thing for you to know here is each attribute is separated by a semicolon ';', and the very end of the line needs a closing parenthesis ')'. You can look up specific style tags to see if there are other options you'd like to use, but here's the breakdown of what is in the code I used: border-top: 0.25em solid transparent; --> This makes the top part of the line transparent border-bottom: 0.25em solid transparent; --> This makes the bottom part of the line transparent border-left: 14em solid #7e2d40; --> This makes the left part of the line solid red and 14 units wide line-height: 1.25em; --> This sets the height of the line font-size: 1.05em; --> This sets the height of the font display: block; --> This 'blocks' the display to start on a new line and use the whole width Bonus question 1 answer: You could either simply add a blank line before the red line in your code to add more space, or you can add 'margin-top' and 'margin-bottom' attributes to increase the space above and below the line. margin-top: 0.25em; margin-bottom: 0.25em; Bonus question 2 answer: You can change the color of the line by changing the color in the 'border-left' attribute: '#7e2d40' is the red currently used for the line and title.  You just need to find the hex reference for the color you want and use that.  The color in the macro is the same color that gets used by the 'npc_action' template, so I'm not sure what color you want to change it to. Bonus help: If you are using Google Chrome as your browser, you can right-click on the chat bar on whatever element you are curious about and click on 'inspect'.  (I think Firefox has a similar functionality.)  At the bottom of the sidebar that shows up on the right, you'll see all the CSS that is currently being displayed, which is how I figured out that the red arrow is just a line, not a graphical image.  The attributes that have a line strikethrough mean that they are being superceded by some other CSS, so look for the ones that don't have a strikethrough.
1605999088

Edited 1606801639
Double bonus trick:  If you want to make macros that don't have super long strings of html formatting in them, you can use another trick to clean up your macros: 1. Create a character named 'Div' 2. On the Attributes & Abilities page of the character sheet, create an ability named 'RedLine' 3. In the 'current' field for the RedLine ability, paste the entire final code you want to use, such as: (FYI I changed the 'display' attribute  in this example to 'inline-block' so that it'll be on its own line and look better in macros) [ ](#" style="border: none; border-top: 0.25em solid transparent; border-bottom: 0.25em solid transparent; border-left: 14em solid #7e2d40; line-height: 1.25em; font-size: 1.05em; margin-top: 0.25em; margin-bottom: 0.25em; display: inline-block) 4. In whichever macros you want to include the red line divider, just use this code: @{Div|RedLine} For example, your code above would look like this: &{template:npcaction} {{name=@{selected|npc_type}}} {{rname=@{selected|npc_name}}} {{description=Armor Class @{selected|npc_AC} (@{selected|npc_actype}) Hit Points @{selected|hp} (@{selected|npc_hpformula}) Speed @{selected|npc_speed} @{Div|RedLine} Senses @{selected|npc_senses} Languages @{selected|npc_languages} Challenge @{selected|npc_challenge} (@{selected|npc_xp}) }}  This is also nice because you can update ALL your macros to look the same, simply by modifying the 'RedLine' ability on the Div character sheet.  If you decide that you want all the lines to be blue, you just change the one piece of code and all future macro calls will be in blue instead.
Nice, Jarren.
1606017770
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Jarren, please post that in the Stupid Tricks thread. I’d link it but I’m on my phone. 
1606036606
keithcurtis said: Jarren, please post that in the Stupid Tricks thread. I’d link it but I’m on my phone.&nbsp; Done:&nbsp; <a href="https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones/?pageforid=9520178#post-9520178" rel="nofollow">https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones/?pageforid=9520178#post-9520178</a>
Jarren K, thank you for taking your time writing in the Stupid Tricks thread. I've learned so much, and I'm happy about I contributed with an idea which you converted into magic!
1606802083
Rasmus said: BONUS QUESTION 2: Can one change the colour so the text becomes red like the title in the npc sheet/macros? I just realized you were asking about changing the color of the text, not the line. You could change the font to look like almost anything you want.&nbsp; Here's the code: 1. I made the font red, bold, and removed the underline. Create attribute 'FontColor' on character 'Div': ](#" style="color: #7e2d40; font-weight: bold; text-decoration: none;) 2. Here's the macro for your statblock macro. You have to put a '[' before each item you want to adjust the color for. &amp;{template:npcaction} {{name=@{selected|npc_type}}} {{rname=@{selected|npc_name}}} {{description=[Armor Class@{Div|FontColor} @{selected|npc_AC} (@{selected|npc_actype}) [Hit Points@{Div|FontColor} @{selected|hp} (@{selected|npc_hpformula}) [Speed@{Div|FontColor} @{selected|npc_speed} @{Div|RedLine} [Senses@{Div|FontColor} @{selected|npc_senses} [Languages@{Div|FontColor} @{selected|npc_languages} [Challenge@{Div|FontColor} @{selected|npc_challenge} (@{selected|npc_xp}) }}
1606849194

Edited 1606849591
Hi Jarred, I managed to do something similiar by my self, but I was annoyed by the "red underline" whenever I hovered over the text. YOU MADE MY DAY! I took it one step further to make a "cosmetic replica" of the character sheet with red letters: [](#" style="color: #7e2d40; text-decoration: none;) Please have a look at my code to see if it is done correctly, and feel free to use it or give feed. You made this happen and I am very grateful!: @{selected|wtype}&amp;{template:npcaction} {{name=@{selected|npc_type}}} {{rname=@{selected|npc_name}}} {{description=[**Armor Class**](#" style="color: #7e2d40; font-weight: bold; text-decoration: none;) [@{selected|npc_AC} (@{selected|npc_actype})](#" style="color: #7e2d40; text-decoration: none;) [**Hit Points**](#" style="color: #7e2d40; font-weight: bold; text-decoration: none;) [@{selected|hp} (@{selected|npc_hpformula})](#" style="color: #7e2d40; text-decoration: none;) [**Speed**](#" style="color: #7e2d40; font-weight: bold; text-decoration: none;) [@{selected|npc_speed}](#" style="color: #7e2d40; text-decoration: none;) [ ](#" style="border: none; border-top: 0.25em solid transparent; border-bottom: 0.25em solid transparent; border-left: 14em solid #7e2d40; line-height: 1.25em; font-size: 1.05em; margin-top: 0.25em; margin-bottom: 0.25em; display: block) **STR** @{selected|strength} (+@{selected|strength_mod}) **DEX** @{selected|dexterity} (+@{selected|dexterity_mod}) **CON** @{selected|constitution} (+@{selected|constitution_mod}) **INT** @{selected|intelligence} (+@{selected|intelligence_mod}) **WIS** @{selected|wisdom} (+@{selected|wisdom_mod}) **CHA** @{selected|charisma} (+@{selected|charisma_mod}) }} See picture: BONUS QUESTION (if you have the time) If I want to be able to click on a word so it makes a roll (i.e. clicking the text '(9d8+18)') and then it will make a roll similar to if one clicked the same field on the NPC sheet?
1606861509
Yes that is possible -- you need to put the roll link in the parenthesis. Here's the list of the 5e by Roll20 sheet attributes:&nbsp; <a href="https://wiki.roll20.net/D%26D_5e_OGL_NPC_Attributes" rel="nofollow">https://wiki.roll20.net/D%26D_5e_OGL_NPC_Attributes</a> I can take a look later when I have time for the correct code setup.
1606868897
I've done this before, and I don't remember the specific reason but here's what I had to do: Create a macro named&nbsp;NPCRolledHP: &amp;{template:npcaction} &amp;{noerror}{{rname=@{selected|npc_name}}}{{name=Rolled HP}} {{description=**Rolled HP:** *[[@{selected|npc_hpformula}]]*}} Then here is the adjusted macro to add the button to the hp formula. You need a ! and the macro call on a separate line if I remember correctly: &amp;{template:npcaction} {{name=@{selected|npc_type}}} {{rname=@{selected|npc_name}}} {{description=[Armor Class@{Div|FontColor}: @{selected|npc_AC} (@{selected|npc_actype}) [Hit Points@{Div|FontColor}: @{selected|hp} ([@{selected|npc_hpformula}](! #NPCRolledHP)) [Speed@{Div|FontColor}: @{selected|npc_speed} @{Div|RedLine} [Senses@{Div|FontColor}: @{selected|npc_senses} [Languages@{Div|FontColor}: @{selected|npc_languages} [Challenge@{Div|FontColor}: @{selected|npc_challenge} (@{selected|npc_xp}) }} That will cause the npc_hpformula to be a button that you click on to call the NPCRolledHP macro which will display the rolled HP in a similar template. You could also just add a line with the rolled HP in the same macro. Putting the npc_hpformula inside [[ ]] will create an inline roll: &amp;{template:npcaction} {{name=@{selected|npc_type}}} {{rname=@{selected|npc_name}}} {{description=[Armor Class@{Div|FontColor}: @{selected|npc_AC} (@{selected|npc_actype}) [Hit Points@{Div|FontColor}: @{selected|hp} (@{selected|npc_hpformula}) [Rolled HP@{Div|FontColor}: [[@{selected|npc_hpformula}]] [Speed@{Div|FontColor}: @{selected|npc_speed} @{Div|RedLine} [Senses@{Div|FontColor}: @{selected|npc_senses} [Languages@{Div|FontColor}: @{selected|npc_languages} [Challenge@{Div|FontColor}: @{selected|npc_challenge} (@{selected|npc_xp}) }}
1606871901
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Rasmus, you may be able to glean some helpful stuff from this macro: NPC Statblock Chat Menu for D&amp;D 5e sheet — No API required!
1606883299
Last version here that includes the sheet built-in roll for the npc_hpformula.&nbsp; There's a big caveat on this one -- if you make this a collection macro, every time you open it up, Roll20 will parse the '&amp;#37;' html entity into a '%' and break the macro, and you'll have to re-enter the '&amp;#37;'. You can avoid that by using a macro mule character -- Roll20 does not parse html entities in character ability macros. @{selected|wtype} &amp;{template:npcaction} {{name=@{selected|npc_type}}} {{rname=@{selected|npc_name}}} {{description=[Armor Class@{Div|FontColor} @{selected|npc_AC} (@{selected|npc_actype}) [Hit Points@{Div|FontColor} @{selected|hp} ([@{selected|npc_hpformula}](! &amp;#37;{selected|npc_hpformula})) [Speed@{Div|FontColor} @{selected|npc_speed} @{Div|RedLine} [Senses@{Div|FontColor} @{selected|npc_senses} [Languages@{Div|FontColor} @{selected|npc_languages} [Challenge@{Div|FontColor} @{selected|npc_challenge} (@{selected|npc_xp}) }}