[Plugin] JavaScript (C2 and C3)

  • valerypopoff

    Hi thanks for your plugin.

    Your plugin not working well if I add the NEWjs plugin. I want to export my application for windows. This seems to disrupt the JavaScript function call

    What's a "NEWjs plugin"?

  • valerypopoff

    Hi thanks for your plugin.

    Your plugin not working well if I add the NEWjs plugin. I want to export my application for windows. This seems to disrupt the JavaScript function call

    Oh you mean NW.JS?

    Is it nw.js plugin that you have problems with? Or is it the exported project when you export for NW.js platform?

    What do you mean "plugin not working well"? What seems to be the problem? Can you send me the project that you have problems with?

    I just created a project with both JavaScript and NW.js plugins included end exported it for NW.js platform. I launched it under Windows and the JavaScript plugin worked.

  • valerypopoff It's about firebase. I use your plugin to connect with Firebase but if I import NWjs plugin it's doesn't work anymore. :(

    logger.ts:86 [2019-09-21T13:17:55.772Z] /app:

    Warning: This is a browser-targeted Firebase bundle but it appears it is being

    run in a Node environment. If running in a Node environment, make sure you

    are using the bundle specified by the "main" field in package.json.

    If you are using Webpack, you can specify "main" as the first item in

    "resolve.mainFields":

    webpack.js.org/configuration/resolve

    If using Rollup, use the rollup-plugin-node-resolve plugin and specify "main"

    as the first item in "mainFields", e.g. ['main', 'module'].

    github.com/rollup/rollup-plugin-node-resolve

  • Still don't understand what is it that's not working. Why do you think something isn't working?

  • Download this example : mon-partage.fr/f/GHF9KPkz it's working with your plugin. Then add NW.JS to the project and check what happen (load the project few times)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Download this example : mon-partage.fr/f/GHF9KPkz it's working with your plugin. Then add NW.JS to the project and check what happen (load the project few times)

    Ok I downloaded your project and opened it. When I run it, nothing happens: I just see your layout. When I add NW.js plugin and run it, also nothing happens.

    What am I supposed to see?

    If you see an error message, just copy-paste it here. Or take a screenshot. I can't guess what's wrong.

  • One of the useful plugins for C2. Really like it. In theory we can implement different JS codes, API etc.

    Now, on last stable C2 version r272 its work fine, on the last beta version (r273 or r274) the CAPX file show "Check Failure" window on the start (only when this plugin installed). Anyway I just ignore it and it's looks like it works fine.

  • One of the useful plugins for C2. Really like it. In theory we can implement different JS codes, API etc.

    Now, on last stable C2 version r272 its work fine, on the last beta version (r273 or r274) the CAPX file show "Check Failure" window on the start (only when this plugin installed). Anyway I just ignore it and it's looks like it works fine.

    Thanks for the report. Indeed, the flag "rotatable" is set in the plugin's config. And it shouldn't be. I'm quite surprised to discover it. It is a minor thing that (as it turned out now) has been there since the very first version of the plugin. Fortunately it doesn't break anything besides showing this message in the test build. So I suggest you continue ignoring it and I'll fix it in the next version if it's ever going to happen.

  • minify option does not work on construct 2

  • minify option does not work on construct 2

    What do you mean it doesn't work? What seems to be the problem?

  • Hi, when i try to minify i get this from c2. (java is installed, minify work if i remove the plugin "ValerypopoffJS")

    then i tryed jscompress.com to compress c2runtime.js.

    i get this error: "File c2runtime.js: Unexpected token: punc «(» (line: 23999, col: 6)"

    any idea, how to fix it?

    Thx!

  • Hi, when i try to minify i get this from c2. (java is installed, minify work if i remove the plugin "ValerypopoffJS")

    Does the problem persist when you're dealing with other projects? Or is it only when you're trying to minify this particular project?

  • i did some tests.

    if i make a new project, and i add ValerypopoffJS plugin, minify work.

    then i added some ValerypopoffJS events and actions, minify work.

    then i insert a new object, sprite, and i get the error.

    i tryed to add ValerypopoffJS plugin in 4-5 full projects and i get the error.

    i tryed to uglify c2runtime.js (online) and its work.

    I used c2 release 269 and 277 (64 bits).

    ValerypopoffJS v.0.7.0

    How to get the error.

    1. open a c2 project. (no new or emptyone)

    2. add the ValerypopoffJS plugin.

    3. export as html 5 website.

    4. set enable the minifi option.

    Cheers.

  • Ok I think I know what the problem is. The Javascript Plugin is written in a newer version of javascript (ECMAScript 6) than the C2 minifier (and some other minifiers too) can handle.

    If you tick "ECMAScript 2020 (via babel-minify)" box while minifying with jscompress.com, it'll work just fine.

    I don't intend to support Javascript Plugin for Construct 2 anymore. I'd suggest you switch to Construct 3.

  • thx a lot!!

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