SymbioteApiPlugin

v1.2.0·Updated 2023-10-22

Dependency plugin for allowing plugins to use the Symbiote API.

About this mod Author’s original text

Symbiote API Plugin

This unofficial TaleSpire dependency plugin allows plugin to make use of the Symbiote API. Using the Symbiote API to

interact with Talespire makes plugins more resistance to breaking on BR updates because the under-the-hood namespace,

fields, properties or methods may change but the API is more likely to be preserved.

Video (Plugin To Symbiote):

Video (Symbiote To Plugin):

This plugin, like all others, is free but if you want to donate, use:

Change Log

1.2.0: Asset support for Symbiote triggered plugin functionality

1.1.0: Symviote API warning only shows when board is loaded (since Symbiote panel is not available in main menu)

1.1.0: Fixed bug with regular log entries being logged as exception

1.0.0: Initial release

Install

Use R2ModMan or similar installer to install this plugin.

This is a dependency plugin and thus is not used directly by the user. It is used by other plugins to implement various

communication and data storage features.

Runtime Usage (IMPORTANT NOTE!)

Due to a bug in Talespire, the Symbiote that this plugin created must be activated each session even if the Symbiote says

that it is already active. A warning message will continue to display periodically if this has not been done.

To re-activate the Symbiote, open the Symbiote Panel and click on the Symbiote API selection in the menu. This will

open the Symbiote API symbiote and display a bunch of diagnostic information. Close the Symbiote API window and close

the Symbiote panel.

It should be noted that users can still use other Symbiote after the Symbiote API is activated. The Symbiote API symbiote

just need to be activated but does not need to be the currently opened Symbiote.

Once the corresponding Talespire bug is fixed, this will no longer be necessary and the warning message check will be

remove from the plugin at that time.

Development Usage

Plugin To Symbiote

The Symbiote API plugin provides a number of function for interacting with the Symbiote API:

`Initialized(callback)`

The `Initialized` method is used to provide a callback which is triggered when the corresponding Symbiote has been

initialized (re-activated by the user). Normally this callback is used to make a subscription if the plugin is to make

use of Symbiote API subscription events.

`Subscribe(subscription)`

The `Subscribe` method is used to list the Symbiote API events that the plugin wishes to be notified about. These events

correspond to the Symbiote API events listed in the Symbiote API documentation. Be advised that the list contains the list

of events and not the event heading. For example, the user would subscribe to `rollResults and not onRollResults`.

This is in contrast to Symbiote manifest files which subscrive to the category and not the specific event. The `Subscribe`

method must be called after the corresponding Symbiote API is initialized and thus is usually combined with the `Initialized`

method. For example:

SymbioteApiPlugin.Initialized(() => { SymbioteApiPlugin.Subscribe(new List(){ "rollResults" }, rollResultCallback); });

The `Subscribe` method return a subscription guid which can be used to unsubscribe.

`Unsubscribe(guid)`

The `Unsubscribe` method is used to unsubscribe from Symbiote API subscription events. Use the guid generated by the

Subscription method as the parameter to this method to unsubscribe the corresponding events. The method returns the number of

subscriptions removed (typically 0 or 1).

`Symbiote_API(js)`

The `Symbiote_API` method is used to trigger Symbiote API code. More specifically it can be used to trigger any Javascript

code which can include Symbiote API code. This method is intended to run short javascript code snippets usually one line or about

couple lines of code. This function uses the `talespire://symbiote` URL protocol and thus the length of the code will be limited

to a length less than what is a

Install & use Install: follow the bundled instructions

  1. Unzip the archive from playbuff and read the bundled readme / instructions first.
  2. 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.
  3. For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
  4. 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.

Dependencies

Install these first, or the mod will not work:

bbepisTaleSpire-BepInExPackbrcoding-SetInjectionFlagPlugin

File & checksum

Filename
SymbioteApiPlugin-1.2.0.zip
File size
38.7 KiB