Jump to content
  • 0

In game timer?


Percy T

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...