Porting Construct 2 plugins/behaviors

Ashley's avatar
Medal
Construct Team Founder
Published 3 Aug, 2017
287 words
~1-2 mins

To port a Construct 2 plugin or behavior to Construct 3, use the following checklist.

  1. Start by copying the template SDK to a new folder.
  2. You can directly copy the runtime.js from your Construct 2 addon to c2runtime/runtime.js. Usually the runtime script does not require any modifications.
  3. Update the addon metadata in addon.json.
  4. Update the icon. An SVG icon is preferable. The .ico files Construct 2 uses are not supported in Construct 3, but you can use a PNG icon. Just delete icon.svg, add icon.png, and call this._info.SetIcon("icon.png", "image/png"); in the plugin/behavior constructor.
  5. Update the plugin/behavior constants and identifiers in plugin.js/behavior.js, type.js and instance.js, as described in configuring plugins/configuring behaviors.
  6. Match your Construct 2 addon's configuration by making calls to IPluginInfo/IBehaviorInfo in the addon constructor. For example if your Construct 2 plugin was a single-global plugin, the Construct 3 plugin should call this._info.SetIsSingleGlobal(true); in the plugin constructor.
  7. Add equivalent properties as the Construct 2 addon has. See Specifying plugin properties in configuring plugins. (The process is identical for behaviors.)
  8. Create corresponding action, condition and expression definitions. See defining actions, conditions and expressions. The key point to ensure Construct 2 projects using your addon can be imported to Construct 3 is:
    • Give every action, condition and expression a new id based on a string
    • Also set the c2id property to the corresponding numeric ID that the Construct 2 addon used
  9. Update the language file to contain the UI strings for the addon, properties, and ACEs.
  10. Consider porting the runtime script to the C3 runtime.

Once complete, zip all the addon files and rename the .zip to .c3addon. You should now have a addon you can install via the Addon Manager in Construct 3.