Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
j0lt

Countdown Timer

Question

Is there any way to display a countdown timer in a map?

 

I was thinking of having a self-destruct countdown with a timer and if the player doesn't get to the level exit in time they "die". Is this possible?

 

 

Share this post


Link to post

5 answers to this question

Recommended Posts

  • 1
34 minutes ago, j0lt said:

 

Good point! I use GZDoom!

 

Then you can use ACS, like a simple script like this:
 

#include "zcommon.acs"

script "death_timer" ENTER
{
    int seconds_till_death = 70;

    while(seconds_till_death > 0)
    {
        int minutes = seconds_till_death / 60;
        int seconds = seconds_till_death % 60;
        int leading_zero = seconds < 10 ? "0" : "";
        print(i:minutes, s:":", s:leading_zero, i:seconds, s:" until destruction!");
        seconds_till_death--;
        delay(35);
    }

    print(s:"DESTRUCTION!");
    Thing_Damage(0, 0xff, MOD_UNKNOWN);
}

 

Share this post


Link to post
  • 1

It would help to know what source port you're developing for, as the answer will be completely different depending on whether it's vanilla/Chocolate Doom, Boom, GZDoom, etc :)

Share this post


Link to post
  • 0
15 hours ago, Redoom said:

This might help

 

Well that definitely solves half of it! Now to figure out if I can get a visible timer put on screen...

Then all I have to do is figure out a way to trigger a crusher over the "voodoo doll" once it reaches 0.

Share this post


Link to post
  • 0
1 hour ago, NiGHTMARE said:

It would help to know what source port you're developing for, as the answer will be completely different depending on whether it's vanilla/Chocolate Doom, Boom, GZDoom, etc :)

 

Good point! I use GZDoom!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×