LordAshes-EmbeddedCharacterSheetPlugin icon

EmbeddedCharacterSheetPlugin

Adds an embedded character sheet from which you can roll

Last updated 2 weeks ago
Total downloads 341
Total rating 0 
Categories Tweaks Client-side Tools Integration Minis
Dependency string LordAshes-EmbeddedCharacterSheetPlugin-1.2.0
Dependants 1 other mod depends on this mod

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-FileAccessPlugin-1.2.3 icon
LordAshes-FileAccessPlugin

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

Preferred version: 1.2.3
HolloFox_TS-RadialUIPlugin-2.1.1 icon
HolloFox_TS-RadialUIPlugin

This is a developer tool based package used to help devs easily configure UI Radial Menus.

Preferred version: 2.1.1

README

Embedded Character Sheet Plugin

This unofficial TaleSpire plugin for adding an embedded read only character sheet into Talespire from which you can make rolls. Supports Talespire dice rolling and Chat Roll rolling. Uses concept of layouts to make character sheet configuration easier but the character data dictates the layout so the GM can mix layouts as needed.

While this plugin is similar in functionality to Character Sheet Plugin there are some major difference and thus this plugin does not replace the Character Sheet Plugin. Notable difference are:

1. Character Sheet Plugin can have multiple sheets open. Embedded Character Sheet can only have one sheet open.
2. Character Sheet Plugin is a form on top of Talespire while Embedded Character Sheet renders inside Talespire.
3. Embedded Character Sheet has better support for controlling the appearance of each sheet element.

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

Change Log

1.2.0: Addes pass-thru support (if roll does not contain a dice formula then it just passes the roll to chat)
1.1.0: Added support for loading embedded files in layout and data so that contents can be split along multiple files
1.0.1: Bug fix for cache issues
1.0.1: Make certain data types public to support Config Editor
1.0.0: Initial release

Install

Install using R2ModMan or similar.

Usage

  1. Select a mini for which you want to see the character sheet and for which one is defined.
  2. Press the keyboard shortcut for toggling the character sheet or select Character Sheet from the Info radial menu.
  3. Depending on the configuration the chartacter sheet will close after making a roll or can be closed using the toggle character sheet keyboard shortcut.
  4. Click on a element associated with a roll to make a roll.

Default Configruation: LCTRL + S

As always, Jon is the sample. Name a mini Jon and then activate the Embedded Character Sheet.

Roll Method

The roll method can be selected between Talespire dice (use Auto Roll plugin if you want them to be rolled automatically) or Chat Roll dice. To change this setting, go to the R2ModMan setting for this plugin, find the correspoding setting, change it and save it. Next time Talespire is run, the roll method will be changed according to the setting.

Jon Show Option

Once a layout and/or character data is loaded, it is cached to make re-opening the character sheet quicker and not require disk access. However, in some cases this is not desirable. For example, if the character has leveled up the character data can be updated outside of Talespire but with the cache, Talespire would not see the changes until the next time it runs.

To get around this, there is the Jon Snow option. Pressing the corresponding keyboard shortcut causes, like the famous quote from the series, the plugin to forget all its cached information and thus re-read any layout and/or character data when it is needed. So, for example, after updating the character sheet data (outside of Talespire), you can use this option to forget the cached version and thus, when the character sheet it opened, it will load the updated version.

Default Configruation: RCTRL + S

Configuration

Similar to Character Sheet Plugin the Embedded Character Sheet Plugin uses the concept of Layout and Character Data. While you can use Layout for the actual entries (and have a Layout for each character sheet) the usual concept is to make a layout with place holders for the actual data (which is common to all or most minis) and then place the actual data into a character data file.

Unlike Character Sheet Plugin which used only one layout at a time, Embedded Character Sheet can use many layouts at the same time so, for example, player minis can use a full character sheet layout while monsters can use a stat block layout.

In general that means you need 2 or 3 files but then adding additional characters requires only one file. The three files are:

1. Layout file (required - common to multiple minis)
2. Backgound image (optional - common to multiple minis)
3. Character data file (required - per mini)

The Place Holder Concept

The layouts and character data sheets use a concept of place holders. Instead of the layout providing values directly (which would mean it could not be re-used), the layout defines place holders which are then replaced with actual values when the layout is used by a specific character. This allows the layout to be used for multiple characters making it easy to update the layout file without having to edit all of the character files that use it.

There is no specific enforced format for a place holder but place holders should be unique so that they don't show up in regular text. For example, a place holder of wis is not a good place holder because if the layout wants to write out the world wisdom the first portion of it would match the place holder and thus get replaced. The typical convention is to use brace brackets around place holders. If the place holder is {wis} then it will not be found in the word wisdom and thus such a word will be possible to display.

The place holders can be nested to make calculations easier. For example a place holder of {Attack1} could resolve to 1D20+{BAB}+{STR} which then resolves to 1D20+7+4.

Layout File

The layout file defines where things are displayed on the character sheet using a JSON file. The name of the layout file needs to be as follows: EmbeddedCharacterSheet.Layout.Name.csl where Name can be any unique identification for that particular layout. For example: EmbeddedCharacterSheet.Layout.StatBlock.csl

The contents are as follows:

{
  "background": "Sample_3.5E.png",
  "position": {
    "x": 10,
    "y": 40
  },
  "size": {
    "w": 293,
    "h": 512
  },
  "elements": [
    {
      "type": 0,
      "position": {
        "x": 52,
        "y": 88
      },
      "size": {
        "w": 230,
        "h": 10
      },
      "style": "fontSize=12|fontStyle=1|normal.textColor=220,220,200",
      "content": "{CharName}",
      "roll": ""
    },
    {
      "type": 0,
      "position": {
        "x": 52,
        "y": 116
      },
      "size": {
        "w": 70,
        "h": 10
      },
      "style": "fontSize=10|fontStyle=2|normal.textColor=128,64,32",
      "content": "{CharRace}",
      "roll": ""
    }
  ]
}

Where background is the name of the background image. Empty string (default) is no background image is desired. Where position is the top left corner of the character sheet. Where size is the width and height of the character sheet. Where elements is an array of GuiElements that define all of the visual elements of the character sheet (besides the background).

A GuiElement has the following properties...

The type determines the type of element (0=label, 1=button). Currently both seem to render the same, so this can be ignored for now. The position determines the position of the element on the character sheet (with respect to the character sheet not screen). The size determines the width and height of the element on the character sheet. The content determines what is displayed. If the content is surrounded by # characters, it is treated as a texture file name and displays the corresponding image. Otherwise it is treated as text with all placed holders replaced. The roll determines what is rolled when the element is clicked. If it is an empty string (default) then nothing happens when the element is clicked. Otherwise the content, after replacing all place holders, is sent to the corresponding rolling method. It is important that the roll resolve to something in the form #D#+# or #D#-#. This is especially true when using the Talespire dice rolling method. The Chat Roll method may support other formats in addition to the ones listed but sticking to the formats indicated means the roll will be compatible with both rolling methods. The roll parameter does support multiple rolls by using a slash to separate rolls. For example: 1D20+7/2D6+3 The style determins the apperance of the element and is used to override the (configurable) defaults. It is a pipe delimited string of GuiStyle proeprties (see Unity documentation for all GuiStyle properties). The most common use of this is to change the color, size and style of the element text. When using this method to change color, three formats are accepted: color name, RGB and ARGB. For color name just eneter the color name like "red". For RBG and ARGB list each of the components (as a byte) separated by commas.

Note: Rolls can resolve to a #D# specification with any number of numeric bonuses and/or penalties. The total modifier is calculated before passing the roll to the rolling method. For example, 1D20+3+2-5 is a valid roll specification. Note: The above shows 2 GuiElements but the actual layout will have many more elements.

Character Data

The character data file defines the values of the various place holders in the layout file. This allows one layout file to be used for multiple characters without needing to copy the whole layout contents into each character sheet. This means that when an update is needed, the layout file can be updated and the change will be automatically applied to all characters that use the layout instead of having to update each character sheet for each character. The filename of the character data need to be as follows: EmbeddedCharacterSheet.Data.MiniName.csd where MiniName is the name assigned to the mini whose character sheet is being looked up. For example: EmbeddedCharacterSheet.Data.Jon.csd

The contents of the character data file is as follows:

{
  "layout": "5E",
  "stats": {
	"{CharName}": "James Bond",
	"{CharRace}": "Human",
	"{CharClass}": "Spy",
    "{STR}": "2",
    "{DEX}": "4",
    "{CON}": "2",
    "{INT}": "3",
    "{WIS}": "2",
    "{CHA}": "4",
  }
}

Where layout indicates the layout that the data is plugged into. This property is required. Where stats is a list of place holder names and their values.

It is important to understand that layout file and character data files are completely game independent. That means that the stat values in the character data file is comepletely up to the user. The only stipulation is that the character sheet file must contain a a value for each place holder used in the referenced layout. So if the layout has a place holder for {PicklesPerDay} the character data file that uses that layout needs to define that place holder value even if just as a empty string. As such the above stats are an example which suggest a D&D style game but this plugin can equally be used for any dice rolling game system.

Embedded Files

Both the layout file or the character file now supports insertion of content from other files. To do this, enter the following syntax:

{#filename#}

This will take the contents of filename and insert it into the file at the location where the reference is placed. For example, the layout file could now be:

{
  "background": "Sample_3.5E.png",
  "position": {
    "x": 10,
    "y": 40
  },
  "size": {
    "w": 293,
    "h": 512
  },
  "elements": [
{#EmbeddedCharacterSheet.Layout.35E.CharSection.txt#}  
{#EmbeddedCharacterSheet.Layout.35E.Abilities.txt#}  
{#EmbeddedCharacterSheet.Layout.35E.Attacks.txt#}  
  ]
}

This embedded file format has two automatic replacements available:

{NAME} = The mini name. Typically used with the character data file so that the embedded files can be character specific. Such as:

{#EmbeddedCharacterSheet.Data.{NAME}.CharSection.txt#}

{LAYOUT} = The layout. Typically not needed since the layout is layout specific and thus the value can be hard coded.

This functionality is a straight search and replace and thus the location of the embedded file reference is important. For example, in the above sample, moving the embedded file references outside of the "elements" section would not work because the content of the files needs to be inserted into the elements section.

Character Vs Group Data

Most of the documentation refers to a character sheet for a mini or character implying a one to one relationship. However, this is not necessarily true. As implied above by the file naming requirement, the plugin connects the selected mini to a character sheet by the mini name. As such, you can have a group of enemies, for exmample, goblins use the same character sheet by naming them all the same name, such as goblin. Then you can make a character sheet for goblin and no matter which goblin you select the same character sheet will be displayed. If you need to distinguish between them (and you can't by name because of this plugin), you can use GM Notes to place text above the minis.

Available versions

Please note that the install buttons only work if you have compatible client software installed, such as the Thunderstore Mod Manager. Otherwise use the zip download links instead.

Upload date Version number Downloads Download link  
2022-11-14 1.2.0 101 Version 1.2.0 Install
2022-11-12 1.1.0 29 Version 1.1.0 Install
2022-10-7 1.0.1 199 Version 1.0.1 Install
2022-10-7 1.0.0 12 Version 1.0.0 Install