tlarkworthy's Recent Forum Activity

  • I think there is enough material for any motivated individual to build a new plugin version. You have done plenty :p

  • My game that has no random elements, behaves differently every time I run it. I use the Box2D stuff so I wonder if that's the source and if anyone knows the fix?

  • HALLELUJAH!!!!!

    4 and a half hours later I have it working!

    The only holdup with SaveLoadStatus is that is does not like transferring data between layouts. The internal SDK loadInstanceFromJSON check the layer, and kills the instance if it can't find the correct layer to put the instance in. This is unfortunately is always the case when you load instance data from a different layout than you use the data :s

    Anyway I altered rexrainbow's SetStatus to overwrite the JSON data when loading, so the instance will be recreated *except* the layer info.

        Acts.prototype.SetStatus = function (obj_type, status)
         {     
            if (!obj_type)
                return; 
            status =  JSON.parse(status); 
              console.log("loading...", status);
             //if (obj_type.sid != status["sid"]) //removed, protection against instanciating in different layers
            var insts = obj_type.getCurrentSol().getObjects();
            var i, cnt=insts.length;
            for (i=0; i<cnt; i++){
                   status["w"]["l"] = insts[i].layer.sid //force loaded object into layer of containing instance
                this._set_status(insts[i], status);   
              }
         };   
    

    (It looked like in the code you knew this Rex but it did not work for my use case.)

  • Thanks rexrainbow,

    I think that plugin will work for me.

    Note to future people: InstanceBank's JSON data won't work between exported websites and the development versions due to

    scirra.com/forum/help-me-fix-instancebank-across-exports_topic78823.html

  • Yeah, I thought that might be the case. So 3rd party plugin InstanceBank is nice as its an easy way to serialise a lot of data, but its to and from JSON data methods relies on reflection to find definitions.

    I would consider this reverse engineering protection similar in spirit to minification. Thus, I would like to be able to turn it off. Anyway, don't complicate your code base on my behalf. I will bite the bullet and write a proper serialisation mechanism for my project. The JSON serialization was a bit inefficient anyway.

    Thanks

  • I am trying to debug an issue in the InstanceBank plugin:

    scirra.com/forum/plugin-instance-bank_topic62131.html

    This one is hard as I don't know my way round the SDK, basically there is a line which crashes depending on the deployment

    var objtype = runtime.types[save_obj["type"]];

    which when I run the project directly from construct 2 the save_obj["type"] contains "c_laser" (a names type from my project). And the type is looked up from the runtime no problem.

    However, when I run it from a served HTML 5 webpage, the line crashes because runtime.types does not contain "c_laser", it not contains things encode "t1" ... "t50".

    So I assume the type names have been compressed or something, but I did not minify when exporting the project (though I would like to in the future).

    Is the inconsistency in the runtime.types dictionary to be expected??

    Is there a different way of looking up runtime types by name?

    I would like to be able to develop big object graphs in the development site and still be able to read them afer exporting them to a different runtime. Is that a crazy idea?

    Thanks

    Tom

  • Found another bug that the saved instance map doesn't get wiped after a loadBankFromJSON.

    Its a fairly simple fix.

    I people want the bug fixes I would consider putting it on github

  • Clean bank does not clear saved instance map which can cause some weird bugs down the line. I suggest changing JS "CleanBank" to:-

    InstBankKlassProto.CleanBank = function()
         {
            hash_clean(this._bank); 
            hash_clean(this._saveduid2inst_map); //NEW LINE
         }; 
    
  • Great work! I think there is a bug with the picked by saved UID.

    After load all instances, picking by saved UID causes a duplication.

    The javascript code I think is wrong is

    InstBankKlassProto.LoadAllInstancesEpilogue = function()
    {
            this._z_sorting.Sorting();
            hash_clean(this._saveduid2inst_map);
    }; 
    

    The map of UIDs->saved instances is wiped after loading. I don't think this is the correct behaviour for using the pick by saved UID functionality after a load all instances.

    Anyway, to fix I just commented out the hash_clean line. Works for my program although obviously I might not understand the intended full semantics of the plugin.

    PS the duplication occurs because invalid pick params to pick by saved ID lazily creates an instance if none exists. I wonder if this is a bit dangerous, better to alert an error?

  • Yes I am an idiot.

    serving the webpage on HTTP does make it all work. (it did work on FF though without)

    Many thanks

  • NOTE: this is a copy and paste of a closed bug report I posted yesterday. It was closed because "I did not post valid URL". I am unable to post valid URLs due to the forum rules of new members. Hence I replaced the HTTP_COLON_SLASH_SLASH_dropbox.com part of the URL with something that went through...

    Link to .capx file (required!):

    HTTPS_DROPBOX_DOMAIN/s/rb5lmsgdjeirexu/darwin_galaxy.capx

    Steps to reproduce:

    1. export to HTML5 website (HTTPS_DROPBOX_DOMAIN/sh/2pan66j29s0smgp/6MABET_jrO)

    2. open index.html with browser

    Observed result:

    javascript console outputs

    "Uncaught SecurityError: An attempt was made to break through the security policy of the user agent. "

    and the screen is black

    Expected result:

    loads a screen with a few sprite in it

    Browsers affected:

    Chrome: yes

    Firefox: no

    Internet Explorer: not tested

    Operating system & service pack:

    Chrome problem repeated on

    1. Ubuntu 12.04 (32-bit), chrome version 29.0.1547.76,

    2. Nexus 4 30.0.1599.82

    works on windows chrome though

    Construct 2 version:

    R146 32-bit

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Link to .capx file (required!):

    HTTPS_DROPBOX_DOMAIN/s/rb5lmsgdjeirexu/darwin_galaxy.capx

    Steps to reproduce:

    1. export to HTML5 website (HTTPS_DROPBOX_DOMAIN/sh/2pan66j29s0smgp/6MABET_jrO)

    2. open index.html with browser

    Observed result:

    javascript console outputs

    "Uncaught SecurityError: An attempt was made to break through the security policy of the user agent. "

    and the screen is black

    Expected result:

    loads a screen with a few sprite in it

    Browsers affected:

    Chrome: yes

    Firefox: no

    Internet Explorer: not tested

    Operating system & service pack:

    Chrome problem repeated on

    1. Ubuntu 12.04 (32-bit), chrome version 29.0.1547.76,

    2. Nexus 4 30.0.1599.82

    works on windows chrome though

    Construct 2 version:

    R146 32-bit

tlarkworthy's avatar

tlarkworthy

Member since 17 Oct, 2013

None one is following tlarkworthy yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies