rhg1968's Forum Posts

  • It's been 3 days and I would really like some direction on how to implement looping in the new runtime. I was able to figure it out looking at examples on the old runtime, but haven't had much luck with the new runtime.

    I also again want to make the suggestion that there should a api reference page where you look up all public apis and brief descriptions on their use.

    Even the old construct 2 sdk documentation doesn't list all of the available methods you need to accomplish tasks.

  • Ashley

    Any help on this would be greatly appreciated. I have the construct3 old runtime of my Json Manager working, but I am stuck on the new run time version.

    To complete the C3 on the old run time was only possible by looking at examples of others since I couldn't find any api documentation to help me understand re-triggering in a looping structure that I did implement in my plugin.

    But now moving to the new run time I can't find any api documentation or examples of others that have implemented a looping condition. I tried inspecting the objects in the chrome debugger and calling the methods I thought were correct, but I am getting errors.

    Is there any guidance on this or better yet an example of this being implemented in the new run time ?

  • I just created a dummy project and read that url in using ajax and then populated the array.

    I then used the browser control to disply Array.At(0) and I get 1. So it appears to be working

  • Are you using the ajax control to get the data string first ?

    Once you get the data/string from the ajax call, you load the array with the string you just got.

  • Do you see any error messages in the console ?

  • I also created a json manager plugin that is on the add on page that can load a standard json file and then output a portion of it to a c3 array and c3 dictionary.

  • The general format is correct for C3. Everything is specified as 3d array basically. Here are examples

    3d

    {

    "c2array": true,

    "size": [ 2, 3, 4 ],

    "data": [ [ [ 100, 200, 300, 400 ],

    [ 101, 201, 301, 401 ],

    [ 102, 202, 302, 402 ]

    ],

    [

    [ 110, 210, 310, 410 ],

    [ 111, 211, 311, 411 ],

    [ 112, 212, 312, 412 ]

    ]

    ]

    }

    2d & 1d, depending how you look at it

    {

    "c2array": true,

    "size": [ 1, 4, 1 ],

    "data": [ [ [ 1 ],

    [ 2 ],

    [ 3 ],

    [ 4 ]

    ]

    ]

    }

    {

    "c2array": true,

    "size": [ 4, 1, 1 ],

    "data": [ [ [ 1 ]

    ],

    [

    [ 2 ]

    ],

    [

    [ 3 ]

    ],

    [

    [ 4 ]

    ]

    ]

    }

  • I am using this.runtime.getProjectFileUrl in my plugin to load files that are included/imported into the project. Which works great in preview mode, but I am noticing some issues in the export that I would like to know if anyone else has some suggestions.

    When exporting to android it stopped loading the files, so I decided to export to html so I could easily see what may be going wrong.

    On the Html side the imported files are just exported in the root directory of the zip file generated by construct 3, not in any subfolder.

    When stepping through this.runtime.getProjectFileUrl function it sets the path to file to media/filename, which of course it can't find the file in that location.

    If I modify the path in the debugger it works.

    So my question is, when exporting projects that have imported files, should they be put in the appropriate subfolder by construct 3 or is that something we have to manage ?

    Note: I am also assuming that something similar is going on with the android export.

    Note Note: I know I could check if I'm in preview mode and not use that function and just the filename that it'll work since it's in the root.

    Any suggestions would be appreciated. Thanks...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley

    I currently have completed my C3 plugin, JsonManager, running on the old run time. I am struggling to get it working on the new run time. My main issue is that I can't seem to find documentation of all of the exposed public api's. Looking through the docs I can't find anything on retigger, getting the current event, etc... I was able to discover some of this in chrome debugger but my call in the new run time fails on the Retrigger method in my loop. With the old runtime for C3, the retrigger method works as expected.

    So my question, finally :), are there spots in the documentation I am missing or example plugins I can look at in the new run time that implement looping ?

    My suggestion is can you guys also create just an api page that has all of the public facing apis listed with links to details on each one.

    Just wanted to throw this out there.

    Also just wanted to throw another comment in here that I really love construct 3 and keep up the great work.

  • The addon page has been unavailable with a 500 error for a couple of days now.

  • I just published version 0.5.1. It allows json files to be loaded by url also. It's mentioned in the release notes and in the documentation, you do have to be careful with this.

    The plugin was originally designed to work with files local to the project.

    The preview windows runs with https(ssl) so if you try to call to your web server on your local machine to serve up a json file with http, it will fail.

    You can get around these issues for local testing by using http://127.0.0.1:port# , Since this is trusted by browsers and it will allow a call from https to http. However you may need to set your local web server to respond with Cors headers to get it to work.

    When I did this I was able to load the two files in the included example plugin test and a third one from a url on my local machine.

  • Ok, I posted a note in the documentation pointing out that it only works with local files right now and I'll add support for remote files

  • I am actually explicitly looking in the local files in a project for the json file. I can modify the code to be able to make external requests also.

  • The sample that I included seems to work for me so I'll have to look at that if that's not working for you

  • Was that your application or the sample one that I included ?