I noticed something pretty cool, and I hope AH will not "fix" this, but it is possible to extend the GameMode-object with properties and methods AND IT IS SAVE GAME COMPATIBLE. Tested it a couple of times because I didn't believe it at first
. So I added a couple of useful methods to my GameMode-object which probably are useful for many of you.
Just copy paste this to any script entity
Code: Select all
GameMode.getHours = function()
local hour = math.floor(GameMode.getTimeOfDay()/(2/24))+6 -- add 6 hours because 0.0 = 6:00
return hour%24
end
GameMode.getMinutes = function()
return math.floor(GameMode.getTimeOfDay()/(2/24/60)%60)
end
Now you can get Grimrock-time converted to real hours and minutes by calling those methods.