Time-triggered events are occasionally skipped

Get help using Construct 2

Post » Sat Oct 20, 2012 11:55 am

If you wouldn't mind loading the title of my game so I can explain the problem:

http://www.scirra.com/arcade/addicting-action-games/2014/rebound

As you see, the game's title "Rebound" is gradually formed step by step from first vertical and then horizontal lines. I do this by having a sprite with 3 animations, first vertical lines, then horizontal, and then the completed image with diagonals. The intended effect is to have lines move across the screen, and for the animations to change beneath these lines, and not for the animations to appear just out of the air, so to speak.

So, to time this I have for example an event such as "System Time = 2 seconds" event, which creates the vertical lines. Then a few seconds later the same kind of event to change the animation frame to 1 just at the moment the lines are passing over.

The problem is this type of event seems to be temperamental, and on certain loads either the vertical or horizonal lines, or both, fail to be created. Is there a reason for this? And has anyone recreated the problem when clicking the above link? BlueSkies2012-10-20 11:57:30
B
18
S
4
G
4
Posts: 68
Reputation: 3,127

Post » Sat Oct 20, 2012 12:58 pm

Instead of doing "system time = 2 seconds", which will indeed sometimes skip, use "system time > 2 seconds" and "trigger once".
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sat Oct 20, 2012 2:11 pm

You should always share a .capx so we can see exactly what you've done. If you've done 'Compare two values' and compared 'time' equals '2', it will almost never run because the time increments in ~16ms steps. If you did the system 'Compare time' condition and checked 'equal to 2', it should never skip because a workaround has been implemented in to that specific condition to prevent that problem.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Sat Oct 20, 2012 6:56 pm

I'm using 'Compare time' and I actually had it set to 'equal to 2.0'. Should this result in skipping when setting it simply to '2' shouldn't?

Either way, sqiddster's suggestion seems foolproof, so I'll implement that! Thanks!BlueSkies2012-10-20 18:59:52
B
18
S
4
G
4
Posts: 68
Reputation: 3,127

Post » Sat Oct 20, 2012 7:12 pm

@Ashley, that's interesting. I never realized there was a workaround there!
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sat Oct 20, 2012 7:15 pm

If you think there is a bug, please reproduce it in a new project from scratch and submit to the Bugs forum!
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478


Return to How do I....?

Who is online

Users browsing this forum: kingpirux and 6 guests