Game Timer/Counter.

Get help using Construct 2

Post » Sat Jul 07, 2012 4:02 pm

Sorry, bringing this back to life, but milliseconds doesn't appear to be working for me. If I slow the time down, I can see that the milliseconds actually appears to loop 2-3 times before the seconds tick.

Milliseconds = timer-floor(timer)
right("00"&minutes,2)&" : "&right("00"&seconds,2)&" : "&right("00"&Milliseconds,2)

What am I missing? :(
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 930
Reputation: 9,358

Post » Sun Jul 08, 2012 10:36 am

Is there a new way of doing a timer? I seem to remember seeing a plugin for it. Is the plugin better than the manual method?
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 930
Reputation: 9,358

Post » Sun Jul 08, 2012 11:59 am

@AnD4D
Yes, I have made a Time Manager plugin, which has different types of counters.
You can find the plugin here: http://www.scirra.com/forum/topic49030.html

The plugin counter works basically the same way as the manual timer, but its much easier and faster to create and use, than doing it the manual way. And you have a lot of different features you can do with the plugin, which you have to create yourself with the manual method.

The downside with a plugin, is that it's not accepted to use 3rd party plugins in the Scirra Arcade. So if you want to publish your game there, you have to go the manual way.
B
38
S
13
G
9
Posts: 151
Reputation: 8,427

Post » Sun Jul 08, 2012 3:07 pm

@AnD4D
Try right("000"&miliseconds,3) instead.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sun Jul 08, 2012 6:52 pm

I think I'm doing something wrong. It's showing 3 digits now going extremely fast, all the way up to 999, so I guess it's working, but I'd really only like to show the first 2 digits out of the 3.

right("00"&Minutes,2)&" : "&right("00"&seconds,2)&" : "&right("000"&Milliseconds,3)

Eventually I am to turn this into a leaderboard score, so hopefully it'll work!!!
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 930
Reputation: 9,358

Post » Sun Jul 08, 2012 8:53 pm

left(right("000"&milliseconds,3),2) then.
Or right("00"&str(floor(milliseconds/10)),2)
Something like that
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Mon Jul 09, 2012 12:33 am

Ah, thanks a lot as always Yann! That looks like it got it. The only problem I see now is that it occasionally shows a .3 instead of a normal number when it's in double digits. Seems random, and I can't pin point when it appears. Time to look to using this in a leaderboard soon methinks :)
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 930
Reputation: 9,358

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests