Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PoC] Live Clock
Abion47 Offline
Senior Member

Posts: 350
Threads: 22
Joined: Oct 2015
Reputation: 46
#1
[PoC] Live Clock

I haven't released a PoC map in a while, but this is an idea that's been rattling around in my mind for long enough that I just had to get it down.

[Image: fac06aa830.gif]

It started way back when I was working on compiling the hps_api script reference on the wiki and I noticed the cDate object as well as the cSystem_GetDate function. I figured that if HPL3 has a function for getting the system date, then it would be fairly trivial to create a kind of clock mod. But that function was also buried fairly deep in hps_api that I'd guess most people wouldn't even know that it exists. So yeah.

A note about its triviality, though. When you have a cDate object, it has fields for all the stuff you would want, from years to seconds and everything in between. The problem, however, is that the values of these fields are a bit nonsensical. Now I'm pretty sure that they are in some kind of standardized format and there's some kind of simple conversion from raw system time to human-readable format, but I found an easier way. There's another function called cLux_GetStringWFromDate that does the conversion automatically. The downside is that you get the information in one long string which you then have to manually split up and parse into numbers, but that's not that big of a deal at all, so I consider the trade-off to be worth it.

As usual, you can grab it on Steam Workshop.
01-24-2016, 05:26 AM
Find Reply




Users browsing this thread: 1 Guest(s)