Construct 3 plugin SDK v1

For discussion and help with the Construct 3 Plugin SDK

Post » Mon Apr 03, 2017 6:42 pm

Welcome to the Construct 3 plugin SDK forum! Here we'll be providing information and support to third-party plugin developers interested in working with Construct 3.

Note you must use Construct 3 r15 or above for the SDK to work properly.

Current state of the SDK
The full set of editor SDKs we plan to support are very broad and involve a very large API surface. To approach this large task, we are going to gradually roll out the SDK in phases.

At first, the plugin SDK only supports single-global plugin types. (That means plugins that do not draw to the Layout View.) We hope to expand on this to drawing plugins, behaviors, effects and editor addons in future.

SDK documentation
We have provisional SDK documentation available here:

https://www.scirra.com/doc/c3sdk/index.html

The SDK documentation will eventually be hosted on construct.net, but the new documentation system isn't ready yet. Currently the documentation is hosted on scirra.com but likely will be moved in future.

This should help get you going with developing Construct 3 addons. Again this only covers single-global plugins; we'll update the documentation accordingly as we roll out new features and make new APIs available.

More help
Please post to this forum if you have any questions. We'll try to answer you and if possible update the documentation to make it clearer.
Scirra Founder
B
397
S
236
G
88
Posts: 24,408
Reputation: 194,486

Post » Mon Apr 03, 2017 7:50 pm

Fantastic!

I'm hoping someone can write a tool to easily convert a C2 Plugin into the new C3 format.

Do you think that's possible to achieve @Ashley ? or is it too wildly different to be able to do that.

Keep up the great work!
B
87
S
44
G
16
Posts: 1,005
Reputation: 17,938

Post » Tue Apr 04, 2017 3:55 am

Several things:
1) Pressing Cancel on the Install addon dialog reports: Addon installed, Successfully installed the addon... Clearly this wrong.
2) There needs to be some kind of feedback other than "Failed to install the addon"
3) Yikes, this painful. I started with a fairly small plugin, but there are so many fiddly things to add across multiple files, it's not easy to do. I also never did succeed, as there is some kind of error, but I don't know what it is. I did find several issues by using an online JSON validator, so that helped me, but there is no feedback on what the remaining error is.

It definitely seems like this could be automatable. I'd put my hand up, but I don't want to waste my time if someone else is already doing this.

How can we download plugins? An important part of plugin development is looking at how the built-in plugins work. Are you going to provide some way to look at the built-in plugins?
ImageImageImage
B
71
S
22
G
240
Posts: 3,732
Reputation: 133,990

Post » Tue Apr 04, 2017 5:00 am

https://www.scirra.com/doc/c3sdk/config ... ugins.html
The following constants are defined in the file-level scope:

const PLUGIN_ID = "MyCustomPlugin";
const PLUGIN_VERSION = "1.0.0.0";
const PLUGIN_CATEGORY = "general";
All three constants must match the values specified in addon.json.


The Addon.json file doesn't come with a category section, but the plugin.js has one and the documentation states it has to match the other file.

Also just getting "Failed to install addon" even with the base SDK unmodified.
B
21
S
8
G
6
Posts: 346
Reputation: 4,891

Post » Tue Apr 04, 2017 5:29 am

I was able to install the example.
ImageImageImage
B
71
S
22
G
240
Posts: 3,732
Reputation: 133,990

Post » Tue Apr 04, 2017 11:06 am

blackhornet wrote:Several things:
1) Pressing Cancel on the Install addon dialog reports: Addon installed, Successfully installed the addon... Clearly this wrong.

Thanks, fixed for r16.

2) There needs to be some kind of feedback other than "Failed to install the addon"

You should be able to see an error message in the browser console.

3) Yikes, this painful. I started with a fairly small plugin, but there are so many fiddly things to add across multiple files, it's not easy to do. I also never did succeed, as there is some kind of error, but I don't know what it is. I did find several issues by using an online JSON validator, so that helped me, but there is no feedback on what the remaining error is.

You should check the browser console. Also if you use an editor like VS Code, it ensures files like .json files are correct as you type them, and highlights any errors in real-time.

How can we download plugins? An important part of plugin development is looking at how the built-in plugins work. Are you going to provide some way to look at the built-in plugins?

We're currently distributing the stock plugins as built-ins basically so we could launch quicker, since as you can see the SDK is not complete yet. We may be able to port some of them back to the SDK later down the line.
Scirra Founder
B
397
S
236
G
88
Posts: 24,408
Reputation: 194,486

Post » Tue Apr 04, 2017 11:06 am

Thndr wrote:The Addon.json file doesn't come with a category section, but the plugin.js has one and the documentation states it has to match the other file.

Thanks, fixed.

Also just getting "Failed to install addon" even with the base SDK unmodified.

It works fine here, you can literally rename the SDK download zip from .zip to .c3addon and it installs.
Scirra Founder
B
397
S
236
G
88
Posts: 24,408
Reputation: 194,486

Post » Tue Apr 04, 2017 2:39 pm

:oops: I have a new error condition you can check for. If the c3addon file has no files (ie: user zipped the directory, not just the files), then nothing is reported.

Also the GUI text extends beyond the dialog if the URLs are long (my urls always break the addon dialog :roll: ).
Image
ImageImageImage
B
71
S
22
G
240
Posts: 3,732
Reputation: 133,990

Post » Tue Apr 04, 2017 2:54 pm

Also just getting "Failed to install addon" even with the base SDK unmodified.

It works fine here, you can literally rename the SDK download zip from .zip to .c3addon and it installs.

Yeah my mistake, kept zipping the folder instead of the contents of the folder.

Also I'm not seeing any errors in Chrome Console when it says it failed even if I'm zipping the contents.
B
21
S
8
G
6
Posts: 346
Reputation: 4,891

Post » Tue Apr 04, 2017 5:19 pm

So I got my addon to load, now on restart I'm getting:


Error report information
Type: unhandled rejection
Reason: Error: category language string missing for '[???]'
Construct 3 version: r15
URL: https://editor.construct.net/index.html
Date: Tue Apr 04 2017 10:17:02 GMT-0700 (Pacific Daylight Time)
Uptime: 4.5 s

Platform information
Browser: Chrome
Browser version: 57.0.2987.133
Browser engine: Blink
Browser architecture: 32-bit
Context: webapp
Operating system: Windows
Operating system version: 10
Operating system architecture: 64-bit
Device type: desktop
Device pixel ratio: 1
Logical CPU cores: 6
User agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36

WebGL information
Version string: WebGL 2.0 (OpenGL ES 3.0 Chromium)
Numeric version: 2
Supports NPOT textures: yes
Vendor: Google Inc.
Renderer: ANGLE (AMD Radeon HD 6570 Direct3D11 vs_5_0 ps_5_0)
Major performance caveat: no
Maximum texture size: 16384
Point size range: 1 to 1024
Extensions: EXT_color_buffer_float, EXT_disjoint_timer_query_webgl2, EXT_texture_filter_anisotropic, OES_texture_float_linear, WEBGL_compressed_texture_s3tc, WEBGL_debug_renderer_info, WEBGL_debug_shaders, WEBGL_lose_context
ImageImageImage
B
71
S
22
G
240
Posts: 3,732
Reputation: 133,990

Next

Return to Plugin SDK

Who is online

Users browsing this forum: No registered users and 2 guests