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

[Script] Reporter 1.x

September 16 (3 years ago)

Edited January 20 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

>>> Rough Video showing some of the things you can do with Reporter. <<<

There is an older version of this script on the forums, but since that thread has closed, and this is now available for One Click installation, I am creating a new thread. There are many new features since its original release. 

Reporter

Reporter reads the tokens on the board that are associated with character sheets and builds a report of them in the chat or to a handout, returning selected values from the token settings or the character sheets they are associated with.

Reporter has specific support for the D&D 5th Edition by Roll20, D&D5E Shaped, Pathfinder First Edition by Roll20, and Pathfinder Second Edition by Roll20 sheet. There is an option to choose Other for the sheet, which will disable the few sheet-specific shortcuts. It should work with most any sheet or no sheet at all. The first time you run the script, it will ask you to choose which sheet you are using. You can change this behavior with !report --config|sheet

Reporter contains special features that work well with other scripts, specifically, TokenmodChatSetAttrSupernotes and Token Action Maker. These are detailed below as appropriate. All items marked in [brackets] are optional. The constructed macro can become quite large, but there are many built-in macros in the menu button (!report --menu) to get you started.

You can either select a set of tokens to work with, or if you select no tokens, it will assume all tokens on the Object/Token layer. This behavior can be altered using keywords, described below. The basic syntax is:

Basic Syntax

!report[filters] --[queries] ---[buttonline] ----[keywords]

filters will search the token set and only return those which meet a specific set of criteria. Filters contain an operator, source, attribute, and value

queries are the part of the macro that decides which information is returned about the character/token pairs. Queries can contain optional dividers and aliases.

buttonline is a string containing text and Ability or API Command buttons.

keywords are options that change the overall appearance or scope of the report.

Each of these is documented below



Filters

Filters have changed since pre-release. Please check any previous macros. This was changed to make parsing possible for running multiple filters on the same report.

By default, Reporter uses the selected tokens to run a query, or if no tokens are selected, all tokens on the token/objects layer.

You may wish to constrain a report to only tokens which match a specific set of criteria. For example, you might have 50 tokens on the table, but only 10 of them are goblins, and you only want to work with the goblins. Or you want to find all the characters who are both PCs and have darkvision. You can add filters after the !report command. The filter is written using a similar syntax to a query, followed by the filter term. In essence, it is querying each token for a match. The syntax is:

!report||operator|source|attribute|value

You can add more filters just by adding double pipes to the end of the first filter and typing another.

There are four types of operator.
+ only includes the token/character pairs that matches the query
- excludes any token/character pair that exactly matches the query
~ only includes any character that is a partial match for the query
^ excludes any character that is a partial match for the query

thus:

!report||-|c|name|Goblin will return all tokens that are not represented by the Goblin character sheet.
!report||~|c|name|Goblin will return any tokens that are represented by the Goblin or Hobgoblin character sheet.
!report||-|c|npc|1||+|t|has_night_vision|true will exclude all NPCs (leaving only PCs), and then only return those that have nightvision set.


Filters do not support an alias (see below), because they are never displayed in the final report.
Filters are executed sequentially, with each filter working on the result from the last, so some logic is required for best results.
Filters are case insensitive.
There is as yet, no way to test for an empty, or undefined value.



Queries

Queries are the part of the macro that decides which information is returned about the character/token pairs. Queries are constructed using
t|attribute to poll a token attribute
c|attribute to poll a character sheet attribute

Queries are separated by a space

Examples
!report --t|name would return a report of all selected token names
!report --c|strength would return a report of all strength values on the character sheets of the selected tokens
!report --c|strength c|dexterity would return a report of all strength and dexterity values on the character sheets of the selected tokens


For character sheets, the script will try to pull a value from the character journal first, and if that does not exist, the installed character sheet. At this point in time, Reporter cannot return information that requires a callback, such as the GMNotes field. There are some built-in tools to access the Supernotes script if you have that installed.


Dividers

You may not always want each attribute reported on its own line. You can add a code after the attribute name(not the alias) to use something either than a line return between attributes

comma (,) Adds three non-breaking spaces between this attribute and the next, keeping them on the same line when possible.

period (.) Adds a vertical pipe between this attribute and the next, keeping them on the same line when possible.

dash (-) Adds a thin gray horizontal rule between this attribute and the next.

Hashtag (#) Adds a bit of horizontal space between this attribute and the next.

Examples:

!report --t|emits_low_light|Low-Light t|low_light_distance|Distance ---light

will return this:


but with the addition of a comma after the emits_low_light attribute:

!report --t|emits_low_light,|Low-Light t|low_light_distance|Distance ---light

it will return this:



Aliases
There are times in the report when you would not like 'has_bright_light_vision' in the report. You can substitute an alias for the attribute name that will display in chat. For this, just add another pipe after the query and type an alias.

For example, if a token has 60 feet of Night Vision:

t|night_vision_distance

might produce:
T: night_vision_distance = 60
but

t|night_vision_distance|NV

would yield:
T: NV= 60

If you use a hyphen (-) as the alias, it will display no label at all. You can turn on or off the graphic for the source (token or character) with source keyword described below.



Buttonline

The buttonline is a string containing text and Ability or API Command buttons. These are formed using the normal syntax for buttons: [button name](command) with a few exceptions. In order to keep the Roll20 parser from resolving queries and attribute calls before the script gets them, they need to be written slightly differently.
Examples:
@{token|name} is written as A{token|name}
?{question|default_answer} is written as Q{question|default_answer}

Further, for a handful of scripts, the Reporter API will attempt to parse the code so that each buttonline refers to the specific token being reported on. In this way, each buttonline can have a set of controls that apply to that specific token, without needing it to be selected. Currently Token Mod, ChatSetAttr and Supernotes are supported. It does this by injection the token id into the script calls for those scripts. Because of this, do not use --ids in a token-mod call, ChatSetAttr call, or --id in a Supernotes call.


Special Codes for Queries and Buttonlines

Reporter contains a few special codes for common cases, to make macro writing easier. You can put these in place of normal commands:
--vision as the Query will replace any declared query line with one designed to report most vision situations. It will give values for whether the token has sight, night vision and what the distance of any night vision is.
---vision as the Buttonline will replace any declared button line with a buttonline designed to handle most cases of vision and darkvision.

--light as the Query will replace any declared query line with one designed to report most lighting situations. It will give values for the amount of light, distance and what type.
---light as the Buttonline will replace any declared button line with a buttonline designed to handle most cases of lighting.

---actions as the Buttonline will replace any declared button line with a buttonline made up of the token action buttons associate with the character. This is designed for synergy with the Token Action Maker script, but is not essential. Not that the token actions created by this command cannot contain roll templates and will not convert the selected|commandname structure. this requires very careful parsing and is best avoided. It should work flawlessly with Token Action Maker commands, with the exception of the "Check" and "Save" buttons, for the reasons just mentioned.



Keywords

Keywords are options that change the overall appearance or scope of the report. They are separated from the rest of the report by four dashes and must come at the end of the macro.

layer|[gmlayer|objects|map|walls|tracker|all] will constrain the report to a particular layer or all layers at once, so long as no tokens are selected. If any tokens are selected, Reporter will default to the layer the selected tokens are on. This makes it easier for instance to check the vision settings of tokens on the token layer and the gmlayer simultaneously, or to ping pull to note tokens on the gm layer without switching manually to that layer. 

If the layer keyword layer|all is used the report will be on all token/character pairs on all layers. In this case, a layer character will appear on each subhead line of the report to let you know which layer the token is on.

If the layer keyword layer|tracker is used the report will be on all token/character pairs on the Turn Tracker as if it were a layer. In this case, a layer character will appear on each subhead line of the report to let you know which layer the token is on. If you click on the layer token, it will switch the token from the GM/Notes layer to the Token/Objects layer and back. 

compact|[true|false] (default=false): The compact mode shows the token image at half size, and eliminates the second line of the report subhead, since it is not always desired. You may have a very large report you want to see better, or you may be using a sheet that does not support the default values. Currently the second line of the subhead only references the D&D 5th Edition by Roll20 sheet and the Pathfinder 2 by Roll20 sheet.

showheader|[true|false] (default=true): This will control whether the header will display at the top of the report.

showfooter|[true|false] (default=true): This will control whether the footer will display at the bottom of the report.

showpageinfo[true|false] (default=false): this will include extra page information in header and/or footer, including some basic dynamic lighting controls for the page.

printbutton|[true|false] (default=false): This will control whether the print button will display on each line of the report.

visibility|[gm|whisper|all] (default=gm): This will determine how the report is presented. "gm" is whispered to the gm, "whisper" is whispered to the user who sent the command, "all" is posted openly for all to see.

Note Buttons This is a group of keywords that will place a button on the name line of the report for calling up various Supernotes commands. The visibility of the notes button is controlled by the visibility keyword. If the visibility is "gm", it will use a !gmnote command, if the If the visibility is "whisper", it will use a !selftnote command, and if the visibility is "all", it will use a !pcnote command. If the report is in the Chat tab, the notes will display in the chat tab, and if the report is set to be in a handout, the notes will in the handout, directly below the report. This can be used to create a handout that can run a report and display notes below. An example use could be a handout that can read map keys and display the notes for each map key, making an interactive dungeon map.

  • tokennotesbutton|[true|false] (default=false): If this keyword is set to true, the report will place a small shortcut button to return the contents of the reported tokens GM Notes field.
  • charnotesbutton|[true|false] (default=false): If this keyword is set to true, the report will place a small shortcut button to return the contents of the GM Notes field of the character assigned to the reported token.
  • biobutton|[true|false] (default=false): If this keyword is set to true, the report will place a small shortcut button to return the contents of the Bio Notes field of the character assigned to the reported token.
  • avatarbutton|[true|false] (default=false): If this keyword is set to true, the report will place a small shortcut button to return the Avatar of the character assigned to the reported token.
  • tooltipbutton|[true|false] (default=false): If this keyword is set to true, the report will place a small shortcut button to return contents of the reported tokens Tooltips field.
  • imagebutton|[true|false] (default=false): If this keyword is set to true, the report will place a small shortcut button to return images from the Bio field of the character assigned to the reported token.

source|[true|false] (default=true): if source is set to false, the C and T characters that show whether an attribute comes from the token or the sheet will not be displayed. Set this keyword to false if they are a distraction.

charactersheetlink|[true|false] (default=true): if this keyword is set to false, the link to open the token's corresponding character sheet will not display

charactersheetbutton[true|false] (default=false): if this keyword is set to true, the link to open the token's corresponding character sheet will be shown as a link graphic, and will not display the full name. If charactersheetlink is set to false, this command will do nothing.

subtitle|[true|false] (default=true): if this keyword is set to false, the line directly below the character name will not display. (This is also the default in Compact mode). This may be desirable if not using the D&D 5th Edition by Roll20 or Pathfinder 2 by Roll20 sheets.

ignoreselected|[true|false] (default=false): if this keyword is set to true, the search will not be preset to whichever tokens are selected. The report will run as if no tokens were selected, following whatever layer criteria might have been specified. See layer keyword above.

npcsubstitutions[true|false] (default=true): if this keyword is set to false, the script will not automatically substitute npc attributes for their PC counterparts (ex: npc_senses for passive_wisdom). Many sheets use a different attribute names for an NPC as opposed to a PC. Reporter know the most common pairs and will attempt to substitute when possible. Setting this to false may be needed for sheets that are not the D&D 5th Edition by Roll20 or Pathfinder 2 by Roll20 sheets.

sort|attribute (default is the raw order): This keyword will sort the final list. Most of the sorts are confined to the token attributes, since they require internal code and if they refer to a sheet may return poor or no results if the sheet does not have the proper attributes. Currently the following values can be sorted on: 

        charName: character name. Sheet must have a "name" attribute.
        charNameI: character name, inverse order. Sheet must have a "name" attribute.
        tokenName: token name
        tokenNameI: token name, inverse order.
        bar1: token bar1 value
        bar1I: token bar1 value, inverse order.
        bar2: token bar2 value
        bar2I: token bar2 value, inverse order.
        bar3: token bar3 value
        bar3I: token bar3 value, inverse order.
        cr - Challenge Rating. D&D 5th Edition by Roll20 Sheet only
        crI - Challenge Rating, inverse order. D&D 5th Edition by Roll20 Sheet only

title|Title| If this is present in the keywords, the string in between pipes will be placed at the top of the report. If you only want the custom title to display, be sure turn off the header with showheader|false. The title must be placed between two pipes. title|My Title| will work. title|My Title will break.

handout|Handoutname| If this is present in the keywords, the report will be sent to a handout instead of chat. This can allow a report to remain usable without scrolling through the chat. It can also be used as a sort of floating palette. Reports in handouts can be updated. Running the macro again will regenerate the table, as will pressing the Repeat button. The string in between pipes will be used as the name of the report handout. If no handout by that name exists, Reporter will create one and post a link in chat to open it. The title must be placed between two pipes. handout|My Handout| will work. handout|My Handout will break.

A report Handout automatically creates a horizontal rule at the top of the handout. Anything typed manually above that rule will be persistent. Reporter will not overwrite it. You can use this area to create Journal Command Buttons to generate new reports or to give some context to the existing report. All updates are live.

Examples:

!report ---- layer|gmlayer compact|true

will report on all the tokens on the gm layer in compact mode.

!report  ---- layer|tracker compact|true title|Tracker Navigator| showheader|false showfooter|false

will produce a compact report that will allow you to navigate around the tracker tokens on the board, with links to ping pull, switch layers, open character sheets and more.


Clicking on the GM layer character on Sadroth's line will move the token from the GM layer to the Token layer.

A more full featured Turn Tracker could include more info and macros:

!report --c|strength,|Str c|strength,|Dex c|strength|Con c|strength,|Int c|strength,|Wis c|strength#|Cha t|bar1_value,|HP c|npc_ac|AC c|npc_senses|perception t|statusmarkers|Condition ---[Apply Damage](!token-mod --set bar1_value|Q{Enter damage amount. Use positive or negative to modify values|-0}) | [Apply Condition](!token-mod --set statusmarkers|Q{Choose Status|Dead,dead|Bloodied,red}) ----layer|tracker compact|true title|Tracker Display| showheader|false showfooter|false source|false



How to Read a Report


Header. The header of the report will list the range of tokens being reported, by name, followed by the count. 

Report Line. The report line of each item will show an image of the token, followed by its token name and the associated character sheet name. If the character sheet is a renamed NPC statblock. ex. If Captain Hero is using the Veteran sheet, it will note this. It will also not if any of the characters have the PC flag.
The second line of the report will display the creature type for NPCs or the class and level for PCs. The second line is available for the D&D 5th Edition by Roll20  and Pathfinder 2 by Roll20 sheets only. and will probably return undefined on other sheets.

Click on:
Token image - Ping pull all players to the token's location.
Token Name - Ping pull only GM to the token's location. Invisible to players.
Character Name - Opens the associated character sheet.

Then follows a list of the attributes being requested.
Tindicates a token attribute.
Cindicates a character attribute.

The display of the source character can be turned off with the keyword source|false.

Button Line. This is the list of commands that can be performed on each token. If it is a command using TokenmodChatSetAttr or Supernotes, it will be specific to that token. Refer to Button Line documentation above for details.

Special Buttons. There are a few buttons that appear in the report, at various places on the right side.
☰ will call up the report script menu
⟲ will repeat the command that created the report, in case you want to confirm that changes were made.
w  will echo to the chat whatever is on that line: Token name on a report line, or Page name on the page line of the header.



One-line codes

The following are special codes that expand behind the scenes into full-featured macros, and handle some of the more common uses for Reporter. They are available through the menu button, or you can copy the code as displayed into any macro. Many of them require the synergy scripts mentioned at the top for some of their utility. One-line codes cannot receive extra keywords, they are built-in.

  • !report --vision ---vision - Use this command to check the vision of selected tokens. If you have no selected tokens, it will return a report of all tokens on the Token/Objects layer.
  • !report|vision - Shorthand for the above command. --vision and ---vision are special keywords that can be used as substitutes in any reporter macro.
  • !report --light ---light - Use this command to check the lighting of selected tokens. If you have no selected tokens, it will return a report of all tokens on the Token/Objects layer.
  • !report --light ---lightplus - A more detailed version of the above, with most common light sources.
  • !report|light - Shorthand for the above command. --light, ---light and ---lightplus are special keywords that can be used as substitutes in any reporter macro.
  • !report|help - Use this command display the documentation for the Reporter script. Also accepts !report --help
  • !report|mapkeys - Use this command to display a list of all objects on the gm layer that represent a character called Map Key You can use this to navigate around a map quickly and call up any token notes that might be placed in the Map Key tokens.
  • !report|mapkeys_sorted - As above, but sorted alphabetically.
  • !report|pcs-detail - A detailed display of all PCs on the map.
  • !report|pcs - A compact display of all PCs on the map.
  • !report|npcs-detail - A compact display of all PCs on the map.
  • !report|npcs-actions - A detailed display of all PCs on the map with most token action buttons displayed. Works very well with the Token Action Maker script.
  • !report|tracker - A compact display of all characters in the Turn Tracker.
  • !report|tracker-actions - A  display of all characters in the Turn Tracker with most token action buttons displayed.
  • !report|report - How to read the report. Also accepts !report --report


"That's all great Keith, but what can I use this for?"

I originally wrote this to be a tool to check lighting and vision for each token on each page in a module. The ability to grab a set or subset of tokens, filtered by criteria and then perform actions on those tokens has a huge number of uses. The One-Line Codes above are some of the most common.


Where's the code?

Reporter is available for One Click installation on your game's API page. 


Special thanks to The Aaron, TImmaugh, and Scott C. for being very patient with my endless "how do I..." questions.
September 16 (3 years ago)

Edited November 20 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Sample Macros


Default

!report

Without any arguments, the base command will just display the token id for every token in the report.



PCs

!report||+|c|npc|0  --t|has_bright_light_vision,|Sight t|night_vision_distance|NV  ---vision

This will find all PCs on the page. (The filter finds all tokens with an npc attribute of zero). This uses a custom vision report lines, but the default Vision buttonline. It could be written out completely as 

!report||+|c|npc|0  --t|has_bright_light_vision,|Sight t|night_vision_distance|NV  ---**Vision** [Off](!token-mod --set bright_vision|false has_night_vision|false) | [On](!token-mod --set bright_vision|true) **Night** [Off](!token-mod --set has_night_vision|true night_vision_distance|0 bright_vision|false) | [On](!token-mod --set night_vision|true) | [Distance](!token-mod --set has_night_vision|true night_vision_distance|Q{Set night vision distance|60} bright_vision|false has_night_vision|false)



City Sites

!report||+|t|bar3_max|?{Choose Type|Home,Home|Temple,Temple|Tavern,Tavern|Inn,Inn|Bridge,Bridge|Road,Road|Area,Area|Official,Official|Watchhouse,Watchhouse|Business,Business|Entertainment,Entertainment|Info,Info} --t|bar3_value|Who ---**Set** [Name](!token-mod --set name|"Q{name|Bob}") | [Inhabitant](!token-mod --set bar3_value|"Q{Who lives here|Bob}") | [Group](!token-mod --set bar3_max|Q{Choose Type|Home,Home|Temple,Temple|Tavern,Tavern|Inn,Inn|Bridge,Bridge|Road,Road|Area,Area|Official,Official|Watchhouse,Watchhouse|Business,Business|Entertainment,Entertainment|Info,Info}) | [Notes](!gmnote) ---- compact|true sort|tokenName source|false showheader|false visibility|whisper ignoreselected|true showfooter|false charactersheetlink|false title|?{Choose Type}|

This looks for all tokens with a specific value in their bar3|max bubble. All of the sites on my city map have a value in that bubble of Home, Temple, Tavern, Inn, Road, Area, Official, Watchhouse, Business, Entertainment, or Info. The query fills in one of those values and finds all corresponding tokens on the map. Note that the filter query is written as a normal query, with a question mark. This is because it needs to be interpreted when you run the macro. Only queries and attribute calls in the buttonline need to be escaped. Note that the bar3 value has a query for "Who lives here?". Because we only want that to be resolved when we run that particular buttonline macro for that specific token, it is escaped, so it doesn't ask you when you run the initial macro. Similarly, there is a button to change the assignment of what Group it is in (Home, temple, etc.), and a button to call up a Supernotes macro. Each site token has specific notes for that location.

The keywords included are compact|true to keep the report small,  sort|tokenName to srto alphabetically by name, source|false to keep the token/characetr source buttons from displaying showheader|false To keep the page info from displaying visibility|whisper to send the info to whomever issued the macro. This is not GM-prorpietary, since they are map pins for player use. ignoreselected|true so that the macro reads the whole map, regardless of the selection. showfooter|false to keep the report compact  charactersheetlink|false because all of the map pins link to a common character sheet  title|?{Choose Type}|  repeats the value returned from the first query as the title.

Also note, that you can put an API command button into one of the bar values. In the example below, the character Abigail Potts has her character sheet linked.



Combat Tracker

!report  --detail ---vision ---- showfooter|false showheader|false source|false title|Tracker Detail| layer|tracker

This pulls the tokens from the tracker, shows a mini character sheet, includes the default Vision buttonline and provides a custom header.


As a more combat-oriented variation you can run a version which provides all the token actions instead of the Vision commands. you can use:

!report|tracker-actions

or the command that it expands into:

!report -- ---actions ---- showfooter|false showheader|false source|false title|Tracker Actions| layer|tracker compact|true charactersheetbutton|true

This would give you all of the token action buttons below each entry.



Map Keys

This macro reads all of the tokens on the sheet corresponding to the character called "Map Key". It can easily be accessed by the compact command:

!report|mapkeys_sorted

which expands to

!report||+|t|represents|@{Map Key|character_id} ---  ---- layer|gmlayer compact|true sort|tokenName charactersheetlink|false notesbutton|true showprintbutton|false title|Map Keys| tokennotesbutton|true ignoreselected|true showheader|false

Given the following map with four map keys on the gm layer:


It will produce the following report:


Clicking on the letter token icon will drag players to that area of the map. Clicking on the name will drag the GM only. Clicking on the "T" button will call up the token notes, which contain the description of the room.


More...

These are some custom uses. You can also use the menu button in the header to call up many more:


September 16 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Reserved.

September 16 (3 years ago)
GiGs
Pro
Sheet Author
API Scripter

This looks pretty amazing. For the buttons that display character stats, are they fixed to the D&D setup or can it be configured to suit whatever system you are using?

September 16 (3 years ago)

Edited September 16 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Short Answer:

The predefined One Line Code buttons listed above in that last screenshot should work for both of the "supported" sheets: D&D 5th Edition by Roll20 and the Pathfinder 2 by Roll20.


Longer Answer:

There are some parts that are built-in. They are marked above as being supported on the D&D 5th Edition by Roll20 sheet and the Pathfinder 2 by Roll20 sheet. Mostly this is the line called "PC/NPC Info" in the "How to Read a Report diagram, and some PC/NPC substitutions.

In the former case, the script simply won't display that line if you are on a different sheet. The latter case is used for things that have different names on PC and NPC sheets. For instance, if you poll "ac" on a report, the script knows that it should grab "ac" on a Player Character, and "npc_ac" on an NPC. And vice versa. I've grabbed the most common substitutions. The list is currently very short, but could easily be expanded:

    const npcLookup =
        ((sheet === "PF2") ? {
                ["ac"]: "armor_class",
                ["repeating_senses_$0_sense"]: 'senses'
            } : {
                ["name"]: "npc_name",
                ["ac"]: "npc_ac",
                ["level"]: "npc_challenge",
                ["passive_wisdom"]: "npc_senses"
            }
        );

Outside of these cases, a character attribute query should work for other sheets, but I admit to not having done extensive testing.

One thing it does not handle is cycling through repeating attributes in a query, nor is it likely to.

September 16 (3 years ago)

Nice flexible looking script! As soon as I started reading I was thinking of the checking vision / lighting of all PCs, so wasn't surprised to see that later as the origin story. Thanks as ever Keith.

September 16 (3 years ago)
David M.
Pro
API Scripter

The density of information and layout of these reports are really impressive, Keith. 

 

September 16 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Geez, I wish it were as easy as that meme!

September 17 (3 years ago)

I love this script so much but I have 2 players that cannot use UDL :(  so I assume the vision scripts won't work.  

September 17 (3 years ago)
Gold
Forum Champion

Thanks keithcurtis, looks cool and probably extremely powerful in real use-cases!

Love the City Sites summaries method. Turn Tracker enhancement aspect is also killer.

Maybe somewhat over my head, but I'll try to implement some of this in my games, in time.

September 17 (3 years ago)

Edited September 17 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter


DM Eddie said:

I love this script so much but I have 2 players that cannot use UDL :(  so I assume the vision scripts won't work.  


I decided not to support LDL out of the box, but there is nothing that would prevent an LDL buttonline from working. Here is a quick and dirty example (minimally tested):

!report --t|light_hassight,|vision t|light_otherplayers|other_players_see? t|light_radius,|bright t|light_dimradius|dim ---[Snuff](!token-mod --set light_otherplayers|off light_radius|0 light_dimradius|0 light_angle|360) | [Sight](!token-mod --on showname light_hassight light_angle|360) | [Blind](!token-mod --off showname light_hassight light_angle|360) | [Spot](!token-mod --set light_otherplayers|on light_radius|5 light_dimradius|0 light_hassight|on light_angle|360) | [GM](!token-mod --set light_otherplayers|off light_hassight|off light_radius|5 light_dimradius|5 light_angle|360) | [Candle](!token-mod --set light_otherplayers|on light_radius|5 light_dimradius|0 light_angle|360) | [Lamp](!token-mod --set light_otherplayers|on light_radius|30 light_dimradius|15 light_angle|360) | [Torch](!token-mod --set light_otherplayers|on light_radius|40 light_dimradius|20 light_angle|360) | [Hooded Lantern](!token-mod --set light_otherplayers|on light_radius|60 light_dimradius|30 light_angle|360) | [Bullseye Lantern](!token-mod --set light_otherplayers|on light_radius|120 light_dimradius|60 light_angle|90) | [Darkvision](!token-mod --set light_otherplayers|off light_hassight|on light_radius|60 light_dimradius|0 light_angle|360) | [DV90](!token-mod --set light_otherplayers|off light_hassight|on light_radius|90 light_dimradius|0 light_angle|360) | [DV120](!token-mod --set light_otherplayers|off light_hassight|on light_radius|120 light_dimradius|0 light_angle|360) | [*Light*](!token-mod --set light_otherplayers|on light_radius|40 light_dimradius|20 light_angle|360) | [*Daylight*](!token-mod --set light_otherplayers|on light_radius|120 light_dimradius|60 light_angle|360) | [*Faerie Fire*](!token-mod --set light_otherplayers|on light_radius|1 light_angle|3600 light_dimradius|0 statusmarkers|purple light_angle|360) ----source|false


This points out a bug to me too. An alias (in this case "other_players_see") cannot have a space in it, or the script crashes. That can be prevented, but it's not good. I'll have a fix for that next week.


Unfortunately, I can't do much about the page commands, Those are internally coded. I could add LDL support, but I think that I'd just have to take it back out soon.

September 17 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

To produce that, I just opened up an old game, copied the lighting buttons from an LDL macro into the buttonline, and tried to remember the backwards way darkvision used to work. (I know some folks still have problems with UDL, but separating light and vision is such a better method). I had to use "other_players_see" instead of "darkvision" for the dv report, because in LDL, darkvision is "false" on "other players see light".

September 17 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter


Gold said:

Thanks keithcurtis, looks cool and probably extremely powerful in real use-cases!

Love the City Sites summaries method. Turn Tracker enhancement aspect is also killer.

Maybe somewhat over my head, but I'll try to implement some of this in my games, in time.

That's one of the reasons I hard-coded the most common use cases. the One-Line Code !report|tracker-actions is hopefully pretty straightforward.

I'm putting together a tutorial on the City Sites setup. It looks frightfully complex, but once you get the pieces in place, it's very quick.

September 17 (3 years ago)

Hi Keith, this script looks fantastic! Do you know if the Reporter API has a problem functioning with any other APIs that are installed? In my main game, with around 30 scripts installed, I have added your Reporter API, but I have no pop up message from Reporter and it is unresponsive to commands. However, in a relatively new game with around 5 scripts installed Reporter works flawlessly. I am using D&D 5E character sheet in all games. Here is a picture of all the scripts that are active.


September 17 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

It should be properly scoped and free of conflicts. I have about 40 active scripts in my game, about ⅔ of them are one click, and it installs and runs properly. I would check that universalChatMenu (the immediately preceding script) is properly terminated. My (installed and active) copy of universalChatMenu ends with:

on('ready', () => {
    'use strict';
    universalChatMenu.CheckInstall();
    universalChatMenu.RegisterEventHandlers();
});


Other than that, the only way to find these things is by turning off scripts one by one until you find the culprit. If you can isolate that and let me know, I can run tests to make sure that there is no disagreement between the two.

September 17 (3 years ago)

I managed to find the culprit. It was a script used to setup default UDL settings. This conflicted with both the Reporter and Univeralchatmenu API. Once disabled both scripts worked perfectly.

on('ready',function() {
    "use strict";

    if( state.daylight){
        state.daylight = {
            version: 'v1.0'
        };
    }
    log('-=> Loading Daylight '+ state.displayMarkers.version);

});

on('chat:message',msg=>{
    if(msg.type === 'api'){
        if (msg.content.split(' ')[0].toLowerCase() === '!daylight'){
            let page = getObj('page', Campaign().get('playerpageid'));
            
            if (msg.content.split(' ')[1].toLowerCase() === 'dusk') {
                
                page.set('dynamic_lighting_enabled',true);
                page.set('daylight_mode_enabled', true);
                page.set('explorer_mode','basic');
                page.set('lightupdatedrop',true);
                page.set('daylightModeOpacity',0.5);
                page.set('force_lighting_refresh',true);
                sendChat('daylight','The sun peaks over the horizon');
            } else if (msg.content.split(' ')[1].toLowerCase() === 'day') {
                
                page.set('dynamic_lighting_enabled',true);
                page.set('daylight_mode_enabled', true);
                page.set('explorer_mode','basic');
page.set('lightupdatedrop',true); page.set('daylightModeOpacity',1.0); page.set('force_lighting_refresh',true); sendChat('daylight','The Sun is blazing in the sky'); } else if (msg.content.split(' ')[1].toLowerCase() === 'night') { page.set('dynamic_lighting_enabled',true); page.set('daylight_mode_enabled', true); page.set('explorer_mode','basic');
page.set('lightupdatedrop',true); page.set('daylightModeOpacity',0.0); page.set('force_lighting_refresh',true); sendChat('daylight','The dark of night falls'); } else if (msg.content.split(' ')[1].toLowerCase() === 'moonlight') { page.set('dynamic_lighting_enabled',true); page.set('daylight_mode_enabled', true); page.set('explorer_mode','basic');
page.set('lightupdatedrop',true); page.set('daylightModeOpacity',0.2); page.set('force_lighting_refresh',true); sendChat('daylight','The moon shines bright'); } else if (msg.content.split(' ')[1].toLowerCase() === 'off') { page.set('dynamic_lighting_enabled',false); page.set('daylight_mode_enabled', false); page.set('explorer_mode','off'); page.set('lightupdatedrop',false); page.set('daylightModeOpacity',0.0); page.set('force_lighting_refresh',true); sendChat('daylight','Turning off UDL'); } } } });
September 17 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Glad you found it. I don't see anything problematic in that script, though. Weird.

As long as it works though, right?

September 18 (3 years ago)

Universalchatmenu and Reporter we’re both installed after that script so I’m not sure if that has anything to do with it. But  like you said as long as it works! 

September 18 (3 years ago)

Edited September 18 (3 years ago)
GiGs
Pro
Sheet Author
API Scripter

You could try adding that script back in, after the others, and see if it and others still work.

September 18 (3 years ago)

Good suggestion GiGs, the script works again without any conflicts after it is added again. Thanks!

September 18 (3 years ago)
GiGs
Pro
Sheet Author
API Scripter

Like Keith, I don't see why that script would cause issues. But since it does look like it was the culprit, it's something to kep in mind when you add more scripts - if they start failing, just delete this script again and move it to the end.

September 18 (3 years ago)

I just decided to disable that script for now as it was even preventing the tokens from moving in the Waypoint Patrol API for some reason.

September 19 (3 years ago)

Is this API 5E specific or can it be tailored to any game?

September 19 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

It has some built in logic for handling D&D 5th Edition by Roll20 Sheet and Pathfinder 2 by Roll20, but should work with other sheets. The tailored sheet features address some oddities of those sheets. Here are some keywords you might want to use if you are having issue with a different sheet. I have underlined the advice about using sheets other than those two:


subtitle|[true|false] (default=true): if this keyword is set to false, the line directly below the character name will not display. (This is also the default in Compact mode). This may be desirable if not using the D&D 5th Edition by Roll20 or Pathfinder 2 by Roll20 sheets.

npcsubstitutions[true|false] (default=true): if this keyword is set to false, the script will not automatically substitute npc attributes for their PC counterparts (ex: npc_senses for passive_wisdom). Many sheets use a different attribute names for an NPC as opposed to a PC. Reporter know the most common pairs and will attempt to substitute when possible. Setting this to false may be needed for sheets that are not the D&D 5th Edition by Roll20 or Pathfinder 2 by Roll20 sheets.


The subtitle referenced above is the "PC/NPC Info" in the diagram about how to read a report. Let me know if it gives you any issues with other sheets and I'll see what I can do to help.

September 20 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

How to build the City Navigator from the video

There is a demonstration of this at 5:19

Requirements

  • Reporter API script
  • Supernotes API script
  • A blank character named "Site".
  • Whatever graphics you want to use for map and map pins.

Overview

This is a set of macros that allow you to quickly navigate around a complicated map with many map pins that contain information about the areas. It is intended to be usable by GM and by Players, but has provisions for protecting secret information. You can use it to pull the GM or the GM plus Players to any pinned location, and to send information from that location to chat. It looks very complicated, but that's mostly due to methodically explaining each part.

Setup

Create a blank character named "Site". You can name it whatever you wish, but the macros below will assume "Site". Use any art you wish for an icon. You can have different icons for every map pin, but they must all represent the character "Site". Set the Permissions to "Can be controlled by All Players", if you intend the players to be able to use the map navigator. Set the icon to be a drawing, using the token's right click menu. You may want to save time by using a template default token for this and change the art using token-mod.

Create Wards

These are just sites that refer to areas or neighborhoods of the city: Examples could be Thieves Quarter, Noble Enclave, The Docks, etc. You can use a word other than ward, but the macros are written with that in mind. To make that Map Pin a ward area, write the word "Ward" into the Bar2 Max field:

Name the Ward Map Pin accordingly. I've named this example "Temple Heights":


Do this for every major area of the city.


Create some map pins

In the same way you set up the wards, assign other map pins to be specific locations. Name the pin to whatever the place is called, and place a keyword referring to its ward in the Bar3 Max. This keyword does not have to be an exact match. In fact, it should be a single word, no spaces. In this example, I have created a dwarvish temple called the House of Moradin, and used the keyword "Temple" to refer to all map pins that belong to Temple Heights.

At this point you can go onto the next, or you can add descriptive text for the area in the GM notes of the token. Here is the example for the House of Moradin:

And an example of what will be displayed in chat when you use the final script to tell Supernotes to call up its information (more on this later):



The Macros

Now it's time to make the macros. They look long, but there is a lot of code that is re-used and this can be changed without too much hassle. There are two macros: The navigator macro, which is a single macro which can be placed in the Abilities tab of the "Site" character and made to be a token action. The Navigator Macro  will appear whenever a map pin is selected. This is the macro I use, and I will explain it part by part.

!report||+|t|bar2_max|Ward --- ----compact|true sort|tokenName showheader|false showfooter|false tokennotesbutton|true visibility|all ignoreselected|true charactersheetlink|false title|Wards of the City|


!report||+|t|bar2_max|Ward tells Reporter to find and display all tokens on the map whose bar2_max is "Ward".

---  is an empty string for the Buttonline. We don't need it for this macro It's generally a good idea to keep it though, as it can cause parsing problems if it is not before the ---- required for keywords. If I were redoing the script from scratch, I'd fix that, but it would break a lot of existing macros.

---- indicates the keywords:

  • compact|true tells Reporter to keep the interface small and tight. There could be a lot of map pins
  • sort|tokenName tells Reporter to sort by token name, keeping the list of wards alphabetical
  • showheader|false tells Reporter to not show the page settings header
  • showfooter|false tells Reporter to not show the page settings footer
  • tokennotesbutton|true tells Reporter to show a "T" icon to send token notes to chat. This is essential for the next step, as we shall see.
  • visibility|all tells Reporter to let everyone see the results. You can change this to make it GM-only, or whispered to the user of the macro.
  • ignoreselected|true tells Reporter to not worry about which tokens are selected, but to use the entire page.
  • charactersheetlink|false tells Reporter to Not show a link for the "Site" Charcter sheet. All of our information is stored in the tokens, and all of the tokens refer to the same sheet. It's not needed.
  • title|Wards of the City|  tells Reporter to title the report "Wards of the City"


Here is an example of what I get when I run this on the City map in my video:



each of those lines refers to a different icon set to be a "Ward" Clicking on the icon will ping pull the players to that map pin, clicking on the name will pull only the GM. Clicking on the "T" button will pull up the Token Notes for that map pin. Now comes the big macro. You will need one of these for each ward. Map pins that refer to a single place within that ward will not need a macro.

The Ward Macro

Each ward will have a macro that will call up all of the map pin locations that have its keyword in their Bar3_Max field. It's big, but like before, I will break it down. I am going to use Southshore instead of Temple Heights for this one, because it has a little more variety. Temple Heights is almost entirely temples. :)

This macro will be formatted as a button, and will be stored in the GM notes field of the token. It's going to be called up and displayed when Reporter makes that Supernotes call referenced above (The "T" button in the previous screenshot)


That macro looks huge, but it is actually three buttons. One calls up streets of that ward, one calls up locations, and another calls up bridges. We are only going to look at one of them, in order to keep this simple. Really, you only need one, I just like fine tuning. Here is the button that calls up locations:

[Locations](!report||-|t|bar3_max|Road||~|t|bar2_max|Southshore --- ----compact|true sort|bar3_max source|false showheader|false printbutton|false notesbutton|true visibility|all tokennotesbutton|true ignoreselected|true showfooter|false charactersheetlink|false title|Locations in Southshore|)

and here is the breakdown:

[Locations] names the button. The actual macro is in the parentheses that follow.

!report||-|t|bar3_max|Road||~|t|bar2_max|Southshore tells Reporter to find all tokens that do not have "Road" as their bar3 keyword, but whose ward contains "Southshore". If you are not going to break out reads, you can simplfy this to:
!report||~|t|bar2_max|Southshore

  ---  is an again and empty string for the Buttonline. 

    ---- indicates the keywords:

    • compact|true tells Reporter to keep the interface small and tight. There could be a lot of map pins
    • sort|bar3_max tells Reporter to sort by bar 3 which contains the location type, which you created in bar3 when you set up the map pins.
    • showheader|false tells Reporter to not show the page settings header
    • showfooter|false tells Reporter to not show the page settings footer
    • tokennotesbutton|true tells Reporter to show a "T" icon to send token notes to chat. 
    • visibility|all tells Reporter to let everyone see the results. You can change this to make it GM-only, or whispered to the user of the macro.
    • ignoreselected|true tells Reporter to not worry about which tokens are selected, but to use the entire page.
    • charactersheetlink|false tells Reporter to Not show a link for the "Site" Charcter sheet. All of our information is stored in the tokens, and all of the tokens refer to the same sheet. It's not needed.
    • title|Locations in Southshore|  tells Reporter to title the report "Locations in Southshore"

    These keywords are almost identical to the ones in the Navigator macro.

    If we we use the Navigator macro, it will give us a list of the Wards. Clicking on the "T"oken Notes button in that report will return the GMNotes of the Ward token, containing the  Ward Macro. It will look something like this:

    Clicking on that "Locations" button will yield a report of all of the Map Pins that have the Southshore keyword in their bar2 max, and sorted by the location type in their bar3 max:


    That bar3 max keyword could be things like "tavern", "temple", "tower", etc. Again, clicking on the icon will ping pull the players to that map pin, clicking on the name will pull only the GM. Clicking on the "T" button will pull up the Token Notes for that map pin. Since the map pin is a location this time, and not a ward, it requires no macro code in the token notes, just a description. In this case, I can click on the "Broken Moon" token notes button and send a description of that location to the chat:


    That should be enough to explain the general principle. When I have a bit more time, I'll post the full macro that separates streets, locations and bridges, and show you how to keep some information secret only to the GM.

    September 22 (3 years ago)
    keithcurtis
    Forum Champion
    Marketplace Creator
    API Scripter

    New Feature: Handouts

    This is a new keyword you can add to the keywords section

    handout|Handoutname| If this is present in the keywords, the report will be sent to a handout instead of chat. This can allow a report to remain usable and visible without scrolling through the chat. It can also be used as a sort of floating palette. Reports in handouts can be updated. Running the macro again will regenerate the table, as will pressing the Repeat button. The string in between pipes will be used as the name of the report handout. If no handout by that name exists, Reporter will create one and post a link in chat to open it. The title must be placed between two pipes. handout|My Handout| will work. handout|My Handout will break.

    A report Handout automatically creates a horizontal rule at the top of the handout. Anything typed manually above that rule will be persistent. Reporter will not overwrite it. You can use this area to create Journal Command Buttons to generate new reports or to give some context to the existing report. All updates are live. Handout cannot be popped out into its own window.


    Quick Youtube Video

    Tracker screenshots:


    September 22 (3 years ago)
    Gold
    Forum Champion

    clever! I've got some work to do, to set this up for some of my old Roll20 towns!

    September 28 (3 years ago)
    keithcurtis
    Forum Champion
    Marketplace Creator
    API Scripter

    The next version of Reporter will allow you to specify the sheet you are using via a config command. This will simplify a lot of things (it now longer needs to test the sheet to figure this out, which always threw up false "error" messages in the API log, for instance.

    The script currently supports the official sheets for DnD5e and PF2, and "other". By support, I mean:

    1) It knows how to differentiate between PC and NPC attribute names and switch them on the fly. For instance, on the 5e sheet, if you run a query on "ac", it knows to pull the "ac" from a player sheet, and "npc_ac" from an npc sheet.

    2) A few of the built-in shortcuts are tailored for that sheet. For example, !report|pcs-detail creates a slightly different report for 5e as for pf2.


    Number 2 can be accounted for by ignoring the built in shortcuts and building your own, of course., but it's handy to have them. "Other" just means that the script ignores the npc/pc difference, and just returns simplified results when using a query tailored for a specific sheet.


    Are there any other sheets that should be supported?

    According to the latest Orr Report, PF1 and Call of Cthulhu are fairly popular. Also, 5e Shaped is likely a good candidate. The problem is, I'm not familiar with all of those. If anyone is, and would like their sheet supported, it would help me tremendously if you could provide:

    A list of attributes that would go into a detail report. This would be equivalent to what is shown in the dnd5e report:


    Also, if there is a pc/npc divide in the sheet, some indication of what attribute names change. For example, here is the list used for dnd5e:

    "name" : "npc_name",
    "ac" : "npc_ac",
    "level" : "npc_challenge",
    "passive_wisdom" : "npc_senses" 


    September 29 (3 years ago)
    keithcurtis
    Forum Champion
    Marketplace Creator
    API Scripter

    The D&D 5E Shaped sheet and the Pathfinder First Edition by Roll 20 sheet will both be fully supported by next week's (October) pull. The full list now is:

    • D&D 5th Edition by Roll20
    • D&D 5E Shaped
    • Pathfinder First Edition by Roll20
    • Pathfinder Second Edition by Roll20
    • Other (ignores special sheet-related features)
    October 06 (3 years ago)

    Edited October 06 (3 years ago)
    keithcurtis
    Forum Champion
    Marketplace Creator
    API Scripter

    The latest version (1.1.4) has been added to One Click. The first time you run the latest version, it will ask you to choose which sheet you are running. If your sheet is not in the supported list, choose "Other". All this will mean is that you will lose a few of the built-in shortcut searches.

    October 07 (3 years ago)

    Keith,


    I've already setup a long time ago a blank character sheet named POI using supernotes.


    I don't see any reference to the chracter sheet name in your macros (maybe I'm blind), How can I change them for my POI character sheet ?


    Setup

    Create a blank character named "Site". You can name it whatever you wish, but the macros below will assume "Site". Use any art you wish for an icon. You can have different icons for every map pin, but they must all represent the character "Site". Set the Permissions to "Can be controlled by All Players", if you intend the players to be able to use the map navigator. Set the icon to be a drawing, using the token's right click menu. You may want to save time by using a template default token for this and change the art using token-mod.

    October 07 (3 years ago)
    keithcurtis
    Forum Champion
    Marketplace Creator
    API Scripter

    You're actually right. I think I had conflated what I have done for other similar solutions. Having the "Site" or "POI" character is still desirable, since it allows you to set up the navigator macro as a token ability button that shows up when you select any site. If you make modifications to that, all of your tokens are automatically updated.

    The macros actually search for a ward name in bar2_max and a classification in bar3_max. If you want to limit the tests to POI tokens, change the navigator macro to:

    !report||+|c|name|POI||+|t|bar2_max|Ward --- ----compact|true sort|tokenName showheader|false showfooter|false tokennotesbutton|true visibility|all ignoreselected|true charactersheetlink|false title|Wards of the City|

    basically, add 

    ||+|c|name|POI

    after !report


    Having a site character also allows for other kinds of searches based on the selected token. For example I have one called "More Like This" that allows you to select the same type of token throughout the city, regardless of ward. It starts with:

    !report||+|t|bar3_max|@{selected|bar3|max}

    Which means if you have a tavern selected ("tavern" is in bar3_max), it will return a list of every tavern in the city.


    Also, next week's update will have a new title keyword option called overtitle that will assume showheader|false showfooter|false. It could be written as:

    !report||+|c|name|POI||+|t|bar2_max|Ward --- ----compact|true sort|tokenName tokennotesbutton|true visibility|all ignoreselected|true charactersheetlink|false overtitle|Wards of the City|
    after the update.


    October 08 (3 years ago)

    Thx !

    keithcurtis said:

    You're actually right. I think I had conflated what I have done for other similar solutions. Having the "Site" or "POI" character is still desirable, since it allows you to set up the navigator macro as a token ability button that shows up when you select any site. If you make modifications to that, all of your tokens are automatically updated.

    The macros actually search for a ward name in bar2_max and a classification in bar3_max. If you want to limit the tests to POI tokens, change the navigator macro to:

    !report||+|c|name|POI||+|t|bar2_max|Ward --- ----compact|true sort|tokenName showheader|false showfooter|false tokennotesbutton|true visibility|all ignoreselected|true charactersheetlink|false title|Wards of the City|

    basically, add 

    ||+|c|name|POI

    after !report


    Having a site character also allows for other kinds of searches based on the selected token. For example I have one called "More Like This" that allows you to select the same type of token throughout the city, regardless of ward. It starts with:

    !report||+|t|bar3_max|@{selected|bar3|max}

    Which means if you have a tavern selected ("tavern" is in bar3_max), it will return a list of every tavern in the city.


    Also, next week's update will have a new title keyword option called overtitle that will assume showheader|false showfooter|false. It could be written as:

    !report||+|c|name|POI||+|t|bar2_max|Ward --- ----compact|true sort|tokenName tokennotesbutton|true visibility|all ignoreselected|true charactersheetlink|false overtitle|Wards of the City|
    after the update.





    November 20 (3 years ago)

    One small error in the instructions below : the character has to be called Map Key not Map Keys.

    Cheers

    Map Keys

    This macro reads all of the tokens on the sheet corresponding to the character called "Map Keys". It can easily be accessed by the compact command:
    !report|mapkeys_sorted
    which expands to
    !report||+|t|represents|@{Map Key|character_id} ---  ---- layer|gmlayer compact|true sort|tokenName charactersheetlink|false notesbutton|true showprintbutton|false title|Map Keys| tokennotesbutton|true ignoreselected|true showheader|false
    Given the following map with four map keys on the gm layer:


    It will produce the following report:


    Clicking on the letter token icon will drag players to that area of the map. Clicking on the name will drag the GM only. Clicking on the "T" button will call up the token notes, which contain the description of the room.

    November 21 (3 years ago)

    Hello Keith,

    Loving this script !

    I wanted to have the Map Keys report in an handout using the ---- handout command. It creates the handout but loose the functionnality to call the Token notes. Any workaround ?

    seb.

    November 21 (3 years ago)
    keithcurtis
    Forum Champion
    Marketplace Creator
    API Scripter

    Couple of things to check. First, are you getting the token notes button to show up (the T in the gray box on the right hand side)?

    Token notes is installed and working otherwise?

    Also, the token notes should appear in chat. There is no functionality to cause them to appear in the handout at this time.

    November 21 (3 years ago)


    keithcurtis said:

    Couple of things to check. First, are you getting the token notes button to show up (the T in the gray box on the right hand side)?

    Token notes is installed and working otherwise?

    Also, the token notes should appear in chat. There is no functionality to cause them to appear in the handout at this time.

    Yes, It works as intended in Chat (The T box appears) not in handout.




    November 22 (3 years ago)
    keithcurtis
    Forum Champion
    Marketplace Creator
    API Scripter

    Please post the macro you are using in the handout. I'll see if I can discover what's going awry. If that doesn't work, you can PM me an invite to your game if you wish, and I'll see if I can figure out what's going wrong there.

    November 22 (3 years ago)

    I just use !report|mapkeys_sorted ----handout|Key|

    November 22 (3 years ago)

    Edited November 22 (3 years ago)
    keithcurtis
    Forum Champion
    Marketplace Creator
    API Scripter

    Thanks, I can see the problem now.

    !report|mapkeys and !report|mapkeys_sorted are One-line Codes, shortcuts that replace entire lines of code, entire macros (see documentation in top post). They can't receive modifications in any useful way. If you want to modify them, you need to expand them out to their full value and add the modifications here. I'll see if I can come up with a workaround that won't break anything else. Until then, this code should work. It's what the script expands out to, with the addition of handout|Key|:

    !report||+|t|represents|@{Map Key|character_id} ---  ---- layer|gmlayer compact|true sort|tokenName charactersheetlink|false notesbutton|true showprintbutton|false title|Map Keys| tokennotesbutton|true ignoreselected|true showheader|false handout|Key|



    November 22 (3 years ago)
    keithcurtis
    Forum Champion
    Marketplace Creator
    API Scripter

    I've added that caveat to the documentation. I should probably include what each One-line code expands to, in case folks want to modify them. Thanks.

    November 22 (3 years ago)


    keithcurtis said:

    I've added that caveat to the documentation. I should probably include what each One-line code expands to, in case folks want to modify them. Thanks.


    it works like a charm !

    Thx one again :-)


    January 20 (3 years ago)

    Edited January 20 (3 years ago)
    keithcurtis
    Forum Champion
    Marketplace Creator
    API Scripter

    New feature: Improved Supernotes Integration

    I have added 5 new keywords to add synergy with Supernotes and to expand upon the existing tokennotesbutton keyword. These keywords create small buttons that appear on each line of the report that call up Supernotes commands. These buttons require Supernotes to be installed (Available from the Roll20 One Click installer). If Supernotes is not installed, the buttons will still display but will have no effect. If the report is in the Chat tab, the notes will display in the chat tab, and if the report is set to be in a handout, the notes will in the handout, directly below the report. This can be used to create a handout that can run a report and display notes below. An example use could be a handout that can read map pins and display the notes for each map pin, making an interactive city guide.

    tokennotesbutton|[true|false] (default=false): If this keyword is set to true, the report will place a small shortcut button to return the contents of the reported tokens GM Notes field.
    charnotesbutton|[true|false] (default=false): If this keyword is set to true, the report will place a small shortcut button to return the contents of the GM Notes field of the character assigned to the reported token.
    biobutton|[true|false] (default=false): If this keyword is set to true, the report will place a small shortcut button to return the contents of the Bio Notes field of the character assigned to the reported token.
    avatarbutton|[true|false] (default=false): If this keyword is set to true, the report will place a small shortcut button to return the Avatar of the character assigned to the reported token.
    tooltipbutton|[true|false] (default=false): If this keyword is set to true, the report will place a small shortcut button to return contents of the reported tokens Tooltips field.
    imagebutton|[true|false] (default=false): If this keyword is set to true, the report will place a small shortcut button to return images from the Bio field of the character assigned to the reported token.


    Supernotes has been updated to respect Reporter's new commands, but there is no user-facing change to that script.


    Some screen shots of the interaction in... action.

    This is from my city navigator macros described above. Clicking on the "T" at the end of each report line will cause the token notes to appear below the report int he handout. You can click any other "T" and display the notes for that line without closing or refreshing the handout. This would work very well with a macro/handout that reads map key tokens that have room descriptions in them.



    Click a different line to change the note text.


    March 07 (3 years ago)
    keithcurtis
    Forum Champion
    Marketplace Creator
    API Scripter

    I've talked to a couple of people, and I want to make the map pin process much simpler and more automatic to use. I might try to put the functionality in Reporter, but that kind of expands its purview, so it might be a separate support script.

    I envision being able to make lists of criteria in the the character sheet that represents the map pins, and have Reporter read from that dynamically, as well as being able to assign them as tags to the tokens. I'm open to ideas on ways to make map pins and keys simpler to implement, though.