LordAshes-ResultProtocolPlugin icon

ResultProtocolPlugin

Adds support for result protocol allowing rolls outside of Talespire to be rolled and posted in Talespire.

Last updated 8 months ago
Total downloads 596
Total rating 0 
Categories Tweaks Networked Tools Integration Assets
Dependency string LordAshes-ResultProtocolPlugin-2.0.1
Dependants 0 other packages depend on this package

This mod requires the following mods to function

bbepisTaleSpire-BepInExPack-5.4.10 icon
bbepisTaleSpire-BepInExPack

Unified BepInEx all-in-one modding pack - plugin framework, detour library

Preferred version: 5.4.10
brcoding-SetInjectionFlagPlugin-2.3.0 icon
brcoding-SetInjectionFlagPlugin

Allows players to flag mods are installed

Preferred version: 2.3.0
LordAshes-AssetDataPlugin-2.0.2 icon
LordAshes-AssetDataPlugin

Dependency plugin for subscription/notification based data storage and message exchange.

Preferred version: 2.0.2
LordAshes-FileAccessPlugin-1.4.1 icon
LordAshes-FileAccessPlugin

Provides standardized methods for accessing both local file and url resources. Automatically handles searching local folders for assets.

Preferred version: 1.4.1

README

Result Protocol Plugin

This unofficial TaleSpire plugin adds a result protocol to the Talespire URL Relay allowing rolls outside of Talespire to be rolled and posted in Talespire. Contains an option to show spinning dice in Talespire or just posting the results. Comes with a Chrome Extension to post DnD Beyond rolls to Talespire.

Warning: This version is not backwards compatible with the previous version. The request URL will need to be modified slightly to make previous version URLs work with this version.

This plugin, like all others, is free but if you want to donate, use: http://LordAshes.ca/TalespireDonate/Donate.php

Change Log

2.0.1: Added partial support for foreign characters
2.0.0: Rewrote after BR update
1.0.1: Added Chrome Extension for Roll20. No plugin change.
1.0.0: Initial release

Install

Install using R2ModMan or similar.

The plugin contains a configuration which determines if you want to see the spinning dice in Talespire or not. Please note that the spinning dice are not actual dice rolls, they show up in the center of the view and spin ending on the posted results.

Unlike most other Chrome Extension solutions, this solution does not need Beyond Link via Chrome.

With Dnd Beyond Or Roll20

Install the DnD Beyond Roller or Roll20 Roller Chrome Extension

Usage

With DnD Beyond Or Roll20

1. Start Talespire with the plugin installed.
2. Open up a Dnd Beyond Or Roll20 Character sheet.
3. Click on any element that causes a dice roll.
   (Dice rolls are limited to anything in the format #D#+# which means the plugin does not
    support multiple dice rolls at once such as #D#+#+#D#+#).
4. After the result is generated in Dnd Beyond or Roll20, the same result will be optionally rolled
   and then disaplayed in Talspire.
5. If using Dnd Beyond, before making additional rolls make sure that the previous result is clear.
   Failure to do so will mean that the result will not get posted in Talespire correctly.

Note: Do not use Roll With Advantage or Roll With Disadvantage options, they are not supported.

With Other Sources

This plugin, while enabled, adds a new result protocol to the Talespire URL Relay. This means that any application or web page that can request a URL should be able to trigger this functionality. The format for the protocol is:

talespire://result/name:formula/die1/die2/die3/...

Where formula is in the form #D#+# or #D#-#. Note that the modifier is not optional so if the roll does not have a modifier a value of 0 needs to be used. For example, 1D4+0 not 1D4.

For example, for a greatsword damage roll might look like:

talespire://result/Greatsword(Damage):2D6+4/3,6

The number of entries after the formula, separated by commas, must match the formula. If there are extra entries they will be ignored but insufficient entries will cause an error.

It is possibe to concatinate multiple formulas with either + or -. For example:

talespire://result/Greatsword(Attack):1D20+5+1D4+0/15,3

It is also possible to do complex rolls involing more than one name roll. For example:

talespire://result/Greatsword(Attack):1D20+5+1D4+0/15,3/Greatsword(Damage):2D6+4/3,6

From Javascript (such as Chrome Extension or your own web page) you can use:

let url = "talespire://result/Attack:1D20+7/15"
window.open(url, "_blank");

The plugin has also added support for:

talespire://chat/message

and

talespire://system/message

The first send a chat message to all players. The second displays a system messge on all players.

The Three Views

Currently the plugin supports three views of the results, one of which is optional.

Dice View (optional)

The dice view, which is optional and can be turned off in the configuration, displays dice, representing each die used in the roll, in the middle of the screen and rotates them until they stop of the posted results. This is not a real roll, just a fake representation of a roll if an element of suspense is desired. However, using this option can make rolling take much longer especially when using a 3rd party application like Dnd Beyond or Roll20 because the dice need to roll and stop in that application and only then would they trigger the fake roll in Talespire.

Screen View

The dice are summarized in a on screen table indicated the number of dice rolled in each group, the type of dice rolled, the results and the sub-total of that group. This view does not apply any modifiers or final total. It also provides information for all rolls in the roll posting (in the case of complex dice rolls).

Chat View

The result is displayed in chat. The format used is highly configurable to display the information in whatever layout is desirable. See Customization section below.

Good And Bad

As compare to the previous version of the plugin, some changes are good and some are bad. Here is a highlight of the most important differences:

Bad

  1. The plugin no longer uses the core dice display code. The latest BR update has made it difficult to build a proper object that the core code will accept to post the dice results. I tried for multiple hours but failed. As a result, I decided to use my own dice resporting routines. This, however, means that the posted results aren't seen as dice results by other plugins such as the Initiative plugin.

  2. The format of the request URL has been changed a tiny bit to make it more in line with the core Talespire protocol requests. Any existing application compatible with the previous version of this plugin will need to be adjusted slightly to use the new URL format.

  3. Screen View does not show modifiers or a total, only the dice roll information and the dice group's sub-total.

Good

  1. Not that the posted results use a different method to post other than the core TS code, it is possible to determine which results were actually rolled and which came from a different source (i.e. were posted results). In the previous version since both actual rolls and posted rolls used the same code, it was hard to tell the source.

  2. Posted content supports multi forumla rolls and complex rolls.

  3. Chat View is highly configurable in terms of the display layout.

Foreign Character Support

The talespire://result// protocol supports foreign characters in the roll name. A spot check of foreign characters where used to verify that the roll name appears correctly in the Chat View.

However, the chat message header (usally modified using Chat Service square brackets) uses a different font and this font does not render foreign characters as expected. So do not generate chat message headers with foreign characters.

The protocol also supports foreign characters in the player and creature name. Talespire does not really support that (they will show up as spaces when renaming) but it can be done. However, such messages will show up as coming from the local player because the foreign characters prevent the system from correctly finding the creature.

The talespire://chat// protocol has the same limitations as above. Foreign characters are supported except in the chat message header.

The talespire://system// protocol used the same or similar font as the chat header and thus does not render foreign characteres correctly.

Customization

Chat Layout

The configuration has an entry for the chat layout (chat pattern). The contents of this configuration is used to generate the chat message. The layout uses place holders to indicate which information is inserted into the layout at which point. Anything that is not a place holder or the new line | character, is inserted into the display message as is.

The layout has 5 sections to it separated by the ^ character. Each section is explained below:

Section 1: Request Header: Displayed once for the entire request (all complex roll segments). Typically used to insert the player name or date/time into the display but can also be used with Chat Service to modify the default chat header for the message.

Section 2: Roll Header: Displayed once per roll segment. Typically used to display the roll name, formula or even total.

Section 3: Roll Content: Displayed once per roll segment formula. Typically used to display the roll, roll results, and sub-total. For example, Attack:1D20+4+1D4+0 would have one Roll Header but two Roll Content (1D20+5 and 1D4+0).

Section 4: Roll Footer: Displayed once per roll segment. Typically used to display the roll total if being displayed at the end of the roll content information.

Section 5: Request Footer: Displayed once for the entire request . Typically not used but can be used to display the sum (which is the total of all roll segments).

Each section can use place holders to insert actual data. Not all place holders are applicable for each section. For example, {Rolls} is only applicable in the Roll Content section because outside that section a roll can have many rolls and thus many resulting dice rolls.

{Creature} = Inserts the creature name (selected when the posting was made) {Player} = Inserts the player name of the player who made the posting {Date} = Inserts the date in y.m.d format {Time} = Inserts the time in h:m:s format {Sum} = Total of all roll segments (in the case of complex rolls) {Total} = Total of the current roll segment {Subtotal} = Total of the current formula in the current roll segment {Formula} = The complete formula of the current roll segment {Num} = Total number of dice in the current formula in the current roll segment {Sides} = Total number of sides on the dice in the current formula in the current roll segment {Mod} = Total (signed) modifier of the current formula in the current roll segment {Join} = The + or - character joining multiple formulas in a roll segment (blank if none) {Rolls} = Roll values seperated by commas.

The | character is used in the layout to denote a new line.

Example:

[{Creature}\' Roll]^{Roll} ({Formula}): {Total}|^{Num}D{Sides}{Mod}=[{Rolls}]{Mod}={Subtotal}|{Join}^^

Section 1: [{Creature}\' Roll] writes the creatures name followed by an appostrophe and then the word "Roll". The content is in square brackets to trip Chat Service into putting that into the chat message header as opposed to the message body.

Section 2: {Roll} ({Formula}): {Total}| writes the roll name, the complete formula in brackets, and the total for the roll on the one line and then moves to the next line. This section will be repeated for each roll segment in the case of a complex roll.

Section 3: {Num}D{Sides}{Mod}=[{Rolls}]{Mod}={Subtotal}|{Join} displays the number of dice, followed by a D, followed by the dice sides, and the dice signed moddifier. This is followed by the equals sign, the posted values in square brackets, and once again the modifier. This is followed by another equals, the subtotal and the sub-total. If there is another formula to the roll segment, the join character is dispalyed (+ or -) or nothing is added if there is no more formulas to the roll segment.

Section 4: Empty. We already displayed the total at the beginning of the roll so we don't need anything in the footer section.

Section 5: Empty. We are not generating a combined total for all roll segments so we don't need anything here.

Dice Models, Texture And Icons

The plugin has a configuration for the Asset Bundle Name for the dice. Normally it should not be necessary to change this. It uses the same asset bundle as Custom Dice Pack plugin but the base dice asset bundle is provided again so that you don't need the Custom Dice Pack plugin.

In addition, there is a texture suffix configuration. The plugin comes with a Black And White (BW) texture theme but the dice textures can be customized by changing the suffix configruation. The texture name is determined for each die by suffixing the configured text to the die type and placing a underscore in between. For example, if the Suffix is Lava then the expected textures would be d4_Lava.png, "d6_Lava.png, ..., d20_Lava.png``. The file type (and thus the extension) does not need to be PNG but PNG is commonly used. There is also a set of Icon textures which depict the icons used in Screen View.