Construct 3 plugin SDK v1

0 favourites
From the Asset Store
Casino? money? who knows? but the target is the same!
  • 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.

  • 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!

  • 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?

  • https://www.scirra.com/doc/c3sdk/config ... ugins.html

    [quote:1whjod8a]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.

  • I was able to install the example.

  • Several things:

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

    Thanks, fixed for r16.

    [quote:2eor50g8]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.

    [quote:2eor50g8]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.

    [quote:2eor50g8]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.

  • 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.

    [quote:38lkfxuh]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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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 ).

  • [quote:xl5d98xe][quote:xl5d98xe]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.

  • 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

  • Make sure the language file is filled out properly. [???] is what you get when a string was looked up in the language file but it was missing.

  • Can't it print out which one it's looking for? I'm struggling to find which one is missing.

    Edit: sorry, forgot to check console log. There are 7 errors, so something fundamental went wrong. I'll need to investigate.

  • Still have the following, but I think this is a forced-case issue.

    [LANG] Failed to find 'en-US' string plugins.bht_smart_random.aceCategories.custom'

    I have:

    SDK.Lang.PushContext("plugins.BHT_Smart_Random");

    If I switch to:

    SDK.Lang.PushContext("plugins.bht_smart_random");

    then the 'custom' error goes away, but all my other strings fail.

  • That means you defined a category ID "custom" in aces.json, but didn't create a language string for it.

  • But I did, it was in the template:

    "aceCategories": {

    "custom": "Smart Random"

    },

    Edit: full file:

    {

    "languageTag": "en-US",

    "fileDescription": "Strings for BHT_Smart_Random.",

    "text": {

    "plugins": {

    "BHT_Smart_Random": {

    "name": "BHT Smart Random",

    "description": "Generates non-repeating integers in a range with a guaranteed non-repeat threshold.",

    "help-url": "http://blackhornettechnologies.com/construct2/plugins/BHTSmartRandom.aspx",

    "properties": {

    "start":{

    "name":"Start",

    "desc":""

    },

    "end":{

    "name":"End",

    "desc":""

    },

    "threshold":{

    "name":"Repeat threshold",

    "desc":""

    }

    },

    "aceCategories": {

    "custom": "Smart Random"

    },

    "conditions": {

    },

    "actions": {

    "randomize": {

    "list-name": "Randomize",

    "display-text": "Randomize the data.",

    "description": "Given the start and end settings, start the randomization."

    },

    "new": {

    "list-name": "New",

    "display-text": "Generate unique random numbers in the range {{0}-{1}} (inclusive), that will not repeat for {2} value(s).",

    "description": "Generate with new settings.",

    "params":{

    "start": { "name":"Start", "desc":"The initial value to start with."},

    "end": { "name":"End", "desc":"The final value to end on."},

    "threshold": { "name":"Threshold", "desc":"The number of values that must be enforced to be unique when the cycle repeats."}

    }

    }

    },

    "expressions": {

    "next": {

    "description": "Return the next random value within the range specified.",

    "translated-name": "Next"

    },

    "start": {

    "description": "Return the start of range value.",

    "translated-name": "Start"

    },

    "end": {

    "description": "Return the end of range value.",

    "translated-name": "End"

    },

    "threshold": {

    "description": "Return the threshold value.",

    "translated-name": "Threshold"

    },

    "peek": {

    "description": "Return the next value but don't remove it.",

    "translated-name": "Peek"

    }

    }

    }

    }

    }

    }

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)