Time functions

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
Zo Kath Ra
Posts: 944
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Time functions

Post by Zo Kath Ra »

Time.deltaTime() apparently gives you the number of seconds since the last frame.

But what's the difference between Time.currentTime() and Time.systemTime()?
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Time functions

Post by minmay »

Time.systemTime() seems to be elapsed time since the the Grimrock 2 executable was started, carrying over across pretty much everything except closing the game entirely - even starting/exiting the editor. Also, it's not the number of seconds, it's slower than that. You would use this for something like seeding a PRNG.

Time.currentTime() is the number of seconds elapsed in the dungeon. If you save the game with a current time of 50 seconds, then load the game later, Time.currentTime() will still return 50 seconds when the game is reloaded. You would use this for things like noise for flickering light sources.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Post Reply