Ajax refusing to load project file

0 favourites
  • 6 posts
From the Asset Store
With this template you can create your own archer game and customize it however you want.
  • Hi, I've been having an issue for a very long time with loading Ajax files after a layout has been reset, or if the game has progressed to a different one. Everything works flawlessly when I only playtest individual layouts, without playing through the entire game.

    However, once I restart a layout, or progress to a different one, construct occationally doesn't register the requested ajax file, and the game progression gets stuck in limbo. It's completely random whenever the ajax loads and doesn't.

    Sometimes it works without any problems, but most of the time nothing happens.

    Here's a picture of the event in question: puu.sh/2UAa2.png

    Is there any foolproof way of guranteeing that an ajax loads, and that the ".LastData" gets assigned to a text object? I've only playtested using google chrome and node webkit.

    Thanks

    Tom

  • What does the browser error console say when the AJAX request fails?

  • I don't get an error message. It's more like it simply skips the event entirely. It has also occured that construct simply waits up to approx. 40 seconds, and then imports it.

    I haven't been able to find a pattern that allows me to trigger it on command though. Sorry. I can try uploading a capx. file and have you take a look at it?

    Thanks

    Edit: Oh wait I haven't checked out the error console. I'll try to get to the bottom of it.

    Edit 2: Nothing shows up in the console either. It's like I said first, the event is skipped over.

  • Here's the capx: mediafire.com

    Here's how to trigger the bug: Start playtesting on the layout "tutorial level". Complete this level and make it to tutorial level 2. This level begins once you fall down to a platform. There's a text object right next to the character that should say "Success!", indicating that the ajax file was successfully imported. However 70 % of the time it just stays at "Text". If you try playtesting only the beginning of "tutorial level 2", the ajax will successfully load 100 % of the time. I have no clue whatsoever over why this happens.

    Tutorial level 2 uses the "tutorial level 2 sheet." The events controlling the importing of the ajax files are event-line 4 and 7. Event 51 is the event utilizing the information from the ajax file.

    Event 54 - 57 are spawning projectiles based upon the values given from the ajax file.

    This issue has been bothering me for weeks, and I would be eternally grateful to whoever can point out a way to gurantee that the Ajax loads.

    Thanks

    Tom

  • Hi, I narrowed the problem down to this file: Fireflight_edit.ogg

    In "tutorial level" - event 19, when you play that sound then all requests after it fail (AJAX requests and C2's _reloadpoll_ requests).

    <img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/failRequest.PNG" border="0" />

    This only happens in Chrome and it only happens in preview. It works ok when exported.

    I think it's got to do with file size. I tried playing a 10MB ogg file in a new project and got the same problem. Made the file smaller and it works.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am amazed. I'll keep it in mind when designing further content.

    THANK YOU!

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