Addon ID

  • plugin_template

Info

Statistics

  • Download count7 total downloads
  • Latest download count 7 downloads of latest version
  • Average download count1 downloads per day average

Owners

# Plugin Template — Documentation

**Version:** 1.0.0.0 | Construct 3 SDK v2

---if you want buy me a coffe! buymeacoffee.com/fallout2remake

## User Guide

**Installation:** Menu → View → Addon Manager → Install new addon → select `.c3addon`

**Adding to project:** Insert new object → find **Plugin Template** in the list

### Actions

| Action | Parameter | Description |

|--------|-----------|-------------|

| Set Enabled | Boolean | Enable or disable the plugin |

### Conditions

| Condition | Description |

|-----------|-------------|

| Is Enabled | True when the plugin is enabled |

**Event example:**

```

On Button clicked

→ Plugin Template: Set enabled to True

Plugin Template: Is enabled

→ Sprite: Set visible

```

---

## Developer Guide

**File structure:**

```

addon.json — metadata

aces.json — ACE definitions (actions, conditions, expressions)

plugin.js — editor: plugin class

type.js — editor: type class

instance.js — editor: instance class

icon.svg — icon shown in C3 editor

lang/en-US.json — display names and descriptions

c3runtime/main.js — runtime entry point (imports all modules)

c3runtime/plugin.js — runtime: plugin class

c3runtime/type.js — runtime: type class

c3runtime/instance.js — runtime: instance + state (_enabled)

c3runtime/actions.js — runtime: action implementations

c3runtime/conditions.js — runtime: condition implementations

c3runtime/expressions.js — runtime: expression implementations

```

**Adding an Action** (4 files):

`aces.json` → add to `actions` array with `id`, `scriptName`, `params`

`lang/en-US.json` → add display name under `actions`

`c3runtime/actions.js` → implement function matching `scriptName`

Parameters in `aces.json` must match function arguments order.

**Adding a Condition** (3 files):

`aces.json` → add to `conditions` array

`lang/en-US.json` → add display name under `conditions`

`c3runtime/conditions.js` → implement function, must return `true`/`false`

**Adding an Expression** (3 files):

`aces.json` → add to `expressions` array with `returnType`

`lang/en-US.json` → add display name under `expressions`

`c3runtime/expressions.js` → implement function, must return a value

**Saving state:**

```js

_saveToJson() { return { myValue: this._myValue }; }

_loadFromJson(o) { this._myValue = o.myValue ?? defaultValue; }

```

**Adding a property (editor panel):**

In `plugin.js` → `this._info.SetProperties([...])` using `SDK.PluginProperty`

In `lang/en-US.json` → add entry under `properties`

In `instance.js` → handle in `OnPropertyChanged(id, value)`

**Bumping version:** Update `"version"` in `addon.json` — format: `major.minor.patch.build`

---

## Known C3 Plugin Limitations

- `SetIsSingleGlobal(true)` — only one instance per project; remove for multi-instance plugins

- No direct access to other objects without using `IRuntime` APIs

- `_saveToJson` / `_loadFromJson` required for state to persist across saves