How to do countdown numbers on the wall?
They are multiframe textures (like indicator lights, but they have more than just two). Frame 0 is '59', frame 1 is '58', etc.
So if you had a few of those ... one for seconds, one for minutes... and then a logic_timer that did IncrementTextureIndex every second for the seconds one and one that did IncrementTextureIndex every minute for the minutes one...
that'd be a start anyways. There's one actually labelled 'centiseconds', in addition to a milliseconds one that just has 6-7 frames or so that's basically a blur (rather than forcing the game to change a timer every millisecond!)
I used the seconds texture. The logic_timer fired every second, counting the numbers down from 59 to 00. Excellent!
I noticed that the logic_timer kept going, and the texture went back to 59 and started counting down again. So I presume that the texture does a mod or something so that it knows when you go off the end of the images in the texture, it loops back around. That's handy.
So is it "safe" to let a logic_timer run forever without resetting it? Suppose the timer is in the last room and the numbers won't be seen until the user finally gets there. Should you have the logic_timer running from the beginning of the map? Or is it better to have a trigger that detects the player just as they enter the room and then start the timer?
Also, is there a standard texture that goes around the clock numbers, like there is for the arrows and exit door signs in Portal? Or do you have to create your own func_details and pick some textures?
FRAMING YOUR TIMER:
There's clock.mdl, but that's for the countdown in the starting chamber, so it's pretty wide: enough room for eight digits and three separators. Not cool. However, there's nothing stopping you from using a sign_frame* prop around your timers, since each two-digit field uses a square texture.
CLOCK MATERIALS:
'minutes' only has two textures: '01' and '00'.
'seconds' has everything from '59 to '00'.
'centiseconds', despite the name, actually counts 60ths of a second.
'milliseconds' has ten blurry frames.
And if you'd like to use the centis or millis, you'll have to learn how to work a material_modify_control.
whupper wrote:
So is it "safe" to let a logic_timer run forever without resetting it? Suppose the timer is in the last room and the numbers won't be seen until the user finally gets there. Should you have the logic_timer running from the beginning of the map? Or is it better to have a trigger that detects the player just as they enter the room and then start the timer?
Well, if you're really trying to time something, you shouldn't start the timer until you're ready to start timing obviously
Besides, if it fires all the time, you'll get a ton of spam if you're testing your map with developer 2 on, and who wants that?