timer.set_rate

Set the rate and direction in which the timer advances.

Arguments

rate

The rate and direction at which the timer should advance. Positive values will make the timer's value increase away from zero, while negative values will make the timer's value decrease to (but not past) zero. You may use any of the following rates (prefixed with a minus sign for negative values):

  • 0%
  • 10%
  • 25%
  • 50%
  • 75%
  • 100%
  • 125%
  • 150%
  • 175%
  • 200%
  • 300%
  • 400%
  • 500%
  • 1000%

Example

--
-- A common use of timers is to announce the gametype name at the 
-- start of a round, by "sending an incident" a few seconds after 
-- script processing begins.
--
alias announced_start = allocate player.number
alias announced_timer = allocate player.timer
declare player.announced_timer = 5
--
for each player do
   if current_player.announced_start == 0 then
      current_player.announced_timer.set_rate(-100%)
      if current_player.announced_timer.is_zero() then
         current_player.announced_start = 1
         send_incident(action_sack_game_start, current_player, no_player)
      end
   end
end