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

NPC directory Macro and Spreadsheet, Version 2

1534050688

Edited 1536299435
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Do you want your players to see portraits of the people involved in an encounter?&nbsp; Don't like opening a lot of handouts to show players whom they are talking with? Don't want to create a lot of character sheets for NPCs who will never see combat? This macro is for you. This is an update to a macro I posted last year. The intent is to give GMs a tool to use when having NPCs interact with the players. This macro uses a menu of NPCs. When you click the NPC's name, a picture is displayed to the players in the Chat Window, along with their name and a brief description. GM notes about the character are whispered immediately afterward. This update includes options to modify the macro for the most popular sheets, to make use of their roll templates for the output. The macro is created by entering a few simple lines of text for each character into a provided spreadsheet . The spreadsheet formats the macro, making html substitutions where necessary and outputting the final macro in a simple copy and paste format.&nbsp; The resulting macros can be used as standalone macros or saved as ability macros&nbsp; on a blank character sheet called "NPCs". &nbsp; The reason I created this was to have a nice library of NPCs within the play environment without clogging up the game with sheets that wouldn't really serve any purpose. By using web-hosted images, you also avoid any overhead in your image library. This macro does not require any API to run. To get the full benefit of this macro, you should create a character sheet called "NPCs" and give it an ability macro for each group of NPCs and a special menu ability macro to serve as a directory to all of the others. The directory menu is whispered to the GM, but the subdirectories (groups) can be made public or secret. Additionally, individual NPCs can be made public or secret. Once an NPC is clicked for display however, it will send an image to the chat window, along with publicly-available information and private whispered GM notes. The NPCs sheet is not necessary, but it does give you a nice way of organizing all of your NPC Directories. Here are some screen shots. This is an example of the master menu, using the Shaped Sheet for D&amp;D5e: Each one of those links will call up a sub menu of NPCs within that category. Here are some examples, using several different sheets. Pressing the button for one of these names displays the portrait, the public info and secret GM info like this: The blue background is what players see, the yellow part is what is whispered to the GM. As I have said, no API is needed to run this, and all pictures are from outside image repositories, not from the library, so the images will not count against your library storage limit. If you would like to sample it in action, simply paste this sample bit of code into any game. It uses the default roll template which is probably the least lovely, but it is universal. &amp;{template:default} {{name=Group One}} {{=Some powerful characters [Antioch](!/&amp;#13;[Image](<a href="https://i.imgur.com/AU21Jji.jpg&amp;#41" rel="nofollow">https://i.imgur.com/AU21Jji.jpg&amp;#41</a>; &amp;#13;** Antioch — **Killer with a heart of gold&amp;#13;/w gm Attoning for accidentally killing his brother) - *Human Assassin* [Kurtak](!/&amp;#13;[Image](<a href="https://i.imgur.com/gdpWOhW.jpg&amp;#41" rel="nofollow">https://i.imgur.com/gdpWOhW.jpg&amp;#41</a>; &amp;#13;** Kurtak — **Grim and practical barbarian of the southern wilds&amp;#13;/w gm Last of his tribe) - *Human Barbarbarian* [Galen Stromcaster](!/&amp;#13;[Image](<a href="https://i.imgur.com/qQQLj15.jpg&amp;#41" rel="nofollow">https://i.imgur.com/qQQLj15.jpg&amp;#41</a>; &amp;#13;** Galen Stromcaster — **Court Wizard to King of Akanar&amp;#13;/w gm Slowly rebuilding his mind and powers after a devastating encounter with a demon) - *Human Wizard* }} Instructions for creating the macros (much easier than it looks) These instructions are repeated on the spreadsheet itself. To use it,&nbsp; go to the link , save yourself a local copy and start entering information. The Columns are used as follows: Code &nbsp;= Enter a&nbsp; "W" &nbsp;next to a group name if you want that particular directory of NPCs to be whispered to the GM. Enter a&nbsp; "S" &nbsp;next to a particular NPC you want to remain secret. If there is no code, any player will be able to see the full NPC list and the portrait and public Description of that NPC. An NPC marked with an &nbsp;"S" &nbsp;will just show as a blank line in the directory. A list marked with a ""W"" won't show at all for a player, though any NPC you the DM click on will be displayed. Name or Group : Enter the name of a group (example:&nbsp; "Patrons of the Tavern" ) for a group directory macro, or an NPC name for an NPC within that group. If you do not add a title in the next column, the spreadsheet will know that this is the name of a group and not an NPC and format the code accordingly. An NPC name might be&nbsp; "Darion Heartshield" Subtitle : This is a very short description that will display in the NPC group directory. Example:&nbsp; "Elven Paladin"&nbsp; or&nbsp; "Mayor of Town" . If you leave this blank, the code will assume the name in the Name column is a group name, not an NPC name. Public Description : This is a longer description of the NPC, designed to display under the portrait. Example:&nbsp; "Elven Paladin of Kord, who once aided your party in getting through the Mountains of Terror. Has a halfling squire. Rather stuck-up" GM notes : These will not display to the players, and contains reminders of information you want secret. Example from above:&nbsp; "He is being hunted by a group of assassins, and hopes that by traveling with the NPCs, he will have the numbers to defend himself when they inevitably catch up to him. His sword is a Luck Blade." Image URL : This is the URL of an image to display to the players when you click the name of the NPC. Note that if you have not Whispered the Group Name or made the NPC Secret with the appropriate codes, players will be able to click on any displayed name in the group directory. This is useful if you want the players to be able to remind themselves who frequents the Broken Moon Tavern or are the Lords of the Council. The pictures are not drawn from the Image Library, but from the web at large, so an image repository such as Imgur or Photobucket is recommended, to avoid the possibility of broken links. All images will be reduced to fit the width of the chat window. Code to Paste:&nbsp; This is the final code to paste into individual ability macros on the "NPCs" character sheet. Each group has its own macro block beginning with&nbsp; "&amp;{template" &nbsp;or&nbsp; "/w gm &amp;template" &nbsp;depending on whether or not that group is whispered. The code block always ends with "}}" which closes the roll template. The NPC Ability action on the NPCs sheet MUST be named identically to the group name with the exception that any spaces will need to be replaced by hyphens. This is essential for the special directory menu to function properly. Menu Code : At the top right is a special field called "Menu Code" This is placed into it's own Ability macro on the NPCs sheet. It's purpose is to provide a menu for calling all the other macros. For it to function properly, copy that block into its own Ability Macro , but&nbsp; REMOVE THE QUOTE MARKS &nbsp;from the beginning and end of the code block. These are an unavoidable artifact of concatenating strings in Google Sheets. POWER CARDS: The format of Power Cards is completely different from the format of roll templates. There is a column for copying Power Cards just to the right of the regular copy column. NOTE: Like the directory Macro (which does not yet have a Power Card), you will have to strip out two quote marks, one at the beginning, and one directly after the group description (line 3 or 4, depending on whether that Power Card is whispered.) If you have any questions or problems, please me by PM on the Roll20 forums or respond in this thread for as long as it remains open. All character images were created by and are copyright of Keith Curtis
1534100454
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Beautiful Keith. I'll have to dive into this when I'm actually home
This is a really awesome macro, however I'm having a few issues with it and was hoping you might have a fix.&nbsp; First, whenever I edit the macro to add another npc or update info, all the " &amp;#13;" and " &amp;#41;" disappear. To get around this, I've copied the macro into a word doc and edit it there, copy pasting it to roll20 when i update it. Second, I'm having trouble trying to use a template other than default for 5e. Just changing " &amp;{template:default}" to " &amp;{template:npcaction}" for example doesn't work.
1536080597
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The first problem is due to the way that Roll20 handles HTML substitutions (and a large part of why this is parsed by an external spreadsheet). All substitutions are replaced when the macros is closed (saved). To make changes, you need to go back to the spreadsheet, or do the workaround you are using now. The spreadsheet is built to handle multiple lists, so you can keep all your data in the sheet. As for editing the template, where are you doing that? On the second tab? The table requires two entries: One for a title and one for the text. These things are titled differently on different templates. Title could be "title" or "name", for instance. The text could be "text", "desc", "description", or many others. To add a template to the dropdown, go to the second tab of the sheet. On a blank line in the table, add a sheet name (what sheet this is for), the template title, the tag for name and the tag for description. You should then be able to choose it from the dropdown on tab 1. Use the existing entries as a guide. If you have trouble, don't hesitate to ask for more help, and if you get it working smoothly, send me the template codes, and I'll add them to the spreadsheet template.
1536082029
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
In addition to Keith's excellent points. Not all templates allow custom fields. The ogl sheet for instance (which I'm assuming you're using based on the template name), doesn't allow anything beyond the fields it's coded for.
1536087774

Edited 1536087862
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Exactly. When I set this up, I went through some of the most commonly used sheets and tried to pick what I felt were the most aesthetic choices, working within the provided fields. Obviously that's a personal judgment call.
Ah, i see. I currently don't have excel, so I was just editing it in the roll20 macro field. I'll have to revisit it using the spreadsheet at some point. Thanks for the replies, and again, it is an awesome innovative macro you got here.
1536154809
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thank you! You don't need Excel though. The spreadsheet that is linked in this post is actually a google sheet and will run in any browser. You will probably need a google account (google, gmail, youtube--all the same thing) in order to save a local copy.
1536299508
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The NPC Directory Macro and Spreadsheet now supports Power Cards. Instructions have been added to the top post.
Hello Keithcurtis, I wonder if you can break down the macro. I am just interested in posting a image instead of getting a menu. I also try with PNG picture but somehow it dont work. Could you please help me how to do it?
1537384560

Edited 1537384577
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The actual macro code to display an image in chat is pretty straightforward, fortunately: [image](url) Any words can replace "image"—they won't display. "url" is of course, the web address of the picture you want to display. so for example: [invisibility potion](<a href="https://s3.amazonaws.com/files.d20.io/images/55627841/OIoIjDWSgbLWAkRFANj2TQ/original.jpg" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/55627841/OIoIjDWSgbLWAkRFANj2TQ/original.jpg</a>) will display this when you post it in chat, either manually, or with a macro: Image from Inkwell Ideas, used for demo purposes.
thx