InterfacePlugin
Provides websocket based access to Talespire. Ideal for browser extensions or Symbiotes.
About this mod Author’s original text
Interface Plugin
This unofficial TaleSpire add a remote websocket interface to manipulate Talespire from an external application.
This can be a web browser extension (typically to integrate content from other VTTs such as Dnd Beyond, Roll20,
Foundary), it can be a Talespire Symbiote (typically to perform some task that is not normally available via the
Symbiote API), or it could be a standalone application running outside of Talespire.
Lord Ashes' Talespire Plugins are always available for free. Lord Ashes does not have a Patreon but if you really want
to make a donation to the chocolate fund to keep the work going, you can do so using the Donate link above.
Change Log
1.0.0: Initial release
Install
Use R2ModMan or similar installer to install this plugin.
This plugin is needed by any player whose Talespire is going to be affected by the remote source.
Usage
This plugin is a dependency plugin which remote sources (such as Browser Extensions, Symbiotes or Standalone Applications)
can use to manipulate Talespire from an external source (i.e. outside of Talespire).
Players making use of such remote sources do not need to do anything with this plugin to make it work. However, they will
likely have to do stuff at the source but that has nothing to do with the plugin. See the source documentation for how to
use the source browser extension, Symbiote or application.
Making Remote Command Requests
The Interface Plugin impelments a Websocket interface through which remote sources can make requests into Talespire.
Webscokets are easy to implement in Javascript (i.e. Browser Extensions or Symbiotes) and most languages have libraries for
implementing Webscokets if you are writing a standalone application or script.
A sample Javascript file is provided which can be run by double clicking it. This will open it in a browser without needing
to host it. This sample code is intended to show an example of how the interface is used and a potential Javascript solution
to make command requests.
Unlike the Symbiote API which is well documented but somewhat limited in what it can do, the Interface Plugin is very geenric
allowing you to access most of Talespires methods and objects. However, this also means there is no detailed documentation
for all it can do because it is a generic implementation that just provides access into the Talespire code. This means you
will likely need to use a software like dnSpy to figure out what method you want to call and with what parameters.
Request Message
Requests are made my sending a Request message over the websocket and optionally listening for a response. The Request message
has the following format:
{
"command": "INVOKE",
"source": "Bouncyrock.TaleSpire.Runtime+ChatManager",
"method": "SendChatMessageToBoard",
"paramJson": [ "Hello Everyone!", "NGuid", null, "false" ]
}
Not all requests use all of these parameters. It should also be noted that in the Javascript example, there is one additional
parameter called "delay". This is not used by the Interface Plugin itself, it is only used by the Javascript client to determine
the timing of messages.
The `command` parameter is requires and it determines what kinds of an operation is being done. Possible options are "FIND",
"READ", "REF", "WRITE", "INVOKE" and "REMOVE".
The `source` parameter is used to determine on who or what the operation is happening.
The `method` parameter is used as a further selection depending on the command.
The `paramsJson` parameter is a list of parameters typically Json encoded unless simple specific to the command.
FIND
The find command is used to locate a specific asset, gameobject, instance, type, or component. The results of the find are
stored under a given name to be used with future commands. For example, if you want to set the Hp of a asset, you first find
the asset and store that under a speciifed name and then you can use that name in the Invoke command to perfor
Install & use Install: follow the bundled instructions
- Unzip the archive from playbuff and read the bundled readme / instructions first.
- Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
- For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
- Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.
Install locations vary a lot between mods — the bundled readme is the most reliable guide.
Install these first, or the mod will not work: