Digital countdown timer

This tutorial will teach you how to make a 59 second digital countdown which activates after pressing a button.

To start off with we will want to create the numbers, select the front faces of each piece and select a bright texture (i recommend lights/white001) select all the pieces and change them all to func_wall.
name each individual piece, this is what i named mine:

news post image

Select all the pieces and change the fx color to something really dark like 10 10 10

news post image

Make a logic_timer which starts disabled, has a refire interval of 10 seconds and a name. i named mine 1seconds

news post image

to start off with we will make a number 9, to do this we will use the logic_timer and add 7 outputs, make them exactly the same as the image:

news post image

What you have done is changed some of the colors of the pieces for the right digital number, if you were to set the logic_timer to start enabled and run the map as a test what would happen is after 11 seconds of looking at the digital numbers you would suddenly see a red number 9 because the fx color is RGB (Red Green Blue) the parameters have all been changed from the default dark 10 10 10 to 255 10 10, leaving second12 blank creates the number 9, use the top image as a reference if you are still confused.

Next we will work on making the number 8, this will be easy all we have to do is copy all the outputs we created for the number 9 and change second12 so that it is red aswell and you will have a number 8, make sure instead of a delay of 1 second there is a delay of 2 seconds instead so for the first second you get the number 9 and the second a number 8:

If you were to run the map this time after 11 seconds you would get a number 9 and then 1 second after that the number 8.

Now to make a number 7 we will have to remove the light from second8, second11, second12 and second13 like this:

news post image

All you are doing is changing the colors so that they match what numbers look like, i'll leave it up to you to do the rest you should be able to understand how it works now, just do all the numbers down to 0 and remember to keep adding a 1 second delay for each number or the numbers will glitch up.

When you have finished adding the numbers 9 to 0 you are finished with the logic_timer, don't forget to change it back to start disabled if you were running the map for tests.

What you will do now is make a func_button, set it up so the delay before reset is greater than 60 seconds if you want the countdown to be used more than 1 time, copy and paste all the outputs you put into your logic_timer into the outputs for the button and change them a little bit make it so these ones work on pressed instead of ontimer, also make it so on pressed the logic_timer is enabled with no delay, the reason you need to copy all the work you did in logic_timer over to here is because for the first 10 seconds after the logic_timer is enabled it won't do anything, there needs to be a 10 second delay so it does its count from 9 to 0 so in order to make up for the first 10 seconds not being displayed they have to be added to the button so they work instantly 1 time.

Now we will work on the left side of the digital countdown, there is no point of making a second logic_timer for these as these numbers will only be displayed 1 time so we will add them to the func_button, make the number 5 and don't forget that now you are working on second1 to second7 and not second8 to second14.

news post image

Instead of a 1 second gap you'll want to make it a 10 second gap for all these numbers, make all the numbers from 5 to 0.

Finally, make an output for the button which makes it so that after 60 seconds of being pressed the logic_timer is disabled.

And thats it! You have created a countdown timer which counts down from 1 minute.


View comments ( 1 )

Back to top