Twine Version: Twine 2
Story Format: Harlowe3.2.3
Hello!
I was wondering if it might be possible to write some code that will track how long a user spends in the game, and report that amount of time at the end (as in, a final congratulations screen telling the user various stats including time taken.)
I tried adding:
(set: $gamestart to (current-time: ))
to my startup passage, and
(set: $gameend to (current-time: ))
to the final passage, thinking that I could just subtract to get the amount of elapsed time.
However, it seems that these variables are being saved as strings rather than numerical values, and I am not clever enough with Harlowe coding to know how to convert datatypes.
Is there any way to do this, or is this just an idea I should abandon?