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? :о)
System time in ZScript
Moderator: GZDoom Developers
-
- Posts: 13299
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: System time in ZScript
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.ZZYZX wrote:(Sep 07 is an old post? :о)
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.
-
- Posts: 199
- Joined: Fri May 11, 2018 2:39 pm
- Location: Canada
Re: System time in ZScript
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:
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.
-
-
- Posts: 3799
- Joined: Sun Aug 07, 2011 4:32 am
Re: System time in ZScript
Points one and two seem OK, the third one is WTF, and the forth is “sorry, I didn’t get it” too.
-
- Lead GZDoom+Raze Developer
- Posts: 48657
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: System time in ZScript
What's the point of Unix time? Getting that displayed requires quite a bit of support code.
-
- Posts: 199
- Joined: Fri May 11, 2018 2:39 pm
- Location: Canada
Re: System time in ZScript
GetRealTime() can be trivially implemented, because, well, it already exists
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.

-
- Posts: 199
- Joined: Fri May 11, 2018 2:39 pm
- Location: Canada
-
-
- Posts: 1382
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: System time in ZScript
Yup, I'd rather have something like strftime() ported. This time we also don't need any 64-bit intsGraf Zahl wrote:What's the point of Unix time? Getting that displayed requires quite a bit of support code.

(edit: actually looked at 3saster's code and there is strftime)
-
- Posts: 199
- Joined: Fri May 11, 2018 2:39 pm
- Location: Canada
Re: System time in ZScript
This was added in 4.5.0 and can be closed. See relevant wiki page.