System wait bug, Freeze the game

Get help using Construct 2

Post » Sat Dec 28, 2013 8:39 pm

Hi, i don't know if my post is in the good section but well, I have a bug with the System wait command in a "While", it just freezes my game completely (i have to "Alt F4" it), I tried to use System wait in other places in my code and it works fine
Here is the screen (Remove the " " between <htt> and <p>) :

htt p://img15.hostingpics.net/pics/164785ScreenFreeze.png

(The array is a 2D Array)
(as i said, it doesn't wait the game just stop working, as if the wait command was repeated 1000000 times)
What i don't understand is that this loop works fine without the System wait command.

If anyone can see what would make the game freeze, that'd be cool :)
B
3
S
2
Posts: 5
Reputation: 385

Post » Sun Dec 29, 2013 12:14 am

New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
294
S
117
G
96
Posts: 7,312
Reputation: 71,092

Post » Sun Dec 29, 2013 2:29 am

You don't have any way to stop the while loop. Just take that event out and it wont freeze.
B
47
S
14
G
7
Posts: 603
Reputation: 8,141

Post » Sun Dec 29, 2013 12:29 pm

Oh sorry i forgot to descrive my array a bit more, it lookes like this :
[0] "Blabla"
[1] "bloubli"
[2] "#end"
For example, so as the while go through [n] it will go on "#end" and stop the loop. As i said this works fine without the "System wait" thing but when i add it freezes the game :/
B
3
S
2
Posts: 5
Reputation: 385

Post » Sun Dec 29, 2013 1:15 pm

It's not a bug, your events are wrong. Read the tutorial Kyatric linked to. The 'Wait' action does not pause the loop, so you never change the value of 'i' so the loop continues forever.
Scirra Founder
B
400
S
236
G
89
Posts: 24,546
Reputation: 195,471


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests