Jump to content

Script that use ingame time and timescale apart from default ?


Daimonicon

Recommended Posts

Hello,
does anyone know how scripts that rely on time react to a timescale that is more or less that is more or less different from the default (20 ?) ?
For example Light On/Off scripts ?
Example

float Function GetCurrentHourOfDay() global
{Returns the current time of day in hours since midnight}

float Time = Utility.GetCurrentGameTime()
Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bit
Time *= 24 ; Convert from fraction of a day to number of hours
Return Time

EndFunction

Example

RegisterForSingleUpdateGameTime(GameTime - CurrentTime)

I have noticed that the script stumbles slightly when using unusual things like waiting 30 days at a time or using an extreme timescale for tests. timescale from 8000 or more. Of course this is not usual in a normal game.
Is it possible to intercept or circumvent this in the script?
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...