Suggestion: Move the data.js file load out of c2runtime.js

0 favourites
  • 3 posts
From the Asset Store
Move Block
$10 USD
Captivating puzzle game. With challenging gameplay, this game will keep you very engaged.
  • Ashley Or whoever else programs the HTML5 exporter for C2:

    Would it be possible to move the data.js (or data.json) file call out of the c2runtime.js file, or possibly load it from the configurable "Project Files" directory in the export options?

    Due to the security proxy system that I am using, I have to update the block of code in the c2runtime.js file that loads that file every time I export our project. This isn't exactly a high priority, just more a nuisance that I wanted to make you aware of... a nice-to-have.

    These are the lines of code that I have to modify:

    Runtime.prototype.requestProjectData = function ()
    	{
    		var self = this;
    		var xhr;
    		if (this.isWindowsPhone8)
    			xhr = new ActiveXObject("Microsoft.XMLHTTP");
    		else
    			xhr = new XMLHttpRequest();
    		var datajs_filename = "/res/data.js";
    		if (this.isWindows8App || this.isWindowsPhone8 || this.isWindowsPhone81)
    			datajs_filename = "/res/data.json";
    		xhr.open("GET", datajs_filename, true);
    		var supportsJsonResponse = false;[/code:2o2v47k5]
    
    from a raw "data.js" / "data.json" to pointing it to the Project Files resources directory at "/res/*"
    
    Not high priority, but this would be a nice-to-have.
  • Isn't this just because your proxy is mis-configured? If the runtime can't load data.js by default, then presumably other AJAX requests will fail for the same reason, and possibly images, audio and video will fail to load too.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well, yes, and no. I can get around this, but it is annoying to have to have a specific proxy entry for this file. That is why I say it's not high priority, just a nice-to-have.

    EDIT: Actually let me explain in a bit greater detail:

    We are running two separate Construct2 projects (one for the website, one for the client) on the same domain and we cannot have two entries pointing to the same file, because they are not the same file. This is primarily why I am asking that it be tied to the resources directory, as that would allow me to configure it in the export options without having to go and modify either the website export code or the client export code.

    Either way though, thanks for your work, and we are anxiously awaiting C3. We are setting aside funds right now to buy several licenses of the ultimate version of C3.

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