Damage Per Second Map v2

New maps, and other projects whose primary focus is new maps, belong here.

NOTE: This forum, and all forums below it, are NOT Q&A or troubleshooting forums! They are for active projects only! Please use the Editing or General or its subforums for such questions.
Forum rules
The Projects forums are ONLY for YOUR PROJECTS! If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.

Damage Per Second Map v2

Postby DTDsphere » Sat Mar 03, 2018 11:25 pm

OLD THREAD: viewtopic.php?f=42&t=54317

Hello, I've been learning code at Uni and I decided to give this project another go. This time it actually tells you the damage per second.
This is great for when making gameplay mods as you can see how powerful your weapons and items actually are!

Download Here

Screenshots: (links not embeds because some dickhead admin thought it would be a good idea to disable the [img] tag)
https://i.imgur.com/Se7qTV0.png
https://i.imgur.com/yVGIobr.png

Code: Select allExpand view
#include "zcommon.acs"
int tic = 0; //Clock for displaying DPS
int second = 0; //Internal clock for Average DPS(Damage Per 10 Seconds)
int dmgDealt = 0; //Value for Damage Dealt each tic (realtime)
int dmgSecond = 0; //Value for Damage Dealt each second
int dmgTenSeconds = 0; //Value for Damage Dealt each 10 seconds
int xtextbox = 1.0; //xPosition for text e.g. "title: timer, damage"
int ytextbox = 0.15; //yPosition for text e.g. "title: timer, damage"

////////////////
//Total Damage//
////////////////
Script 1 OPEN
{
   SetFont("CONFONT");
   
   //Damage dealt is the difference between the Cyberdemon's max health (999999) and current health.
   dmgDealt = 999999 - GetActorProperty(1,APROP_Health);
   
   /*1 Total Damage Title*/ HUDMessageBold (s:"Total damage:           ";HUDMSG_PLAIN,1,CR_RED,xtextbox,ytextbox,0,1);
   /*2 Total Damage Value*/ HUDMessageBold (d:dmgDealt;HUDMSG_PLAIN,2,CR_RED,xtextbox,ytextbox,0,1);
   
   //Check every tic
   Delay (1);
   Restart;
}

///////
//DPS//
///////
Script 2 OPEN
{
   SetFont("CONFONT");

   //If Cyberdemon isn't at Max Health (999999), don't activate timer and initalise everything
   If (GetActorProperty(1,APROP_Health) == 999999)
   {
      /*3 DPS Title & init Timer*/    HUDMessageBold (s:"\nDPS: 70", s:"        ";HUDMSG_PLAIN,3,CR_ORANGE,xtextbox,ytextbox,0,1);
      /*4 Init DPS Value*/          HUDMessageBold (s:"\n0";HUDMSG_PLAIN,4,CR_ORANGE,xtextbox,ytextbox,0,1);
   
      //Check every tic
      Delay(1);
      Restart;
   }
   
   //Update every two seconds
   If (tic <= 0)
      {
      //Reset timer back to 70
      tic = tic + 70;
      
      //DPS equals half the value of the total difference between real-time damage and the damage from 2 seconds ago
      /*4 True DPS Value*/ HUDMessageBold(s:"\n", d:(dmgDealt-dmgSecond)/2;HUDMSG_PLAIN,4,CR_ORANGE,xtextbox,ytextbox,0,1);
      
      //Damage from 2 seconds ago is now refreshed with the current real-time damage value to be compared again in 2 seconds from now
      dmgSecond = dmgDealt;
      }
   
   //If Else statement to keep timer value 2 digits long e.g. display 09 instead of 9
   /*3 DPS Title & true Timer*/ If (tic < 10)   { HUDMessageBold (s:"\nDPS: 0", d:tic, s:"        ";HUDMSG_PLAIN,3,CR_ORANGE,xtextbox,ytextbox,0,1); }
   /*3 DPS Title & true Timer*/ Else          { HUDMessageBold (s:"\nDPS: ",  d:tic, s:"        ";HUDMSG_PLAIN,3,CR_ORANGE,xtextbox,ytextbox,0,1); }
   
   //Check every tic while taking 1 from timer
   Delay(1);
   tic = tic - 1;
   Restart;
}

/////////////////////////////////////////////
//Average DPS (Damage dealt per 10 seconds)//
/////////////////////////////////////////////
Script 3 OPEN
{
   SetFont("CONFONT");
   
   //If Cyberdemon isn't at Max Health, don't activate timer
   If (GetActorProperty(1,APROP_Health) == 999999)
   {
      /*6 Avg DPS Title & init Timer*/    HUDMessageBold (s:"\n\nAverage DPS: 10        ";HUDMSG_PLAIN,6,CR_GOLD,xtextbox,ytextbox,0,1);
      /*5 Init Avg DPS Value*/          HUDMessageBold (s:"\n\n0";HUDMSG_PLAIN,5,CR_GOLD,xtextbox,ytextbox,0,1);
      Delay(1);
      Restart;
   }
   
   //Update every 10 seconds
   If (second <= 0)
   {
      //Reset timer back to 10
      second = second + 10;
      
      /*5 True Avg DPS Value*/ HUDMessageBold (s:"\n\n", d:(dmgDealt-dmgTenSeconds)/10;HUDMSG_PLAIN,5,CR_GOLD,xtextbox,ytextbox,0,1); //The difference between current damage and damage from 10 seconds ago
      
      //Damage from 10 seconds ago is now refreshed with the current real-time damage value to be compared again in 10 seconds from now
      dmgTenSeconds = dmgDealt;
   }
   
   //Keep timer value 2 digits long e.g. display 09 instead of 9.
   /*3 Avg DPS Title & true Timer*/ If (second < 10) { HUDMessageBold (s:"\n\nAverage DPS: 0", d:second, s:"        ";HUDMSG_PLAIN,6,CR_GOLD,xtextbox,ytextbox,0,1); } //Title and true timer
   /*3 Avg DPS Title & true Timer*/ Else {          HUDMessageBold (s:"\n\nAverage DPS: " , d:second, s:"        ";HUDMSG_PLAIN,6,CR_GOLD,xtextbox,ytextbox,0,1); } //Title and true timer
   
   //Check every second (35 tics) while taking 1 from timer
   Delay(35);
   second = second - 1;
   Restart;
}

////////////////
//Reset button//
////////////////
Script 4 (void)
{
   SetFont("CONFONT");
   
   //Kill and replace Cyberdemon
   Thing_Damage (1, 999999);
   Spawn ("CyberdemonDPS", 0, 0, 0, 1, 192);
   Spawn ("TeleportFog", 0, 0, 0, 0, 0);
   
   //Reset internal timer and damage values
   tic = 70;
   second = 10;
   dmgSecond = 0;
   dmgTenSeconds = 0;
   
   //Terminate and restart Script 2 and 3 to keep them in sync
   ACS_Terminate (2,0);
   ACS_Terminate (3,0);
   Delay (1);
   ACS_Execute (2,0,0,0,0);
   ACS_Execute (3,0,0,0,0);
   
   //Reset external damage value to 0
   HUDMessageBold (s:"\n0";HUDMSG_PLAIN,4,CR_ORANGE,xtextbox,ytextbox,0,1);
   HUDMessageBold (s:"\n\n0";HUDMSG_PLAIN,5,CR_GOLD,xtextbox,ytextbox,0,1);
}
Last edited by DTDsphere on Mon Feb 04, 2019 12:41 pm, edited 2 times in total.
User avatar
DTDsphere
 
Joined: 16 Jun 2010

Re: Damage Per Second Map v2

Postby DTDsphere » Mon Mar 05, 2018 7:40 am

Heya,
I've updated this WAD file since the creation of this thread. If you managed to download it early on, please redownload. Thanks!

There will be no more updates.

EDIT:
I just have to do a simple fix to the text overlapping each other when using something other than the default message scaling.
User avatar
DTDsphere
 
Joined: 16 Jun 2010

Re: Damage Per Second Map v2

Postby kinker31 » Thu Mar 29, 2018 7:58 pm

So, I decided to test the map on Russian Overkill...
And let's just say some of the weapons were able to breach the 1M hitpoint limit and kill the cyberdemon.
Especially with the Minelobber's 'Nuclear Disco'.
Like I said, it was a great map.
User avatar
kinker31
 
Joined: 05 Feb 2018
Discord: kinker31#1062

Re: Damage Per Second Map v2

Postby DTDsphere » Wed Apr 04, 2018 7:03 am

kinker31 wrote:So, I decided to test the map on Russian Overkill...
And let's just say some of the weapons were able to breach the 1M hitpoint limit and kill the cyberdemon.
Especially with the Minelobber's 'Nuclear Disco'.
Like I said, it was a great map.

I think breaking the 1M hitpoint limit speaks for itself.

EDIT: Updated from today. Functionally identical but added a bit of polish.
User avatar
DTDsphere
 
Joined: 16 Jun 2010

Re: Damage Per Second Map v2

Postby GeneralDelphox » Wed Apr 04, 2018 1:13 pm

This is nice. I hope someone could implement it as a HUD addon.
User avatar
GeneralDelphox
 
Joined: 30 Sep 2017
Discord: #8387

Re: Damage Per Second Map v2

Postby popguy12 » Fri Sep 28, 2018 10:08 pm

GeneralDelphox wrote:This is nice. I hope someone could implement it as a HUD addon.


That would be cool.

also, isnt there a way to make the cyberdemon invincible? or would that break the dps counter?
popguy12
 
Joined: 19 Jan 2018
Location: Limbo between Hell and Earth

Re: Damage Per Second Map v2

Postby Tango » Mon Oct 01, 2018 12:06 am

this seems extremely useful, can't wait to try this out on my own mod. thanks so much for making and sharing :D
User avatar
Tango
heh!
 
Joined: 31 Jul 2006

Re: Damage Per Second Map v2

Postby ramon.dexter » Mon Oct 01, 2018 2:43 am

Great, this really eases up testing of custom damage in wepons and projectiles!
User avatar
ramon.dexter
rudebwoy
 
Joined: 20 Oct 2015
Location: Kozolupy, Bohemia

Re: Damage Per Second Map v2

Postby m8f » Mon Oct 01, 2018 8:56 am

Thanks for making this! One more tool to modder's development kit.

GeneralDelphox wrote:This is nice. I hope someone could implement it as a HUD addon.
damage-log.pk3
(1.51 KiB) Downloaded 19 times

Three CVars to control:
dl_x, dl_y: text position on the screen.
dl_log: if set to true, all damage events are logged to console in CSV format: Source,Target,Value (off by default).
User avatar
m8f
 
 
 
Joined: 29 Dec 2017


Return to Levels

Who is online

Users browsing this forum: Yandex [Bot] and 3 guests