Thndr's Recent Forum Activity

  • After spending quite a few hours trying to work things every which way I've just decided to mimic how AJAX calls are tagged and triggered to ensure I can direct the data where I need to as the asynchronous stuff works fine with condition triggers

  • I currently have this code that sends everything to the console.log just fine, but when it comes back into Construct it always displays the textbox(messagebox) name or C2function name(bothlogs), depending if I'm calling the temp variable or the expression within the C2Function

    	Exps.prototype.getText = function (ret, stuff_)
    	{
    		var varself = this;
    		function.get(stuff_)
    		.then(function(content) {
    			// .replace to remove control characters from the string
    			varself.msgContent = ((content).toString()).replace(/[\x00-\x09\x0B-\x1F\x7F-\x9F]/g, "");
    			console.log("Retrieved: " + varself.msgContent);
    			return varself.msgContent
    		})
    		.then(function(text) {
    			console.log("Returned: " + text);
    			ret.set_string(text);
    		})
    		.catch(function(err) {
    			if(err){
    			varself.dataError = (err).toString();
    			console.log(varself.dataError);
    			}
    			varself.msgContent = ("error " + varself.dataError).toString();
    			ret.set_string(err);
    		});
    
    	};
    [/code:37md67hx]
    [img="https://i.imgur.com/5dtZhH9.png"]
    [img="https://i.imgur.com/623HJcT.png"]
    
    Theoretically it should return with the same thing the console.log functions produce but I can't seem to get it working. I'm assuming it's something to do with it being a promise rather than a linear function.
    
    My goal is to have the plugin.getText() expression be able to immediately get the text, as currently I have it 'working' with an action/triggered condition combo but that's not ideal for directly applying the text it to object instances on demand. If someone could help me
  • In order to solve an issue with selecting an <input> object (button, filechooser, etc.) based off from it's HTML CSS ID I created a simple plugin that would allow me to do so.

    Since I've received some requests for the plugin itself I'll release it here

    https://github.com/Thndr/c2-ChangeCSSID

    All it is, is a function with an Action to find the first instance of a field with the CSS ID of 'oldID_' and then replaces it with 'newID_'

       Acts.prototype.changeID = function (oldID_, newID_)
       {
          var file_ = $("#" + oldID_);
          file_.attr('id', newID_);
       };[/code:27qsytfr]
    
    [img="https://i.imgur.com/KDNavBP.png"]
    
    Due to the timing on how it works you have to have a fake delay/skip 1 step before the function if you are using it on complete.
    I have not tested this plugin when you already have <inputs> and you mass change them, but if you change them when they spawn there should be no conflicts of it attributing the value to the wrong object.
    
    Also make sure the page you embed the project doesn't use the same CSS IDs or there might be an issue as well, as I have no tested that.
    If anyone has a suggestion on how I can target specifically the object's HTML element without needing the old CSS ID then I could remove one line out of the two needed for this function, and it will provide better assurance the wrong element isn't selected.
  • So as a temporary solution I've made another custom plugin that literally does this:

    	Acts.prototype.changeID = function (oldID_, newID_)
    	{
    		var file_ = $("#" + oldID_);
    		file_.attr('id', newID_);
    	};[/code:1jrqi8ut]
    
    In events:
    [img="https://i.imgur.com/KDNavBP.png"]
    
    I made it a plugin because I didn't want to use BrowserExecJS due to potential issues, but I might end up just reverting to it if the custom plugin is just annoying to deal with.
    
    An inelegant work around for now, but I'd be surprised if there was really no way to pass the info I need through normal Construct functions.
  • I have a FileChooser input element on the canvas that I currently use the ID property to select it with a custom plugin. At the moment I'm using a string to manually select that ID and I would like to use an expression within Construct to load the ID of the specific instance I select within the events; however, there is no obvious expressions under the object to do so that I can find.

    Other than manually setting an instance variable to the same name as the ID for each instance manually created is there another way to get that ID or even generate the ID upon the creation of an instance of the FileChooser?

    It's not a big deal since I can manually hard program the fields on each instance if needed or a different work around, but it would be useful if I could set and select them via the event system.

    ----

    If the above is not possible would it be possible to pass the instance's input element to the function itself if I have it targeted in my events? I am currently using $("#ID") to select it but if I could just bypass it all around and retrieve the file's blob(not blobURL) and pass that through then that would elminate the need to even put in IDs for each input as I could just use the event system's instance selection.

    I current use a manual ID string and then have the plugin detect the file using this line

    var file_ = $("#" + fileInputID_);[/code:3vkggff3]
  • https://www.scirra.com/blog/186/construct-3-on-mobile

    This blog post by Ashley links to the chromium blog post on progressive web apps

    https://blog.chromium.org/2017/02/integ ... eeply.html

  • Everade

    https://www.scirra.com/blog/204/the-fut ... -3-runtime

    [quote:1sjze2vz]Enable hosting the runtime in new environments like a Web Worker, or a headless mode in Node

    This sounds like what you want.

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

  • Try Construct 3

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

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

    [quote:1ei4kesf]A page with Scirra tested benchmarks for each platform(PC/Mac/Linux with PC specs, Android/iOS with model, wrapper vs browser) with a Construct 2/3 version of the exported test file would work wonders in giving people an idea of how relative their current devices are to the test devices.

    We already ship some in Construct 3, in the tech demos section.

    I meant more of a page outside of the program that lists the benchmarks done on Scirra owned testing platforms along with the platform technical details to set expectation levels.

    I've been playing around with it little myself and I like your recent blogpost where you can link to them directly.

    Is there c2 plugin support for in c3? i mainly ask because if there isn't then yes, a export package of some kind or even access to the cloud exporters (or whatever is going on with c3) could be extended to c2 devs who have projects that rely on plugins. I know all of my c2 games do.

    With some minor tweaking they should work fine.

    https://www.scirra.com/blog/193/addons-in-construct-3

    [quote:9jmpqwxy]For addon developers

    Construct 3's addon format is generally similar to Construct 2's. However third-party plugins and behaviors will need to have their editor script (edittime.js) rewritten in to a new format for Construct 3. This basically involves rewriting the action, condition and expression (ACE) tables in to a new format, and moving UI strings to a separate language file to facilitate translation. However the runtime script (runtime.js) should continue work unmodified. There are a small number of runtime features that have changed in Construct 3, but these are usually trivial to update. We'll provide documentation and assistance on the forum around this. We're aiming to have initial documentation on addons ready as early on during the public beta as possible so addon developers can get a head start on porting. Overall it ought to be a quick job to port Construct 2 plugins to Construct 3.

    We're aware some third-party developers sell their addons and might not want them bundled with projects. We will provide a way for addons to opt-out of bundling so they stay in the editor only.

    For the cloud exporters I assume it's just taking the HTML5 export and putting it through a wrapper, thus not requiring any special plugin code for that. If that's the case it also means they could document the process so you could roll your own with the same process they use.

    https://www.scirra.com/blog/187/buildin ... onstruct-3

    However, the blogpost however doesn't specifically state what sort of technology they're using for the cloud based mobile build process. Hopefully they'll have more information on how they're doing this in the future.

    Ashley is there any technical limitations not allowing us to use the C3 build service for C2 projects. In an ideal world you would just upload your c2 export in zip file and building with the c3 build service. Until C3 matured and most major plugins has become available to c3.

    That is their ideal to just import C2 into C3 without issue. With their official plugins/addons I would expect no issues, but for third party plugins/addons you would need for the plugin to be modified

    Construct 2 and Construct 3 export to the same canvas engine and they even advertised taking C2 projects into C3

    https://www.scirra.com/blog/191/saving- ... onstruct-3

    [quote:9jmpqwxy]Importing Construct 2 projects

    As promised, Construct 2 projects import to Construct 3 with high fidelity. Construct 3 has all the same features Construct 2 has, and we've written an importer to read the XML-based Construct 2 project format and load it in Construct 3. This is well-tested, as we've been able to import large, complex Construct 2 projects kindly donated by developers like Aurelien Regard (The Next Penelope) and Daniel West (Airscape). So you can rest assured your project will import correctly. (Note if you use third-party addons, you will need to install Construct 3 versions of the addons before importing.)

    I have asked Ashley to respond directly to my post.

    You seem to be more of a cheerleader trying to run interference so I would ask that you not respond to me until I have heard a response directly from Ashley to my question.

    You reposted the same post and keep saying the same things without addressing any questions when others are asking you to clarify things due to you being ambiguous.

    What is wrong with it being browser based?

Thndr's avatar

Thndr

Member since 15 Oct, 2012

None one is following Thndr yet!

Connect with Thndr

Trophy Case

  • 12-Year Club

Progress

12/44
How to earn trophies