Skip to main content

Plugin files (studio.json and plugin descriptors)

Experimental. A project can add its own tools and editors to cTurtle Studio, written in BT. studio.json in the project root lists them; each entry points to a plugin descriptor that names the plugin's BT source. How plugins work is covered in Game plugins; this page lists the file fields.

Only Studio reads these files. Exported games don't include them unless you add them to package.copy.

Example​

studio.json:

{
"plugins": ["studio/plugins/authoring/plugin.json"]
}

studio/plugins/authoring/plugin.json:

{
"id": "mygame.authoring",
"name": "My Game authoring tools",
"version": "0.1.0",
"studio_api": 1,
"source": "main.bt",
"requires": ["ui.embedded", "views.tools", "documents.transactions"]
}

studio.json​

FieldTypeDefaultDescription
formatobjectnoneOptional file format version.
pluginsarray of strings[]Paths to plugin descriptors, relative to the project root. Loaded in this order.

Without studio.json, the project has no plugins. Studio doesn't search folders for plugins; only listed descriptors load.

Plugin descriptor​

FieldTypeDefaultDescription
studio_apiinteger—Required. Must be 1.
formatobjectnoneOptional file format version.
idstring—Required. Unique plugin ID: 1–128 characters from letters, digits, ., - and _. Keep it stable; saved layouts and shortcuts refer to it.
sourcestring—Required. The plugin's entry .bt file, relative to the descriptor. It must define studioPluginMain.
requiresarray of strings[]Studio features the plugin uses; see Capabilities.
namestring—Display name. Currently unused.
versionstring—Your plugin's own version, such as "0.1.0". Not a file format version. Currently unused.
programstring—Not implemented. A descriptor with program is rejected.

Paths (in plugins and source) must be relative, with no . or .. parts and no drive letters. \ is accepted as a separator.

Capabilities​

List what your plugin uses in requires. Studio refuses a plugin that asks for something it doesn't offer, so this catches a plugin written for a newer Studio. It doesn't limit what the plugin can do.

CapabilityLets the plugin
ui.embeddedShow its UI inside Studio's docks.
views.toolsAdd tool views that open with the project.
views.factoriesAdd views that are created when the user opens them.
editors.documentsProvide editors for project files ("Open With").
documents.transactionsMake grouped edits to documents (one Undo step).
documents.changesBe notified when a document changes.
documents.saveAsk Studio to save a document.
source.revealJump to a location in the Source Editor.
assets.projectShow project images.
games.runStart the game in Studio's Play session.

Errors​

Errors appear in Problems under Plugins and in the status bar. One broken plugin doesn't stop the others from loading.

MessageCause
studio.json: "schema": 1 is no longer used (also plugin descriptor: …)Delete the schema line (an older file).
studio.json uses format version X; this cTurtle reads format … (also plugin descriptor …)The file was written for a newer Studio; see File format versions.
Invalid plugin ID: <id>id empty, too long, or has other characters.
Duplicate plugin ID: <id>Two descriptors use the same id.
Unsupported Studio APIstudio_api isn't 1.
Plugins currently require one source packagesource is missing, or program is present.
Plugin capability unavailable: <name>requires lists an unknown capability.
document URI must be project-relative / cannot contain dot segmentsA path breaks the path rules above.
Plugin source package failed to loadYour plugin's BT code has errors.
studioPluginMain returned without activating its toolsCall studio_plugin_activate() before studioPluginMain returns.
Plugin bootstrap timed out after 10000 ms without activating its toolsThe plugin took more than 10 seconds to activate.
Duplicate tool view: <view>Two tools have the same ID.

See also​