Third-party addon changes to support JavaScript Modules

1 favourites
From the Asset Store
Helping streamers give their viewers more excitement.
  • Not all developers publish their addons to our website, including some people with commercial addons they sell independently, so we still wouldn't reach everyone if we did that.

    We made this clear in the release notes, in this forum posts, and by actually implementing the change in a beta release, so if it was broken presumably users would have been reporting that to you. This is the same way we approached the changes to the minifier last summer. Besides there seem to be lots of addon developers who aren't actively maintaining their addons, so I would think even if we reached out to everyone we could find (which as noted would still be an incomplete list), a bunch of developers would still not act on it until it's too late. We also can't be sure whose addons will actually keep working fine, and whose will be broken, and also it's not clear if most addons are actually fine and there's no significant problem, or if there's going to need to be wider changes. In this case since if you'd used strict mode - good practice since 2011, and already built-in to the addon SDK downloads - there was no problem, which seemed to be a signal it was probably a minor issue.

    I appreciate maintenance issues like this can be frustrating, but many platforms require regular maintenance (especially mobile platforms, as iOS and Android often have annual changes to their requirements), and it's impossible for us to force addon developers to check or fix their addons no matter what we do. I think there is some level of responsibility for addon developers to keep an eye on developer news, release notes, listen to feedback coming from users, and maybe do a quick test every couple of months after a new stable release comes out. It's something we have to do with Construct itself, and even then we occasionally miss things, which can be a pain but then we just take action and fix it as soon as we can.

  • Hey guys. Im glad you work on your product and make it more useful and easy to use.

    I use several RexRaindbow plugins in my project and I wonder if you could contact him(her) personally. As I know rex has a lot of useful plugins. I tried to do that myself but honestly Im new to forums and I simply cant handle finding a way to send a private message or even to find a latest rexrainbow post)))

    I might make a new post but still could you contact him or at least teach me the best way to contact a certain forum member?)

  • Hey Guys! I've got a small problem. Or maybe a big problem. IDK. I have this super cool game I've made (itch.io, google play, construct/scirra arcade), and I would like to keep working on it, but I am using plugins that are ancient. My game uses 4 of Rex's Firebase Pack. I spent a bunch of time determining how to add several features to my game including leaderboards and cloud saves, and that's how I did it. But these plugins are super outdated, and Rex stopped managing them years ago from my understanding. I don't really think I have the technical know-how to fix these myself, but it appears that all of his source code is still publicly available. You can download all his firebase plugins here: Link.

    The plugins I use are:

    Authentication - to connect a user's email and password with a Firebase user set

    APIv3 - general Firebase stuff

    SaveData (saveSlot) - To store user data to firebase

    LeaderBoard - To house the player leaderboard

    If this is an easy fix, I'd be happy to do it myself. I don't know how to take these scripts and compile them into a plugin file or anything like that, so any help is great.

    I don't know if it is really worth fixing these scripts or not. I guess that's the real answer I'm looking for here.

  • Check out this thread, folks there may be able to point you in the right direction.

    construct.net/en/forum/construct-3/plugin-sdk-10/erens-ported-plugins-modules-159391

  • Thanks, I'll repost there.

  • Hello everyone! I'm adding modules support to Rex_FirebaseAPIV3 plugin and I stuck into a problem. How to fix the error on 11th line of the code about accessing the 'database':

    "use strict"; 
     
    { 
    	C3.Plugins.Rex_FirebaseAPIV3.Instance = class Rex_FirebaseAPIV3Instance extends C3.SDKInstanceBase 
    	{ 
    		constructor(inst, properties) 
    		{ 
    			super(inst); 
    			if (properties) 
    			{ 
     	globalThis["Firebase"]["database"]["enableLogging"](properties[4] === 1); 
     if (properties[0] !== "") 
     { 
     	this.initializeApp(properties[0], properties[1], properties[2], properties[3]); 
     }  
    			} 
    		}

    If you don't change anything (or replace globalThis with window), then the project fails to load in modules mode with the error that database is undefined. While in the classic mode, project is loading without any errors.

  • Those errors indicate there is not a global variable named "Firebase".

  • In this case you may need to update the firebase js file to declare the base object as globalThis.Firebase, for example at the end of the file you may be able to add:

    gloabalThis.Firebase = Firebase;

  • Hi everyone! I'm adding modules support to Rex_TimeAwayL plugin and I stuck into a problem. How to make the code in the localforage.js file global?

    I tried to do the same as with Firebase addon (write at the beginning var localforage2=function() {code}, and at the end globalThis.localforage2 = localforage2). But when I preview addon example, project fails to load with the error that localforage2 is not defined.

    In runtime files, functions from localforage look like this:

    localforage2["getItem"](key, callback);

    localforage2["setItem"](key, self.cache[key], onWriteTimer);

    Here is code in localforage.js: pastebin.com/mrQ9H7Kp

  • In runtimes, at top of each file try adding:

    const localForage2 = globalThis.localForage2;

  • Mikal Thanks for reply. It helped a little, but now another error appeared (screenshot below). I also tried to make some localforage script variables global (like a, j), but this error appeared again.

  • Can you share the entire file or perhaps the modified addon, I want to see the context of where you define const localforage2.

  • Try this version of localForage.js in the addon:

    sendgb.com/FQ3rBVs0MY1

    It looks like the old (1.4) localForage lib was not initializing due to how the top level function was declared / exported for C3 (it caused an error.)

    So, I updated to version 1.9 and added a declaration of globalThis.localforage2 = localforage_js; at the end of the localforage library.

    It seems to work now (at least for start time, get away time and print the expression of timeElapsed.)

    Good luck!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Mikal Thank you very much! I'll post it to my topic with ported plugins today.

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