SymbioteHandlersPlugin

v1.0.0·Updated 2023-09-10

Allows Symbiotes content to be constructed using alternate scripting languages

About this mod Author’s original text

Symbiote Handlers Plugin

This unofficial TaleSpire plugin allows the content of Symbiotes to be constructed

using alternate scripting languages such as PHP or Python.

Change Log

1.0.0: Initial release

Install

Install using R2ModMan.

Comes with a sample Symbiote that uses PHP to construct the Symbiote page.

Usage: Configuration

Before the plugin can provide any benefit it needs to be configured with one or

more handlers. Handlers mappings between file extensions and scripting interpreters.

For example, the PHP extension can be associated with the PHP interpreter while PY

extension can be associated with the Python interpreter.

To do this use R2ModMan to edit the config for the plugin. The `handlers` property

is a JSON dictionary which maps extensions to handlers. For example:

{

"PHP": "php.exe -f {*}"

}

The `{\*}` characters are replace with the script file name.

Usage: Symbiote Building

When building a Symbiote using this plugin, the EntryPoint in the manifest

is not the script file, it is a HTM or HTML file with the same name except

for the extension. This is important. The Symbiote will not work correctly

if it points directly at the script file.

The entry point typically the HTML code for to display if the user does not

have the plugin or appropriate handler installed.

The script is then placed in a file with the same name as the EntryPoint except

the extension, instead of HTM or HTML, reflects the script language.

When the Symbiote requests the EntryPoint, the plugin intercepts the requests

and checks to see if the requested page has a corresponding script file asscoated

with one of the configured handlers. If so, the script file is executed and the

results of the script are written to the requested file. This allows the alternate

scripting language to create the Symbiote content dynamically.

For example, consider the plugin having a configured handler for PHP and Python.

The Symbiote makes a request for the EntryPoint URL which, in this exmaple, is

`test.html. The handler would look to see if it can find a test.php` file

(PHP being the extension configured for the PHP interpreter) and also look for a

`test.py` file (PY being the extension configured for the Python interpreter).

If it find either of these files, it executes them and overwrites the `test.html`

file with the output of the script results.

If the `test.html` initially started with HTML for indicating that it needs PHP

and this plugin to work, that is what would be displayed if the user tried to use

the Symbiote without having this plugin or without having a PHP interpreter

properly configured.

Otherwise the contents of the scripting file is passed to the corresponding scripting

interpreter and the results would overwrite the `test.html`. In such a case

the Symbiote would end up displaying the results of the script file.

Limitations

The handler process is limited to loading of the EntryPoint (the Symbiote). If the

Symbiote code load additional files, these files will not have been processed though

the handler. For example, a link in the Symbiote page would not have the benefit

of the handler. As such, when the script handler is triggered via the EntryPoint,

it needs to run any additional scripting file though the interpreter on its own.

The handlers can use with any scripting interpreter that supports input of a filename

and produces output (or can produce output) to the console (standard output). This

is necessary for the plugin to be able to capture the results and write them to the

requested file.

This plugin allows alternate language scripting for building the Symbiote content but

since it is executed on Symbiote load, it is not intended for processing the Symbiote.

For example, the alternate scripting language can be used to easily create 25 butttons

on the screen and even speify the javascript function to be called when these buttons

are pressed but the alternate scripting language cannot be used to actually process

the button clicks. 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
SymbioteHandlersPlugin-1.0.0.zip
File size
35.0 KiB