Thanks for this. I've implemented a countdown clock in minutes and seconds using other examples that are more complicated than your example. This is by far the easiest and best to me.
I made this exact same system except it counts up, and it's working pretty good! I also made the timer go up to the milisecond range. I just wanted to know if it's possible to put the " symbol between the timer numbers, and how.
That's really great to get it to the millisecond range. I'm guessing you're getting the syntax error message. To get the " symbol at the end of your text you will need to type the " symbol twice. So when you are setting your text you will need to type & """" which looks weird I know but trust me it works. There's actually 4 quotation marks there as you need to have the 2 quotation marks and they also need to be surrounded by quotations. Hope this makes sense
Hey, I have a big problem for my game. I don’t know how to make stats of 100 where every hour you get +/- 10. (when ur offline/online) I thought that you could help me thx 👍🏻
You could create a global variable called StopTheCount and set initial value to false. Then where it says System every 1 seconds in the event sheet, right click to add another condition. Then add the condition that global variable StopTheCount is equal to false. Then later on in your event sheet when you have your player die or you press a button or whatever the reason for stopping the count, you would set the global variable StopTheCount to True.
Thanks a lot ! we learn how to make video games on Construct 3 in my class and im on my third, i wanted to learn some more haha ! great tutorial ! i'll look around after i type the comment, but is there away for the count down to continue between scene? it goes back to the original number when i go to the next scene :/
No probs. Go into the event sheet for layout 2 and delete the whole line where it says System > On start of layout > System > Set TotalTime to 99 (or whatever number you are using).
Here is a One Drive link to a Construct 3 project that I made. It will show you how it works: 1drv.ms/u/s!AsVeqOb_ATB5gYs5ZxZVLv4TP3Vf-g If the link won't open, I shall explain here. What you would do is set the TotalTime global variable to 0 and also set the TotalTime global variable to 0 at the start of the layout. Then every 1 seconds you Add 1 to the TotalTime global variable. You will need to change the condition TotalTime > 0 to TotalTime < another number e.g. 900 would stop the clock at 15:00. (Note that < means it is less than)
I'm thinking that you would probably need to use the date plugin and store that data into local storage before exiting the app and then compare it to the current time and subtract the two. It's not something I have attempted so I don't know for sure if it would work. It might be best to go to www.construct.net/en/forum and in the How Do I? section search for the answer or create a new question and wait for someone to get back in touch. Hope this helps
To stop subtracting every second, you can create a pause button. This is one method to do it: 1) Go into the layout and double tap to add the Touch plugin. 2) Create a sprite for the pause button. 3) In the events tab add a global variable called PauseGV and set its initial value to 0. 4) System > On start of layout > Set global variable PauseGV to 0. 5) Right click to add another condition: System PauseGV = 0 and put this where it already says System Every 1 second & TotalTime > 0 6) Click Add event on the bottom of the event sheet. Touch > On tap object, choose the pause sprite you've drawn. Right click to add the condition PauseGV = 0, System Wait 0 seconds > System Set value of global variable PauseGV to 1 7 Click Add event on the bottom of the event sheet. Touch > On tap object, choose the pause sprite you've drawn. Right click to add the condition PauseGV = 1, System Wait 0 seconds > System Set value of global variable PauseGV to 0
I am really grateful for the work you did, but to make this countdown simpler for me, I've just put a timer on a Sprite and taken the value@@GameFavorites
I have just tested out a formula for milliseconds which should have worked perfectly. However, I'm finding that there is a lag when going down into the millisecond range and that lag builds up a lot and gives an incorrect count down. I doubt I went wrong with the math but here is the formula if you want to check for an error: Global variable = MTime On start of layout > set Global variable MTime to 60000 Every 0.01 seconds with a condition MTime greater than 0, System Subtract 1 from MTime. Underneath this action, I had Text set text to zeropad(floor(MTime/6000),2)&":"&zeropad(floor(MTime/100%60),2) & ":" & zeropad(floor(MTime%100),2) Comment 1 second = MTime set at 100 1 minute = MTime set at 6000 (100 x 60 seconds) 1 hour = MTime set at 360000
I just checked something and I have now got a solution that would fix the lag and give you a millisecond countdown timer. If you change the System every 0.01 seconds to 0.02 seconds. Then change the subtract 1 from MTime to subtract 2 from MTime. This will now countdown with no lag at all. It may not display the countdown as fast as you might have hoped for but I think there is a problem calculating things down at the 0.01 second range. It could be that it is faster than the tick rate, I'm not sure. I know that this solution will mean that you don't see any odd numbers in the millisecond countdown but hope this helps with your project.
Hey bro for my assignment i need to end the game when the player lives ends how ddo i do this? To show the game over screen? Can you make a vid today asap or explain? Thanks
That's a good question. If you scroll down to the very bottom comment from my video, you'll see my solution for it. Any problems with it, just let me know
Thanks. Thats work. I did it for 2 minutes
Thanks :3
Thanks for this. I've implemented a countdown clock in minutes and seconds using other examples that are more complicated than your example. This is by far the easiest and best to me.
That's great to hear and I'm glad it has helped you out
Thanks for the tutorial! you helped me alot.
wow, thats exactly what i was lookin for! Thank you!
Thank you so much. Extremely easy to follow and very helpful. Good luck to you and your endeavors!
Thanks!
Thank you for your tutorials it's super helpful.
Thanks 😀
Please teach us how to use "signal" & "wait for a signal" 👏👏
I tend to control the timing of events with variables but signals could be useful and might have to look into it at some point
Thank you so much friend! I was looking for this
I'm glad it helped
BLESS YOU!!!
I made this exact same system except it counts up, and it's working pretty good! I also made the timer go up to the milisecond range.
I just wanted to know if it's possible to put the " symbol between the timer numbers, and how.
That's really great to get it to the millisecond range. I'm guessing you're getting the syntax error message. To get the " symbol at the end of your text you will need to type the " symbol twice. So when you are setting your text you will need to type & """" which looks weird I know but trust me it works. There's actually 4 quotation marks there as you need to have the 2 quotation marks and they also need to be surrounded by quotations. Hope this makes sense
@@GameFavorites Oh, thank you so much for helping! It's all working now.
Thanks!!))
muchas gracias amigo
Hey, I have a big problem for my game.
I don’t know how to make stats of 100 where every hour you get +/- 10. (when ur offline/online)
I thought that you could help me thx 👍🏻
Good!
thanks it helped me in a pinch
Always happy to help and thank you for taking the time to leave your comment
This is great! But how do you stop the count?
You could create a global variable called StopTheCount and set initial value to false. Then where it says System every 1 seconds in the event sheet, right click to add another condition. Then add the condition that global variable StopTheCount is equal to false. Then later on in your event sheet when you have your player die or you press a button or whatever the reason for stopping the count, you would set the global variable StopTheCount to True.
Thanks a lot ! we learn how to make video games on Construct 3 in my class and im on my third, i wanted to learn some more haha ! great tutorial ! i'll look around after i type the comment, but is there away for the count down to continue between scene? it goes back to the original number when i go to the next scene :/
No probs. Go into the event sheet for layout 2 and delete the whole line where it says System > On start of layout > System > Set TotalTime to 99 (or whatever number you are using).
What if you want to start from 00:00 and increasing? How to do that
Here is a One Drive link to a Construct 3 project that I made. It will show you how it works: 1drv.ms/u/s!AsVeqOb_ATB5gYs5ZxZVLv4TP3Vf-g
If the link won't open, I shall explain here. What you would do is set the TotalTime global variable to 0 and also set the TotalTime global variable to 0 at the start of the layout. Then every 1 seconds you Add 1 to the TotalTime global variable. You will need to change the condition TotalTime > 0 to TotalTime < another number e.g. 900 would stop the clock at 15:00. (Note that < means it is less than)
How Do u make a timer work when ur not in the app
I'm thinking that you would probably need to use the date plugin and store that data into local storage before exiting the app and then compare it to the current time and subtract the two. It's not something I have attempted so I don't know for sure if it would work. It might be best to go to www.construct.net/en/forum and in the How Do I? section search for the answer or create a new question and wait for someone to get back in touch. Hope this helps
then how to stop subtrack every second in the memory?
To stop subtracting every second, you can create a pause button. This is one method to do it:
1) Go into the layout and double tap to add the Touch plugin.
2) Create a sprite for the pause button.
3) In the events tab add a global variable called PauseGV and set its initial value to 0.
4) System > On start of layout > Set global variable PauseGV to 0.
5) Right click to add another condition: System PauseGV = 0 and put this where it already says System Every 1 second & TotalTime > 0
6) Click Add event on the bottom of the event sheet. Touch > On tap object, choose the pause sprite you've drawn. Right click to add the condition PauseGV = 0, System Wait 0 seconds > System Set value of global variable PauseGV to 1
7 Click Add event on the bottom of the event sheet. Touch > On tap object, choose the pause sprite you've drawn. Right click to add the condition PauseGV = 1, System Wait 0 seconds > System Set value of global variable PauseGV to 0
I am really grateful for the work you did, but to make this countdown simpler for me, I've just put a timer on a Sprite and taken the value@@GameFavorites
yow bro, can i ask how to make formula for millisecond?
I have just tested out a formula for milliseconds which should have worked perfectly. However, I'm finding that there is a lag when going down into the millisecond range and that lag builds up a lot and gives an incorrect count down. I doubt I went wrong with the math but here is the formula if you want to check for an error:
Global variable = MTime
On start of layout > set Global variable MTime to 60000
Every 0.01 seconds with a condition MTime greater than 0, System Subtract 1 from MTime. Underneath this action, I had Text set text to zeropad(floor(MTime/6000),2)&":"&zeropad(floor(MTime/100%60),2) & ":" & zeropad(floor(MTime%100),2)
Comment
1 second = MTime set at 100
1 minute = MTime set at 6000 (100 x 60 seconds)
1 hour = MTime set at 360000
I just checked something and I have now got a solution that would fix the lag and give you a millisecond countdown timer. If you change the System every 0.01 seconds to 0.02 seconds. Then change the subtract 1 from MTime to subtract 2 from MTime. This will now countdown with no lag at all. It may not display the countdown as fast as you might have hoped for but I think there is a problem calculating things down at the 0.01 second range. It could be that it is faster than the tick rate, I'm not sure. I know that this solution will mean that you don't see any odd numbers in the millisecond countdown but hope this helps with your project.
@@GameFavorites thanks dude, i gonna try ur suggestion,thanks a lot 👍🏻
Hey bro for my assignment i need to end the game when the player lives ends how ddo i do this? To show the game over screen? Can you make a vid today asap or explain? Thanks
I shall try to do a video as it will be easier to explain
My video explaining things is now on TH-cam, here is the link: th-cam.com/video/28nMTRKOE4Y/w-d-xo.html
Could you please write (in the description or in the comment) how to add the millisecond? 🙏
That's a good question. If you scroll down to the very bottom comment from my video, you'll see my solution for it. Any problems with it, just let me know
@@GameFavorites ❤