Tutorials
Advanced Counter
Counter Tutorial
Written by Slutty_hoe
If you have any problems during this tutorial please do not hesitate to either pm me (slutty_hoe) or email me slut-ty-hoe[at]hotmail[dot]com or post a reply
This is a tutorial on how to get a counter into your game. Basically it can display the number in a math_counter so it can be used for counting how many kills you’ve made etc etc.
This isn’t as long as the countdown timer less to deal with.
This tutorial can be used in any source mod as long as it has Func_brush, Logic_relay and a way to trigger it.
First make a room to put your counter in if you haven’t already
Add a black back for the counter to sit on (optional)

Create a red colored brush (red texture with the example map) and chop off the ends (this is purely to make it look better doesn’t need to be done) Form the brushes into a shape of a digital clock 8.

On the “8” select the top brush. Make it a func_brush and call it counter_digit_a (can be changed this just keeps it neat and logical for later on)

Now name the rest going from left to right up to down.

You should now have 7 func_brush
counter_digit_a
counter_digit_b
counter_digit_c
counter_digit_d
counter_digit_e
counter_digit_f
counter_digit_g
Select counter_digit_d and make start disabled to yes this just makes it display a 0 at the start
Now I’m going to setup my button here with an indicator on it.
Make a brush for your button and make it a func_button add outputs of
My output named: OnIn
Target entities: counter
Via This input: Enable
My output named: OnOut
Target entities: counter
Via This input: Disable
My output named: OnIn
Target entities: counter_red
Via This input: Disable
My output named: OnOut
Target entities: counter_red
Via This input: Enable
My output named: OnIn
Target entities: counter_green
Via This input: Enable
My output named: OnOut
Target entities: counter_green
Via This input: Disable
Check the toggle under flags

Now make 2 little brushes the same size for your indicators. Make one green and one red (or your own colors will do) Make them func_brush and call them counter_green for the green one and counter_red for the red one. In the green one change start disabled to yes

Move your red and green brushes into position on top of each other preferably in a little casing

Ok that’s the button settled.
Now here comes the real fun part. I’m not sure if this is the best way to do it but it’s a way to do it and it does work.
Make 10 logic_relays
(Note if your not planning to count more then 9 then don’t worry about counter_digit_0)
Name 1 of them each
counter_digit_0
counter_digit_1
counter_digit_2
counter_digit_3
counter_digit_4
counter_digit_5
counter_digit_6
counter_digit_7
counter_digit_8
counter_digit_9

Open up counter_digit_1
Go to the output and add
My output named: OnTrigger
Target entities: counter_digit_a
Via This input: Enable
My output named: OnTrigger
Target entities: counter_digit_b
Via This input: Enable
My output named: OnTrigger
Target entities: counter_digit_c
Via This input: Enable
My output named: OnTrigger
Target entities: counter_digit_d
Via This input: Enable
My output named: OnTrigger
Target entities: counter_digit_e
Via This input: Enable
My output named: OnTrigger
Target entities: counter_digit_f
Via This input: Enable
My output named: OnTrigger
Target entities: counter_digit_g
Via This input: Enable
Now select them all and press copy. This just makes it easy to setup the rest of them

Ok now because we want this to make the number one we are going to need to make only the 2 upright brushes to enable. So if you remember what we named each individual brush we are only going to need counter_digit_c and counter_digit_f so select the rest of them and change enable to disable. Press apply.

What we just told it to do will make it once triggered look like this

Ok so if you’re a little lost I’ll explain what this is doing if you’re not go to the next paragraph. What we are doing is setting up just pre configured outputs so later on we will have a nother logic_relay to trigger all those logic_relays. When each logic_relay is triggered it will make what we set to enable to show up and what we set to disabled to disappear. So if we triggered counter_digit_1 it will make all the other red parts disappear that we don’t wont up there. It’s confusing I know but hang on and you will start to see.
Now we have to setup the rest of the digits. Open up number counter_digit_2
Go to the output section and paste in all the enables. (this is why I told you to do that, It just makes it a heck of a lot easier). Now for the number 2 we want counter_digit_b and counter_digit_f to be disabled. Select those 2 and set it to disabled.

In game it will look like

Ok now keep doing so for the rest of the numbers. (I have kindly posted pictures of both the number and the output system. And Ignore the top of the entity name I have managed to stuff it up its still correct in order going 3,4,5,6,7,8,9,0)















My counter is counting how many people have walked through this door way. If you making something else counter it like combine deaths you will have to make them add 1 to math_counter.
If you’re making it count people through the walkway or something similar, make a trigger_multiple where you want it to count. Name it counter and set start disabled to yes. Set Time before reset to 0, Tick npc’s under flags and add the output of
My output named: OnStartTouch
Target entities: math_counter
Via This input: Add
With a parameter override: 1

Now add a math_counter and call it math_counter. Set the max legal integer to any number bigger then 9. Go to the output’s tab and add
My output named: OnValue
Target entities: counter_case
Via This input: InValue

Now add a logic_case call it counter_case.
Now for case01 put a 1 in the box
Case02 put a 2 in the box
Case03 put a 3 in the box
Case04 put a 4 in the box
Case05 put a 5 in the box
Case06 put a 6 in the box
Case07 put a 7 in the box
Case08 put a 8 in the box
Case09 put a 9 in the box
Now go to the outputs on the logic_case and add
My output named: OnCase01
Target entities: counter_digit_1
Via This input: Trigger
Now copy that and paste it for each number so you get
My output named: OnCase02
Target entities: counter_digit_2
Via This input: Trigger
My output named: OnCase03
Target entities: counter_digit_3
Via This input: Trigger
Etc…etc…Until it looks like this

And that’s it. Compile your map press the button walk through the door way and watch your counter count. Have fun mapping
If you want a 2 Digit counter either take a look at my other tutorial and change it a little or just follow the steps for making the counter and all the logic_relays and change counter_digit_1 to counter_digit2_1 although that’s a pain.
Example Map
Click here
Here’s a video from my example map
http://www.youtube.com/watch?v=pV4GsL_Tif4
