CanOpenerAPIPlugin
File based API to read/write TS content during runtime
模組介紹 作者原文
Can Opener API Plugin
This unofficial TaleSpire plugin for accessing TS content at runtime via file based API.
Install
User R2ModMan or similar to download and install the plugin.
Usage
The Can Openeer API plugin reads content from its CustomData/API folder. It processes any files
ending in API and responds using the same file name but with a extension of $$$.
The contents of the file contains one or more operations with one operation per line along with
any parameters separated by a space. The following operators are available:
`Find name`
Set the active object to the GameObject of the provided name or sets the active object to one of
the following objects LocalClient, CreaturePresenter, CreatureBoardAsset, or Messages (for Stat
Messaging content).
`Type name`
Sets the active object to a type for use with static classes.
`New name`
Creates a new instance of the specific type (name) and sets the active object to it.
`Instances name`
Gets all unity objects of the give type (name) and set the active object to the array.
Use the: operator to select a specific index in the array.
`Components name`
Gets all components of the give type (name) and set the active object to the array.
Use the: operator to select a specific index in the array.
`: index`
Sets the active object to the indicated (index) element interpreting the current active object
as an array of objects.
`; key`
Sets the active object to the indicated (index) key element interpreting the current active object
as a dictionary of objects.
`SET name`
Stores the current active object under the give name. Typically used to easily switch between
multiple objects.
`GET name`
Sets the active object to the object previously stored with the give name. Typically used to easily
switch between multiple objects.
`-> name`
Sets the active object to the property or field indicated by the name. Typically used to traverse
an object such moving from a GameObject to the game object's transform object.
`? name`
`? cid key`
Returns the active object's value of the specified (name) property or field. Only one result is
supported. Successive results replace previous results.
When the active object is MESSAGES then the syntax changes to the cid as the first parameter and the
Stat Messaging key as the second parameter.
`= name value`
`= cid key value`
Sets the activeobject's specified (name) property or field to the indicated value.
Includes a handler for Vector3 objects which are specified as 3 numbers separated by comma and no
spaces (e.g. 3,6,8)
When the active object is MESSAGES then the syntax is changed to include the cid as the first parameters,
the stat messaging key as the second parameter and the value as the third parameter.
`| method`
`| method parameters`
Invokes the specified method on the active object. Optionally with parameters.
`{}`
The opening and closing brace brackets is not an operator. It is used to insert the last result into
thge parameters of other commands. The {} gets replaced by the last result when the operation that
contains it is executed.
Examples:
FIND LOCALCLIENT? SelectedCreatureId
FIND MESSAGES? {} org.lordashes.plugins.states
FIND LOCALCLIENT? SelectedCreatureId
FIND MESSAGES
= {} org.lordashes.plugins.states Ice
FIND LOCALCLIENT? SelectedCreatureId
FIND CREATUREBOARDASSET {}
-> CreatureRoot
-> transform? position
FIND LOCALCLIENT? SelectedCreatureId
FIND CREATUREBOARDASSET {}
-> CreatureRoot
-> transform
= position 1.5,0.0,2,5
FIND LOCALCLIENT? SelectedCreatureId
FIND CREATUREBOARDASSET {}
| RequestDelete
Change Log
1.0.0: Initial release
Why A File Interface?
Why a file interface? Why not a TCP/IP interface, Websocket interface or an REST API?
Threading in Unity/TS is difficult. If a communication server is not implemented correctly
it can cause it to delay or even hang TS while it waits for a connection or communication.
Communication timeouts and other similar factors can also introduce performance issues
安裝與使用 安裝:按包內說明操作
- 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
- 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
- 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
- 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。
不同模組的安裝位置差異較大,包內說明是最可靠的依據。
下面這些內容需要先安裝,否則該模組不會生效: