Ajax refusing to load project file

Get help using Construct 2

Post » Thu May 16, 2013 2:28 pm

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: http://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
B
22
S
7
Posts: 316
Reputation: 2,490

Post » Thu May 16, 2013 4:02 pm

What does the browser error console say when the AJAX request fails?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Thu May 16, 2013 5:20 pm

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.Tinimations2013-05-16 17:42:29
B
22
S
7
Posts: 316
Reputation: 2,490

Post » Fri May 17, 2013 11:05 am

Here's the capx: http://www.mediafire.com/?6p37ebxa2vpjr9d

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
TomTinimations2013-05-17 11:07:03
B
22
S
7
Posts: 316
Reputation: 2,490

Post » Fri May 17, 2013 6:35 pm

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).



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.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Fri May 17, 2013 8:16 pm

I am amazed. I'll keep it in mind when designing further content.
THANK YOU!Tinimations2013-05-17 20:23:01
B
22
S
7
Posts: 316
Reputation: 2,490


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests