rhg1968's Forum Posts

  • It works with the ghost shooter but when I start a new project in the current stable release it doesn't appear to work. I will create a small project and submit a bug report

  • Just a quick question that I haven't been able to find looking over the documentation or example projects. I am just getting back into scripting but now there are modules.

    I have a sprite class that extends from ISpriteInstance in it's own module. Since modules are isolated it doesn't know what an ISpriteInstance is. Is there something to import for these definitions or can you not define sprite classes in there own modules ?

  • Aekiro

    My project is failing with to run as an HTML export if I use simple or advanced minification.

    To perform a test I created a simple project that didn't have anything in it other than PROUI v 1.7.7.5. I added a start on layout event to initialize it and that's it.

    It will work on export with no minification, but if I use simple or advanced it fails when you try to run the site.

    I was hoping you could take a look into this when you have time.

    Thank you

  • Aekiro

    There is a definitely an issue with the plugins revolving around the new modules mode of C3. If you have a project using classic js file loading it all works, but if you switch to import mode it fails when you export it. This can be seen I believe in all the exports, but you can see it in the HTML one pretty easily.

    I am using the latest C3 R32 and 1.772 of Pro UI.

    The error in the console is shown below.

    Uncaught TypeError: Cannot read property 'Plugins' of undefined

    at c3runtime.js:2563

    c3runtime.js:2322 Uncaught (in promise) TypeError: self.C3_GetObjectRefTable is not a function

    at C3Runtime._LoadDataJson (c3runtime.js:2322)

    at C3Runtime.Init (c3runtime.js:2316)

    at async RuntimeInterface._InitDOM (main.js:39)

    at async RuntimeInterface._Init (main.js:27)

  • No not all. Sorry if it sounded like that. Its for the plug in developer. It has to do with the project setting in the advanced part. If you select classic, which then doesn't use Javascript imports, the error goes away and it works.

    I am using the new import way in my project so I can't switch back to classic. I am hoping the developer can take a look and provide an update.

  • Adding to the post before about the game not loading, it appears to be related to having modules selected for the project. If you select classic then it works, but otherwise you get

    Uncaught TypeError: Cannot read property 'Plugins' of undefined

    at c3runtime.js:2563

    c3runtime.js:2322 Uncaught (in promise) TypeError: self.C3_GetObjectRefTable is not a function

    at C3Runtime._LoadDataJson (c3runtime.js:2322)

    at C3Runtime.Init (c3runtime.js:2316)

    at async RuntimeInterface._InitDOM (main.js:39)

    at async RuntimeInterface._Init (main.js:27)

  • I appreciate the response but I'm not talking about the ternary operator.

    I'm talking about

    let test = obj?.prop1?.prop2;

    Allowing deep property checks automatically returning undefined if anything in the chain is undefined instead of checking each item in an if statement

  • Does the scripting feature in events support optional chaining ?

    It gives an error when attempting to use the ?. operator.

    Thanks

  • Would have to see more of the actual code to help. I set text like that in script without any issues

  • You have two issues.

    1) You need to pass the runtime into your function jumpPowerBarRun. It should be jumpPowerBarRun(runtime)

    2) using runtime.objects.JumpPowerBar. That doesn't return an object for you to work with. It gives you access to functions to get instances that exist in your layout

    You would have to do something like runtime.objects.JumpPowerBar.getAllInstances() or runtime.objects.JumpPowerBar.getFirstInstance(). When you get all you will have to loop through them, but get first returns the object so you could then do runtime.objects.JumpPowerBar.getFirstInstance().width.

    There are other methods that you can use

    https://www.construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/object-interfaces/iobjectclass

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you for taking care of that so quickly.

  • First off love the plugins, I purchased them and they are really awesome.

    One thing I did notice is that if I tried advanced minification with the sample project you included it fails. Did you have any plans to make so that the plugins can be minified without any issues ?

    Thanks.

  • You create the instance then assign the width and height to it.

    const obj = runtime.objects.Player.createInstance(layerNameOrIndex, x, y);

    obj.width = 10;

    obj.height = 10;

    https://www.construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/object-interfaces/iworldinstance

  • You should be using runtime. callFunction("", x, y).

    This will get minimized properly.

    Normally to handle something that is accessing something that isn't minimized you would have to change something like this: funtion.doSomething() to function["doSomething"]()

  • It works now, Thank You !!!!!