Display System Time in SBARINFO

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Display System Time in SBARINFO

Re: Display System Time in SBARINFO

by axredneck » Wed Sep 04, 2019 9:33 am

Thank you

Re: Display System Time in SBARINFO

by Graf Zahl » Wed Sep 04, 2019 7:23 am

No, GZDoom has its HUD in ZScript. The SBARINFOS are only there for mods that use them as a base for modification.

Re: Display System Time in SBARINFO

by axredneck » Wed Sep 04, 2019 7:12 am

GZDoom has it's HUD in SBARINFO so i thought it is right way to make HUD. OK, i'll try to zscript something...

Re: Display System Time in SBARINFO

by Graf Zahl » Wed Sep 04, 2019 7:01 am

ZScript, of course.
I don't think you can retrieve the system time, but on the ZScript side it has a chance of getting added. Back in 2017 I blanketly closed all SBARINFO related suggestions regardless on content or merit.
The SBARINFO code is in a state that I won't maintain it any longer beyond keeping it operable.

Re: Display System Time in SBARINFO

by axredneck » Wed Sep 04, 2019 6:58 am

So what should i use instead of SBARINFO ?

Re: Display System Time in SBARINFO

by Graf Zahl » Tue Sep 03, 2019 11:15 pm

Because SBARINFO is deprecated and will not be extended anymore.

Re: Display System Time in SBARINFO

by axredneck » Tue Sep 03, 2019 5:25 pm

Why this feature suggestion is [closed] ?

Re: Display System Time in SBARINFO

by saegiru » Mon Feb 15, 2016 6:02 pm

Here is the code for the "clock" I made... just to show you my desperation. Again, it only works if you don't ever die/reload/respawn.

Code: Select all

#library "systemclock"
#include "zcommon.acs"

int gametime; 
int hr;
int min; 
int currenthr;
int currenttens;
int currentones;
//int sec;

Script 102 enter
{
While(True)
{
SetHudSize(640,480,0);
gametime = Timer() / 35;

hr = gametime/3600; 
min = (gametime/60)%60; 

currenthr = GetUserCVAR(PlayerNumber(),"current_hr")+hr;
currentones = GetUserCVAR(PlayerNumber(),"current_ones")+(min%10);
currenttens = GetUserCVAR(PlayerNumber(),"current_tens")+(min/10);

//sec = gametime%60;
If (currentones > 9)
{
currenttens = currenttens + 1;
currentones = 0;
//min = 0;
}
If (currenttens > 5)
{
currenthr = currenthr + 1;
currenttens = 0;
currentones = 0;
//min = 0;
}

hudmessagebold(d:currenthr, s:":", d:currenttens, d:currentones;//, s:":", d:sec/10, d:sec%10; 
      HUDMSG_PLAIN, 215, CR_GRAY, 375.2, 270.1, 0);
	  Delay(1);
}
}

Display System Time in SBARINFO

by saegiru » Mon Feb 15, 2016 2:02 pm

Hi, after much searching I have yet to find a definitive answer for this - but would it be possible to add system time as an accessible display for DrawNumber or something in SBARINFO? I just find that it would be exceedingly convenient to have system time available to display as it already is on the AltHUD.

If there is a good reason that this can't be allowed, that is fine - but as it is already accessible via the AltHUD I don't see why it wouldn't be?

As for the why, it's mainly for convenience - I would like the capability to have it show on screen as something like "Earth Time: hh:mm:ss" just so that when I'm playing long sessions, I can keep an eye on what time it is. I even went so far as to create a "clock" ACS script that you set using CVARs, and runs "like" a clock, but after you save or load, it goes back to displaying the incorrect time so you would have to reset it if you die and reload, or start a new map, etc.

Maybe add a few new variables to SBARINFO for drawnumber... SysHr, SysMin, SysSec?
Example:

Drawstring SMALLFONT, Green, "Earth time: ", 50, 50;
Drawnumber 2, SMALLFONT, Green, SysHr, 60, 50;
Drawstring SMALLFONT, Green, ":", 60, 52;
Drawnumber 2, SMALLFONT, Green, SysMin, 60, 54;
Drawstring SMALLFONT, Green, ":", 60, 56;
Drawnumber 2, SMALLFONT, Green, SysSec, 60, 58;

Obviously that may or may not be lined up right - but that is the general idea... Again, if a similar function exists and I'm not aware - let me know, and if for some technical reason this can't be allowed - let me know as well

This is the one of the last things I want out of my perfect HUD at this point, and it is driving me crazy that i can't implement it.

Thanks!

Top