Need a player operated timer

nbtc971

2009-05-13 23:34:20

My buddy is making a map in HL2DM that requires a timer that can be started by a player pressing a button, then stopped by that same player pressing another button (the timer needs to be seen by, a 'ref' at best, and at worst, atleast the player pressing the buttons). So far he has had no luck posting in the different map making forums around the web and it was suggested over at the HL2CTF forums you guys might be able to tell him something. Any help is appreciated.

boshed

2009-05-14 00:44:22

Not quite clear on what needs to be done, what's a 'ref'? Does the timer count up or down? Is there an event to fire on the timer? Do things need resetting? and so on.

Get him to post here with a full description of what he's trying to accomplish :)

nbtc971

2009-05-14 01:43:04

Essentially the player will press a button that will start a timer that will count up from 0. He will then perform certain tasks on the map, and once complete will press a 2nd button (or maybe the same button) and the timer will stop. So we just want to be able to time the players actions then that will help us determine who completed the tasks the fastest.

ref=referee

No event needs to be fired that I know of other than the clock starting and stopping. Yes, it would be nice to reset the timer so the next person could start with a fresh clock.

I will ask him to come post.

boshed

2009-05-14 21:27:02

Visual timers can certainly be done :)

Its going to be a major headache if the timer needs to be tied to a specific player though, is this needed or are you counting on a single player using the timer at any given time?

Rather busy atm, but I'll put together a timer vmf as soon as I can.

nbtc971

2009-05-15 03:32:03

Hey man thanks a lot.

We only need to time 1 player at a time so no worries there.

My friend has tried to register for this forum but you have to be activated and it's been a couple of days now, but he's reading what you are saying and I can speak for him for the time being if you need anymore info.

Once again, thank you.

nbtc971

2009-05-18 19:38:51

Hope you haven't abandoned us! :cry:

boshed

2009-05-19 17:23:01

Nope, but i won't be able to sit down and hammer anything for you until weekend at the earliest :|

kingloser

2009-05-22 10:57:49

ok i am the one that is gonna be making the map. i am new to mapping however i am eager to learn. i appreciate any help you can give us.

nbtc971

2009-05-23 05:14:13

Thanks man.. you are the only one that has offered any help on any forum we've been to. Greatly appreciated.

boshed

2009-05-25 15:04:36

Sorry for delay, loads of work on and a more important mapping project in progress.

Image

Download here
  • Left button starts the timer (also resets it if it has been used previously)
  • Right button stops the timer
  • Timer will count up to 999 seconds then reset to 000
  • Relevant button will be locked when used
Read the README.txt :)

The texture used for the numbers is a 128px x 128px animated texture with 10 frames, you'll probably want to make something that looks a bit nicer than my test texture. More info on making animated textures here

It's a very complicated setup, I suggest pulling it apart and looking at every entity's settings and input/output and making sure you understand how it all works before making any changes. You can get more info on the entities used at the Valve Developer Wiki.

[EYE] Valar

2009-05-25 15:13:39

....and God said, Let there be I/O. and it was good.

Sacrifist

2009-05-26 02:15:57

nbtc971 wrote:Thanks man.. you are the only one that has offered any help on any forum we've been to. Greatly appreciated.
Actually, that is not true. I gave you a link on the ctf forums that will accomplish the same thing boshed has done. Only difference is, he was nice enough to make you one lol. Here is the link I provided http://www.interlopers.net/tutorials/25686

boshed

2009-05-26 03:45:27

Sacrifist wrote:http://www.interlopers.net/tutorials/25686
Oh nice, I checked lopers to see if anybody had done something similar but didn't think to look in the portal tutorials. Only one I could find was this one which is ingenious but a bit er, well ... see for yourself.

I'm using a very messy bunch of logic_case in my version as I couldn't find a way to pass a counter value directly to an env_texturetoggle frame number, but it appears from your link that it can be done with a material_modify_control. That will really simplify things, thanks :)

Sacrifist

2009-05-26 06:01:52

boshed wrote:
Oh nice, I checked lopers to see if anybody had done something similar but didn't think to look in the portal tutorials. Only one I could find was this one which is ingenious but a bit er, well ... see for yourself.

I'm using a very messy bunch of logic_case in my version as I couldn't find a way to pass a counter value directly to an env_texturetoggle frame number, but it appears from your link that it can be done with a material_modify_control. That will really simplify things, thanks :)
Ya that is the one Ive used before, but I used it to make a scoreboard lol.

nbtc971

2009-05-26 11:10:46

Sacrifist wrote:
nbtc971 wrote:Thanks man.. you are the only one that has offered any help on any forum we've been to. Greatly appreciated.
Actually, that is not true. I gave you a link on the ctf forums that will accomplish the same thing boshed has done. Only difference is, he was nice enough to make you one lol. Here is the link I provided http://www.interlopers.net/tutorials/25686
Sacrifist, sorry I hadn't been back to that thread so this is the first i've seen of the help you provided.. thanks. :)

boshed, thanks alot. I'm sure kingloser will be very thankful for your help!

kingloser

2009-05-26 15:11:16

i am extremely thankful. now i just have to get it put into the map correctly. we thank you alot for your selfless service. and thanks to anyone else who posted responses.

boshed

2009-06-11 01:53:31

I've actually got a much simplified version of this now thanks to the info Sacrifist pointed out, I'll upload it when I get back to the machine with it on.

boshed

2009-06-18 09:45:01

Simpler version here, props to Sacrifist <3

kingloser

2009-06-19 06:30:15

thanks a ton the one you gave us is working great and as soon as i figure out how im making a button u push that shows a credit to you for the timer

Skaruts

2009-06-20 20:00:04

Well I can help you with that, take a look at it here

I've given the text functionality to the timer_relay_start, but you can also put it in the timer_button_start, since the button gets locked after being used it will do the same effect.

I also added a separate button for the same effect. So you can see how it's made without having to look into all the outputs from the logic_relay. Not that they are many :mrgreen:
Play with the game_text entity a bit, it is a very simple entity, but also limited in some ways, unfortunatelly.

This thread helped me a lot since I also needed a counter, but for a countdown, reversed.
Thx to boshed, I got it. :wink:

Happy mapping