[Added] System time in ZScript

Moderator: GZDoom Developers

Re: System time in ZScript

Postby ZZYZX » Tue Sep 10, 2019 7:14 am

I can already easily detect savegames by comparing level time at global map load handler. I don't understand the concerns.
I can even store my precious terrywad-critical information between saves and loads by using a cvar! (but I could also store global player progress and inventory there)

(Sep 07 is an old post? :о)
User avatar
ZZYZX
le chat du rabbin
 
 
 
Joined: 14 Oct 2012
Location: Ukraine
Discord: ZZYZX#1394
Github ID: jewalky

Re: System time in ZScript

Postby Rachael » Tue Sep 10, 2019 8:12 am

ZZYZX wrote:(Sep 07 is an old post? :о)

If you're going to make an argument about a comment out of context without taking into account the context within which the point was made, it's not only foolish, but it's a waste of time, and quite annoying to boot.

Don't do that.

And if this savegame discussion continues I will not invest any effort into this feature at all. I'm already quite sick of it and it already seems not worth it with people more interested in pointlessly arguing a point that's already been conceded, than they are in any actual productive or constructive discussion about it.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: System time in ZScript

Postby 3saster » Fri Nov 22, 2019 1:27 pm

Any word on this? It, uh, seems to have gone dormant...

I simply ask because it seems that since you are okay with UI-scope only, all that would need to be done is make this method public. I'll say that it does make the location in althud a little odd though.

Since Nightfright and I largely just want this for our own mod, I'd be willing to do the work myself, but I need to be clear on the specifications. This is what I am thinking:
  • Make a Clock class that is UI-scope in ZScript.
  • Add the static native public methods GetTime(), which returns the Unix timestamp, and GetRealTime(), which returns the Unix timestamp taking timezone into account.
  • Add a static public method SetTime() that lets you set the current time (i.e. a debug override).
  • Make a global variable of this type that can be accessed directly.
Does this seem okay, or totally off? Are there any other things to consider?
User avatar
3saster
 
Joined: 11 May 2018
Location: Canada

Re: System time in ZScript

Postby _mental_ » Fri Nov 22, 2019 1:45 pm

Points one and two seem OK, the third one is WTF, and the forth is “sorry, I didn’t get it” too.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: System time in ZScript

Postby Graf Zahl » Fri Nov 22, 2019 1:55 pm

What's the point of Unix time? Getting that displayed requires quite a bit of support code.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: System time in ZScript

Postby 3saster » Fri Nov 22, 2019 2:09 pm

GetRealTime() can be trivially implemented, because, well, it already exists :P I agree that GetTime() doesn't make much sense unless SetTime() is implemented, which I only suggested cause Rachel suggested a debug parameter did earlier. The global idea was stupid, because I went full dumb and forgot the methods were static. Perhaps I'll just go ahead and make a PR, and we move the discussion there.
User avatar
3saster
 
Joined: 11 May 2018
Location: Canada

Re: System time in ZScript

Postby 3saster » Fri Nov 22, 2019 9:49 pm

User avatar
3saster
 
Joined: 11 May 2018
Location: Canada

Re: System time in ZScript

Postby ZZYZX » Fri Nov 29, 2019 6:05 am

Graf Zahl wrote:What's the point of Unix time? Getting that displayed requires quite a bit of support code.

Yup, I'd rather have something like strftime() ported. This time we also don't need any 64-bit ints :)

(edit: actually looked at 3saster's code and there is strftime)
User avatar
ZZYZX
le chat du rabbin
 
 
 
Joined: 14 Oct 2012
Location: Ukraine
Discord: ZZYZX#1394
Github ID: jewalky

Re: System time in ZScript

Postby 3saster » Sat Nov 28, 2020 1:42 pm

This was added in 4.5.0 and can be closed. See relevant wiki page.
User avatar
3saster
 
Joined: 11 May 2018
Location: Canada

Previous

Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest