is ther z way i can add a python plugin

0 favourites
  • 7 posts
From the Asset Store
Customize the animation of character when item changed
  • I'm fairly terrible at JavaScript but perfect at Python. If there is an apython plugin, it would be greatly appreciated, i would make attempts to learn it, but my time is limited

  • I think it's theoretically possible to make a plugin for Construct that can run Python code, as it could use a WebAssembly build of the Python interpreter. However I don't believe anyone has attempted that yet, and it would be much more difficult to actually integrate that with the runtime, such as to use Python code to change a Construct object. Integrating all those API bindings would probably be the most challenging part, and without that it would be hard to do much useful with Python code. So I think the best approach is just to try to get to grips with JavaScript.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think it's theoretically possible to make a plugin for Construct that can run Python code, as it could use a WebAssembly build of the Python interpreter.

    Please do this! That would be cool!

  • What I was getting at before is a WebAssembly build of a Python interpreter is a fraction of the necessary work. By itself it would do no more than a basic interpreter running in a terminal, with no access to any Construct objects or any browser APIs. For it to do anything useful it would need bindings to a wide range of APIs, which would likely be far more work than just getting the interpreter working in the first place.

    If anyone wants to try it out anyway, you can probably get a WebAssembly Python interpreter working with the addon SDK!

  • Funny enough, some time ago I was tinkering with a project that would benefit from this. It was very simple though, basically all I needed was the option to make a call from construct to start a python script. That python script simply executed a few things and then started a local server, so in my case I didn't even really need callbacks (although ideally there would be callbacks for stuff like error handling)

    If anyone wants to try it out anyway, you can probably get a WebAssembly Python interpreter working with the addon SDK!

    Glad to know that it probably works although I don't think I could do that simply because no time and no current urge to do it (and I don't know web assembly)

  • Unless you can start a local server with JavaScript you wouldn’t be able to do it via python implemented via webassembly. The same limits apply. To bypass the browser limits you’d need a plugin for nwjs or webview2

  • Yeah, normally a web page cannot start a server. So even lots of built-in libraries in Python would not work out of the box. That's my point: the pure language interpreter alone does not actually do that much - you need a whole range of libraries and APIs for it to be practically useful. I suppose you might be able to do something like set up a way to pass JSON data to a Python interpreter in WebAssembly, do some processing on that, and then return some JSON data, but that's an awful lot of trouble to go to when you could just write some code in JavaScript instead.

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