Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » timers little question
timers little question [message #466317] Wed, 18 April 2012 02:27 Go to next message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
the number you give with a timer does it have any effect?

i have always used 1 and it works but could it be things are getting delayed?


Owner of kambot TT server

kambot.freeforums.org
Re: timers little question [message #466320 is a reply to message #466317] Wed, 18 April 2012 03:29 Go to previous messageGo to next message
zunnie is currently offline  zunnie
Messages: 2959
Registered: September 2003
Location: Netherlands
Karma: 0
General (2 Stars)

If there are two scripts on ONE object and they both use timer 1 they will conflict i believe. Then both scripts will trigger when
timer 1 runs out.
Its best to keep them as unique as possible.


https://multiplayerforums.com/uploads/monthly_2018_03/TCW2_Signature.png.6236a0dbc6e1e53472a18fe8cd15e47b.png
Re: timers little question [message #466328 is a reply to message #466317] Wed, 18 April 2012 06:55 Go to previous messageGo to next message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
how do i know im not using one of the timers in scripts?

Owner of kambot TT server

kambot.freeforums.org
Re: timers little question [message #466341 is a reply to message #466320] Wed, 18 April 2012 13:08 Go to previous messageGo to next message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma: 1
Colonel
zunnie wrote on Wed, 18 April 2012 03:29

If there are two scripts on ONE object and they both use timer 1 they will conflict i believe. Then both scripts will trigger when
timer 1 runs out.

No, a timer will only trigger the script that started it, or rather, the script class that was passed to it. Generally you pass the "this" pointer which points to the script class you're calling it from.

As for the timer number, it's so you can have multiple timers in one script class. The timer number will be passed to Timer_Expired when it's called.

For example you could have a regen script that regened 1 health every second and 1 armor every 5 seconds. The health timer would have a timer number of 1 which you would check for in the Timer_Expired function, and the armor regen timer would have a timer number of 2 which you would again check for.

If your timer is only doing one thing then you don't need to worry about the timer number.


Black-Cell.net
Network Administrator (2003 - )

DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )

Dragonade, Renegade's first server side modification
Lead coder (2005 - )
Re: timers little question [message #466397 is a reply to message #466317] Thu, 19 April 2012 19:16 Go to previous message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
so if youre kinda lazy adn always just use number 1 2 3 in your script to make it easy there no troubles at all

nice to know this for sure now


Owner of kambot TT server

kambot.freeforums.org
Previous Topic: brenbot create custom messages
Next Topic: Commands->Set_Position()
Goto Forum:
  


Current Time: Wed Dec 18 06:11:02 MST 2024

Total time taken to generate the page: 0.01256 seconds