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

In game timer?

Question

I accidentally posted this topic in WADS and Mods, so I'm reposting this here. I'm in the process of making a map where doom speedrunners can practice their skills. I was wondering it was possible to have a on screen timer start and stop on certain linedefs so you can see how fast you were. I'm guessing I need to use the script engine to achieve this, because I already used it to label my portals. I'm using ZDoom in UDMF Format.

Share this post


Link to post

3 answers to this question

Recommended Posts

  • 1
script "TIMER" (void)
{

	int t = 240;
   while(t > 0)
	{
      t--;

		SetFont ("BIGFONT");
      HudMessage(s:"YOU HAVE ",d:t/60, s:":", d:t%60, s:" UNTIL POWER DRAINED";
         HUDMSG_PLAIN|HUDMSG_NOTWITHFULLMAP|HUDMSG_NOTWITHOVERLAYMAP, 500, CR_RED, 0.95, 0.9, 2.0);
		delay(35);
	}


}

This worked for me. The " t=240; " is the amount of time. You can end the script with     ACS_NamedTerminate ("TIMER", 0);

Hope this helps :)

Share this post


Link to post
  • 0
2 hours ago, Payload4367 said:

script "TIMER" (void)
{

	int t = 240;
   while(t > 0)
	{
      t--;

		SetFont ("BIGFONT");
      HudMessage(s:"YOU HAVE ",d:t/60, s:":", d:t%60, s:" UNTIL POWER DRAINED";
         HUDMSG_PLAIN|HUDMSG_NOTWITHFULLMAP|HUDMSG_NOTWITHOVERLAYMAP, 500, CR_RED, 0.95, 0.9, 2.0);
		delay(35);
	}


}

This worked for me. The " t=240; " is the amount of time. You can end the script with     ACS_NamedTerminate ("TIMER", 0);

Hope this helps :)

 

I copied this code into the script but these errors popped up.

 

1216297357_Screenshot(10).png.2d95409ad7b78db6527ddc93fd31f4e5.png

Share this post


Link to post
  • 0
script "timer" (void)
{
	int t = 240;    //240 = 4 minutes
   while(t > 0)
	{
      t--;

	SetHudSize(0,0,0);
		SetFont ("BIGFONT");
      HudMessage(s:"YOU HAVE ",d:t/60, s:":", d:t%60, s:" UNTIL POWER DRAINED";
         HUDMSG_PLAIN, 500, CR_RED, 0.95, 0.9, 2.0);
		delay(35);
	}
}
	

Sorry about that. I should have tested that first. Try this. I gave it a quick test and it worked.

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
×