Timers: Difference between revisions

From SigMod
Jump to navigation Jump to search
(Updated the Text-Based Timer info to include my new version of the timer. Allows more customization and is all around more stable)
(Simpler text based timer, overcomplicated the last one)
Line 7: Line 7:
=== Text-Based Timer ===
=== Text-Based Timer ===


# Add the template to your mission by adding <code>#base reverse_timer_text_v2.pop</code> to the top of your popfile
# Add the template to your mission by adding <code>#base reverse_timer_text_v2_simple.pop</code> to the top of your popfile
# Add this block of text at the top of each of your Wave{} blocks<syntaxhighlight lang="javascript">
#Add this block to WaveSchedule, same place as StartingCurrency<syntaxhighlight lang="javascript">
SpawnTemplate texttimerv2
PointTemplates
InitWaveOutput
{
{
Target gamerules
texttimerv2_setup
Action runscriptcode
{
////////////////////////////////////////////////////////////////////////////////
OnSpawnOutput
//  ::clock <- `minutes|seconds|color|logic_relay triggered on depleted timer`
{
Param                 "::clock <- `10|00|0 255 255|timerfinish1`"
Target timerdisplay
////////////////////////////////////////////////////////////////////////////////
Action runscriptcode
Param "timer(10,00,0.7,0.9,`0 255 255`)" // timer(minutes,seconds,xpos,ypos,`color`)
}
}
}
}
SpawnTemplate texttimerv2_setup [$SIGSEGV]
</syntaxhighlight>
</syntaxhighlight>
# Send a <code>SetValue</code> input to <code>addtime</code> with a parameter of a number to add or remove time from the timer
# Change the Param if needed for time duration, the timer's position on the hud, and the timer text's color
# Send a <code>CallScriptFunction</code> input to <code>timerdisplay</code> with a parameter of <code>timerpause</code> to pause the timer, or <code>timerunpause</code> to unpause instead
Trigger <code>timerpause</code> using a WaveSpawn output such as FirstSpawnOutput to pause or unpause the timer
 
Send a <code>SetValue</code> input on <code>addtime</code> to add or remove time from the current timer (e.g. SetValue 120 with a time 3:25 becomes 5:25)
 
Send a <code>SetValue</code> input on <code>settime</code> to set the desired time (e.g SetValue 600 with a time 3:25 becomes 10:00)


=== Boss Bar Timer ===
=== Boss Bar Timer ===

Revision as of 02:26, 26 September 2023

Both timer templates shown above

Two 15 minute timer templates that will fail the wave once reaching zero. One is text based while the other utilizes the Halloween boss health bar. Instructions on how to change the countdown time can be found in the template files listed below.

How to use

Both timers are simple to use and can be added into any mission running on our servers.

Text-Based Timer

  1. Add the template to your mission by adding #base reverse_timer_text_v2_simple.pop to the top of your popfile
  2. Add this block to WaveSchedule, same place as StartingCurrency
    PointTemplates
    {
    	texttimerv2_setup
    	{
    		OnSpawnOutput
    		{
    			Target timerdisplay
    			Action runscriptcode
    			Param "timer(10,00,0.7,0.9,`0 255 255`)" // timer(minutes,seconds,xpos,ypos,`color`)
    		}
    	}
    }
    SpawnTemplate texttimerv2_setup [$SIGSEGV]
    
  3. Change the Param if needed for time duration, the timer's position on the hud, and the timer text's color

Trigger timerpause using a WaveSpawn output such as FirstSpawnOutput to pause or unpause the timer

Send a SetValue input on addtime to add or remove time from the current timer (e.g. SetValue 120 with a time 3:25 becomes 5:25)

Send a SetValue input on settime to set the desired time (e.g SetValue 600 with a time 3:25 becomes 10:00)

Boss Bar Timer

  1. Add the template to your mission by adding #base reverse_timer.pop to the top of your popfile
  2. Add SpawnTemplate "timertest" [$SIGSEGV] to WaveSchedule, same place as StartingCurrency
  3. Trigger showtimer using a WaveSpawn output such as FirstSpawnOutput to display the bar on the HUD
  4. Trigger timer_relay to begin the countdown
  5. Send the CancelPending input to timer_relay instead of Trigger to pause the timer, it can be restarted by re-triggering

Boss bar limitations:

  1. Only one Tank/Chief boss bar can be present at once without overlapping
  2. Overrides Halloween boss bar, meaning a Halloween boss cannot be used alongside this
  3. Size of the bar cannot be changed, only the rate it decreases

Templates

Text based timer: https://testing.potato.tf/tf/scripts/population/reverse_timer_text.pop

Boss bar timer: https://testing.potato.tf/tf/scripts/population/reverse_timer.pop