Is there any way for MV to see the current real world time of the device it's running on?
I'd like to have certain elements of the game change depending upon what hour of the day it is.
$gameVariables.setValue(13, new Date().getHours());
$gameVariables.setValue(14, new Date().getMinutes());
$gameVariables.setValue(15, new Date().getSeconds());
$gameVariables.setValue(16, new Date().getMilliseconds());
For the situation you described, the above code would be all you need.
If you want to compare those times later, it would be better to do this:
$gameVariables.setValue(13, new Date().getTime());
This will store the exact time in the variable. When you want to compare it, you can store the new time in another variable:
$gameVariables.setValue(14, new Date().getTime());
And to compare, you can even use a regular conditional branch. If you do variable 14 - variable 13, you'll get the number of milliseconds between them.
Thanks both! This is perfect and actually may very well solve another issue I was having previously. 😀