Multiple AJAX calls in For Loop sub events

Get help using Construct 2

Post » Sat Dec 17, 2011 2:56 am

Thank you. I will check out the plugin and consider the loop. I HAVE circumvented it by doing all of the searching in php right now and then parsing the data in the game's array. But I really want to learn everything that this can (and can't) do. :-)
B
3
G
1
Posts: 13
Reputation: 526

Post » Sat Dec 17, 2011 5:32 am

ive implemented it and works but will redo it, its better and faster just having 1 call, now its slow (like 5-8 seconds), maybe its just a bad host i dont know...   

but if you need help with the loop, just ask!
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sat Feb 11, 2012 12:02 am

on completed loop("tt") condition would be really nice, or some way to place events after a loop. Either one is really really really needed.

My situation is I have an ajax call that runs a loop taking tokens and once the process is completed I want the game to start. But there doesn't seem to be a way to trigger this except to maybe do a hack where is the a token is found that equals "START" then start the game. This seems rather lame hack because it requires that the received data from the server is correctly containing "START" at the end or the game will fail.

attached is a screen shot modified to show my fantasy completed loop event.
B
14
S
4
G
4
Posts: 20
Reputation: 3,676

Post » Sat Feb 11, 2012 1:10 am

@seac: System conditions, actions and expressions are built-in C2.
A custom plugin developper could do nothing about it.

You can already executes events after a loop :


No need for extra conditions, just remember event sheets gets executed from top to bottom.
In my screenshot (strictly an example, this code as it is is pretty useless):
When 0 = 0
Runs a loop "tt" from 1 to 10
Then will automaticly execute the actions from event 3 after the loop, as the blank subevent here, is at the same level as the loop.

Strange thing is that you setted it in your screenshot.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Previous

Return to How do I....?

Who is online

Users browsing this forum: Kagubro, Solomon and 23 guests