Welcome, Guest. Please login or register.

Author Topic: A simple timer system  (Read 3586695 times)

Offline TargetPractice

  • Sr. Member
  • ****
  • Posts: 881
  • Eat my surf!
    • View Profile
A simple timer system
« on: December 26, 2007, 07:59:41 PM »
As requested. This is how i used the timer system in surf_lore. I can't vouch for other varieties in timer systems, but this is most likely the simplest timer system to use.

1. Create a logic_timer entity. In it's properties you want:

Name: TimerFiveMin (whatever name you wish)
Start Disabled: Yes
Refire Interval: 300 (This is measured in seconds. 300 = 5 minutes.)

2. Now make a trigger_once (or trigger_multiple) for which the players will trigger to enable the timer. To do this you create a block, and tie it to the trigger_once or trigger_multiple entity. In surf_lore, the trigger_once was at spawn so the players enable the timer at the start of the round. In it's properties you want:

OUTPUTS tab

My Output/Target Entity/Target Input/Delay/Only Once

OnStartTouch/TimerFiveMin/Enable/0.00/No



3. Now when that trigger is enabled, it starts the timer. I set it up so that the timer, once started, will enable a func_movelinear to go down a column and I set that up so that it moves so many inches per second, so that when it reaches the bottom, the timer expires, and the players are teleported.

4. To disable the timer at the end of the round you need to create another trigger_multiple/trigger_once. Place this either at the end point in the map so that the winner gets a reward, or place it in the destination of the teleport in jail. Either way, you want to make sure that at least one player triggers it before the round is over so that it can start again in the next round. In it's properties you want:

OUTPUTS tab

My Output/Target Entity/Target Input/Delay/Only Once

OnStartTouch/TimerFiveMin/Disable/0.00/No

5. When the timer expires I used trigger_teleports set up so that they cover each level seperately. To do this, create a trigger_teleport that covers the entire level (perhaps use a couple of blocks all tied together with the trigger_teleport entity otherwise it could cause leaks in the map). Do the same for each level in the map. In it's properties you want:

Name: timesup (whatever name you wish)
Start Disabled: Yes
Remote Destination: jailtele (name of the info_teleport_destination for where you want players to go when the timer expires)

6. Now go back to your logic_timer. In its properties you want:

OUTPUTS tab

My Output/Target Entity/Target Input/Delay/Only Once

OnTimer/timesup/Enable/0.00/No
OnTimer/timesup/Disable/20.00/No



7. In surf_lore I used a seperate teleport for each level, so that when a player in a certain level is teleported after the time is up, then they go to a different place. This was essential because I wanted to equip players seperately depending on how far they got in the map. To do this is easy, just name each teleport in each level seperately, eg. level 1 the name of the trigger_teleport would be timesup1, then for level 2 it would be timesup2 etc.

Compile and load up your map to test.

TP


Click HERE for free films and games with the LoveFilm offers!

SmOoth

  • Guest
Re: A simple timer system
« Reply #1 on: December 26, 2007, 10:28:38 PM »
Why not just have that trigger at the spawn trigger everything the logic_timer does with a delay? The use of a logic_timer is it doing something every x seconds.

Offline Sertion

  • Full Member
  • ***
  • Posts: 149
  • Live long, die hungry!
    • View Profile
Re: A simple timer system
« Reply #2 on: December 27, 2007, 01:55:19 AM »
Nice! I was just about to play w/ this, and now i don't really have to! Saved me lot of time  \

Offline DrUnKaRd

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: A simple timer system
« Reply #3 on: January 01, 2008, 10:02:46 PM »
hey cheers TP works a treat \

NICE JOB!!!!

Offline .:CNH:. [Surfer]

  • Full Member
  • ***
  • Posts: 142
  • Sexy Stuff !
    • View Profile
Re: A simple timer system
« Reply #4 on: March 25, 2008, 03:31:47 PM »
nice tutorial..

did you do surf_lore alone or with some1 ??  \ \

Offline Dan

  • TOAO
  • Sr. Member
  • ****
  • Posts: 598
    • View Profile
Re: A simple timer system
« Reply #5 on: March 25, 2008, 06:07:09 PM »
Why not just have that trigger at the spawn trigger everything the logic_timer does with a delay? The use of a logic_timer is it doing something every x seconds.

That is exactly what I do.
What the fuck happened?

Offline TargetPractice

  • Sr. Member
  • ****
  • Posts: 881
  • Eat my surf!
    • View Profile
Re: A simple timer system
« Reply #6 on: March 26, 2008, 11:08:45 AM »
did you do surf_lore alone or with some1 ??

It was just me.


Click HERE for free films and games with the LoveFilm offers!

Offline shini

  • Full Member
  • ***
  • Posts: 301
    • View Profile
    • chuckzilla.com
Re: A simple timer system
« Reply #7 on: March 27, 2008, 01:03:52 PM »
ty tp great tut. thanks for the help.

Offline .:CNH:. [Surfer]

  • Full Member
  • ***
  • Posts: 142
  • Sexy Stuff !
    • View Profile
Re: A simple timer system
« Reply #8 on: March 29, 2008, 10:51:45 AM »
fucking nice man..

i love that map... haha

i take them all down with awp..

before they comes to "JAIL" haha  \

Offline apexi

  • Full Member
  • ***
  • Posts: 188
  • Bitch stole my popsickle
    • View Profile
Re: A simple timer system
« Reply #9 on: April 12, 2008, 11:06:09 PM »
i did exactly as you said and it didn't work
Your curves make me want to keep on going forever and ever.

Offline TargetPractice

  • Sr. Member
  • ****
  • Posts: 881
  • Eat my surf!
    • View Profile
Re: A simple timer system
« Reply #10 on: April 13, 2008, 12:34:17 PM »
i did exactly as you said and it didn't work

Then you did it wrong. Why would I post up a tutorial that didn't work?


Click HERE for free films and games with the LoveFilm offers!

Offline uuk

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: A simple timer system
« Reply #11 on: May 18, 2008, 11:08:23 PM »
hey,,  would it be possible to  just have the lil timer bar on the collum so when it reaches the botton.. ther is a trigger_once  that has a filter or a point_proximity_sensor  or sumthing that detects when the timer bar reachs the bottom and then it triggers the teleport to jail.
Just a thought..  havent tried it yet.. but ill probolly try it, sum day.

Offline DESE

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: A simple timer system
« Reply #12 on: May 19, 2010, 05:31:30 PM »
How do you make a timer system like in surf_amplitude_apex, or surf_network series .

the system goes like this: The trigger to leave jail is always disabled. Only every x seconds, the trigger is enabled, but only for a fraction of a second, because then the x seconds start counting again...

I can make the system, except for the x seconds to restart over and over again. And that the enabling of the trigger should last for not more than a sec, is a mystery to me.

Thanks in advance
--
Quote
I'm serious, be productive or gtfo.
--
[/

Offline S.T.A.L.K.E.R.

  • The Sexiest Man "Alive"
  • SolidSurf Elite
  • Elder Statesman
    of the Surf
  • ******
  • Posts: 2,830
  • daddy is home :^)
    • View Profile
Re: A simple timer system
« Reply #13 on: May 19, 2010, 06:29:39 PM »
Logic_timer that fires every X seconds, outputs()
OnTimer - Release_relay - trigger - 0.00 (delay)

Release_relay (logic_relay), outputs()
OnTrigger - Release_teleport - Enable - 0.00 (delay)
OnTrigger - Release_teleport - Disable - 2.00 (delay)
~also, any other outputs that you may want for effects and whatnot.

Offline FAJ

  • Flying Badger Man
  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,925
  • GAJ
    • View Profile
    • NY-Surf
Re: A simple timer system
« Reply #14 on: May 19, 2010, 06:32:42 PM »
I like the relay approach. The delay can be any time, if you want it to be a fraction of a second, make it a fraction of a second.

Offline S.T.A.L.K.E.R.

  • The Sexiest Man "Alive"
  • SolidSurf Elite
  • Elder Statesman
    of the Surf
  • ******
  • Posts: 2,830
  • daddy is home :^)
    • View Profile
Re: A simple timer system
« Reply #15 on: May 19, 2010, 06:35:09 PM »
I like the relay approach. The delay can be any time, if you want it to be a fraction of a second, make it a fraction of a second.
Yeah this; I was exampling from a system that would have a teleport that you need to walk into physically and not just a trigger encasing the whole fall room.

Offline DESE

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: A simple timer system
« Reply #16 on: May 20, 2010, 04:51:22 PM »
@Ryan S : Ok, I've tried your method -> NEGATIVE..

here are my settings (T and CT have different filters to teleport them to their own spot):

- a trigger_once that you trigger FOR SURE when entering jail...
     [ OnStartTouch - box_timersystem (name of my logic_timer)  - Enable  - delay: 0.00 ]

- a logic_timer (named box_timersystem) (start DISABLED)
     [ OnTimer - box_relaysystem (name of my logic_relay)  - Trigger - delay: 0.00 ]

- a logic_relay (named box_relaysystem) (start DISABLED)
                    *for CT*
     [ OnTrigger - ct_teleport  - Enable - delay: 0.00 ]
     [ OnTrigger - ct_teleport  - Disable - delay: 0.30]
                     *for T*
     [ OnTrigger - t_teleport  - Enable - delay: 0.00 ]
     [ OnTrigger - t_teleport  - Disable - delay: 0.30]


Thanks in advance !
--
Quote
I'm serious, be productive or gtfo.
--
[/

Offline FAJ

  • Flying Badger Man
  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,925
  • GAJ
    • View Profile
    • NY-Surf
Re: A simple timer system
« Reply #17 on: May 20, 2010, 04:57:56 PM »
There is no reason for the trigger_once to enable the timer. Just have the timer enabled from the start. That is the way it is done on most maps with this sort of release system.

P.S. Your relay is disabled. Can't trigger a relay that is disabled, and there is no reason to have it start disabled that I can see.

Offline S.T.A.L.K.E.R.

  • The Sexiest Man "Alive"
  • SolidSurf Elite
  • Elder Statesman
    of the Surf
  • ******
  • Posts: 2,830
  • daddy is home :^)
    • View Profile
Re: A simple timer system
« Reply #18 on: May 20, 2010, 05:05:10 PM »
there is no reason to have it start disabled that I can see.
No, there is no reason, it's asleep regardless of it being enabled or disabled when it's not being used.

Offline DESE

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: A simple timer system
« Reply #19 on: May 20, 2010, 06:27:34 PM »
Ok thanks guys, next try coming up (if it works, part 3 of 8 of multimap is then finished !  \)

ps: the reason for the trigger_once to enable the timer is that (obviously) the timer starts running when the first player fell in jail.
i'll try it without.

Now i might need some help with a timer that counts from 00:20 til 00:00 ?? Just in case if there's someone here who knows, else i'll search google...
« Last Edit: May 20, 2010, 06:31:45 PM by dese90 »
--
Quote
I'm serious, be productive or gtfo.
--
[/

Offline S.T.A.L.K.E.R.

  • The Sexiest Man "Alive"
  • SolidSurf Elite
  • Elder Statesman
    of the Surf
  • ******
  • Posts: 2,830
  • daddy is home :^)
    • View Profile
Re: A simple timer system
« Reply #20 on: May 20, 2010, 07:12:58 PM »
Like a digital clock or an entity?

Offline DESE

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: A simple timer system
« Reply #21 on: May 20, 2010, 07:50:55 PM »
a digital one with red leds

like in surf_quantum (http://www.fpsbanana.com/maps/62436) screenshots don't show the digital timer though...  \

This will sure get credits in the map if someone can fix me this !
--
Quote
I'm serious, be productive or gtfo.
--
[/

Offline S.T.A.L.K.E.R.

  • The Sexiest Man "Alive"
  • SolidSurf Elite
  • Elder Statesman
    of the Surf
  • ******
  • Posts: 2,830
  • daddy is home :^)
    • View Profile
Re: A simple timer system
« Reply #22 on: May 20, 2010, 08:22:29 PM »
custom textures of numbers
0 - 20
make each brush a func_brush, except the (00):xx
use a logic_timer that adds "1" to a math_counter that outvalue|invalues a logic_case that enables the next number brush and disables the last one
IE: ()let "b_n_xx" represent the brush name (b = brush, n = number)
OnCase01 - b_n_00 - Disable
OnCase01 - b_n_01 - Enable
OnCase02 - b_n_01 - Disable
OnCase02 - b_n_02 - Enable
OnCase03 - b_n_02 - Disable
OnCase03 - b_n_03 - Enable


But of course you'd have it counting down, this is an example of counting up.

Offline Sangfroid

  • Full Member
  • ***
  • Posts: 227
  • ~Kyuun~
    • View Profile
Re: A simple timer system
« Reply #23 on: May 20, 2010, 09:13:04 PM »
i think there's a way to toggle the textures on a brush (animated texture? mmmh, there's an interlopers tutorial for it somewhere). that would be a cleaner way. but then again, untelos timer (used in surf_quantum) used func_brushes with a 7 segment display-like toggle, iirc.

~i copied this from someone else. it's awesome~

Offline S.T.A.L.K.E.R.

  • The Sexiest Man "Alive"
  • SolidSurf Elite
  • Elder Statesman
    of the Surf
  • ******
  • Posts: 2,830
  • daddy is home :^)
    • View Profile
Re: A simple timer system
« Reply #24 on: May 20, 2010, 09:33:55 PM »
i think there's a way to toggle the textures on a brush (animated texture? mmmh, there's an interlopers tutorial for it somewhere). that would be a cleaner way. but then again, untelos timer (used in surf_quantum) used func_brushes with a 7 segment display-like toggle, iirc.
Creating a 7 segment display is time well wasted, especially since the people viewing the timer won't really even give a shit about it. It's just easier to have brushes that disable and enable \

Offline unt0uch4bl3

  • Full Member
  • ***
  • Posts: 357
    • View Profile
Re: A simple timer system
« Reply #25 on: May 20, 2010, 10:22:06 PM »
env_texturetoggle is the entity.

What you need is an animated texture with multiple frames.

then you do env_texturetoggle -> setTextureIndex -> #
and env_texturetoggle will have a specific target brush

(used this in my mg_sudoku which has a 9x9 grid, with each cell being able to have any number 0-9. - very efficient)
« Last Edit: May 20, 2010, 10:23:40 PM by unt0uch4bl3 »


Offline DESE

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: A simple timer system
« Reply #26 on: May 21, 2010, 02:02:14 PM »
untouchable, that seems like a huge thing to do. I'll keep it for later and maybe add it as a final touch...
--
Quote
I'm serious, be productive or gtfo.
--
[/

Offline FAJ

  • Flying Badger Man
  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,925
  • GAJ
    • View Profile
    • NY-Surf
Re: A simple timer system
« Reply #27 on: May 21, 2010, 02:21:28 PM »
Its just the texture that you need to get. The implementation of the entities is not too hard. When you increment the thing it is easier than making one that just recieves an input number and displays it.

Offline Absolute

  • Full Member
  • ***
  • Posts: 274
  • 1+1=10
    • View Profile
Re: A simple timer system
« Reply #28 on: May 21, 2010, 02:39:06 PM »
It's much less work to create a Texture with the numbers 0-9 and then use the toggle texture method than creating brushes for each number

Offline DESE

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: A simple timer system
« Reply #29 on: May 21, 2010, 06:52:21 PM »
So the timer works of course (easy), therefore i thank you.

I'll see what I can do with the counter...
In the meanwhile, i'll be posting that notorious project of mine in Ripples section \

Ciao babies
--
Quote
I'm serious, be productive or gtfo.
--
[/

Offline DESE

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: A simple timer system
« Reply #30 on: June 11, 2010, 08:28:31 AM »
use a logic_timer that adds "1" to a math_counter that outvalue|invalues a logic_case that enables the next number brush and disables the last one

Ryan is it possible to explain this a little bit easier?
- I've already made my individual func_brushes as .vmt in my map (00, 01, 02, ... , 20). They're all ready to be enabled and on the right place!
- I've got a logic_timer and logic_relay to release players every 20 seconds (like said a few posts back in this topic) , it works..
So it should start from 20 (timer start), counting down to 00 (counter at interval)...

Can you explain how to "add 1 to a math_counter that outvalues/invalues a logic case that......." ??

Thanks a bunch
« Last Edit: June 11, 2010, 08:45:15 AM by dese90 »
--
Quote
I'm serious, be productive or gtfo.
--
[/

Offline Untelo

  • Full Member
  • ***
  • Posts: 145
    • View Profile
Re: A simple timer system
« Reply #31 on: June 11, 2010, 11:23:39 AM »
Is this what you were looking for?

Offline DESE

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: A simple timer system
« Reply #32 on: June 11, 2010, 12:17:07 PM »
Geez thx

That would be the system, too bad that my pre made number brushes are (00:, 00, 01, 02, 03, ... , 20)...
But I can adjust yours to mine, I'll try doing it.
--
Quote
I'm serious, be productive or gtfo.
--
[/

Offline DESE

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: A simple timer system
« Reply #33 on: June 11, 2010, 09:21:29 PM »
works perfect thanks untelo ! \ \
--
Quote
I'm serious, be productive or gtfo.
--
[/

Offline Untelo

  • Full Member
  • ***
  • Posts: 145
    • View Profile
Re: A simple timer system
« Reply #34 on: June 12, 2010, 06:56:00 AM »
No problem  \