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

1509225803

Edited 1546817348
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
This macro has been replaced by a later version. The new spreadsheet is cleaner and can handle most of the most commonly used roll templates. Find it here .  The purpose of the  linked spreadsheet is to generate macro code for creating a directory of NPC macros for yourself and your players.This is intended to generate the code for ability Macros to be created on a blank character sheet called "NPCs". All info is displayed to the GM and/or players in the Chat tab. The output is given as an image, name and public info, and whispered GM info. 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, but is engineered for the Roll Template created by the Shaped Sheet. Sorry, I'm not really familiar enough with any others to adapt it, but it should prove too difficult for someone with spreadsheet and template facility. To make this work, you will need to 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. Example of master menu macro, whispered to GM: Example of subdirectory or group menu. This can be secret or public. Individually hidden characters will display as a gap in the list: Final Output. This show a web-hosted image, public info and whispered GM notes: Notes on how to use the spreadsheet. These are repeated on the spreadsheet itself. To use it,  go to the link , save yourself a local copy and start entering information. The Columns are used as follows: Code = Enter a "W" next to a group name if you want that particular directory of NPCs to be whispered to the GM. Enter a "S" 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 "S" 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: "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 "Darion Heartshield" Subtitle : This is a very short description that will display in the NPC group directory. Example: "Elven Paladin"  or "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: "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: "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: This is the final code to paste into individual ability macros on the "NPCs" character sheet. A sample block is highlighted below. Each group has its own macro block beginning with "&{template" or "/w gm &template" 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 REMOVE THE QUOTE MARKS from the beginning and end of the code block. These are an unavoidable artifact of concatenating strings in Google Sheets. 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.
Very nice! Thanks for sharing this!
1509230935
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Anybody who tries this out, please let me know if anything doesn't work right or was mis-transcribed going from my personal sheet to the public one.