Innacurate time using "Every x second"?

Get help using Construct 2

Post » Sat Feb 04, 2012 11:42 am

Hi folks!

I'm trying to create a time bar for a turn-based game. However I've stumbled upon a problem that I don't know if its a bug, or I'm missing something.

When I used "Every 1 second" things were fine. But for a 10 second turn, this bar will be pretty much useless (growing 10% at a time), so I decided to use "Every 0.1 second" - this way it would grow 1% at a time and reach the 100% nicely.

But I noticed time wasn't accurate anymore.

I went further and created a "Every 0.01 second" to check it out, and yes, it runs even slower. Tried sticking the magical "* dt" on the event part just to see if the numbers would at least even up, but it didn't work either.

I made a demo test, using 5 seconds as the turn time:
http://dl.dropbox.com/u/7324985/Every_Second_Test.capx

I don't know if this is a bug - if the "Every Second" event allows me to use fractions of second, then I'd classify it as a bug - but what's the best way to solve this?! I wanted to keep the global variable CycleSeconds so I can easily change the turn's time.

Thanks!
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Sat Feb 04, 2012 3:24 pm

I'm not sure but would it be more accurate if you would add dt on every step to CycleTest and then set the text to "Every 1 second: " & floor(CycleTest1)?nemo2012-02-04 15:25:09
B
40
S
5
G
5
Posts: 405
Reputation: 5,657

Post » Sat Feb 04, 2012 4:33 pm

This is actually a bug which should be fixed in the next build.

[quote][FIX] System 'Every X seconds' drifted off in accuracy over time, should be more accurate now[/quote]
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Sun Feb 05, 2012 4:00 am

Great Ashley! Thanks!
You can close the topic, move it to bugs...
B
107
S
40
G
10
Posts: 456
Reputation: 13,202


Return to How do I....?

Who is online

Users browsing this forum: kingpirux, Magistross and 6 guests