Skip to main content

World & Gameplay

Functions related to the world state.

EndGame
Ends the current game with a 'game-over' screen. The user cannot interact with the scene anymore, and will be able to exit the game or reload save data.
GetTime
  • (number) - current day
  • (number) - current hour (0-23)
Returns the current world clock time, represented as the current day and the 24-hour time. The game starts at day 1, hour 8. Note: This function has two return values.
GetTimeDay
  • (number) - current day
Returns only the day portion of the current world clock time.
GetTimeHour
  • (number) - current hour (0-23)
Returns only the hour portion of the current world clock time.
GetTimeHourTotal
  • (number) - cumulative hour total
Returns the total number of hours passed on the clock. Useful for setting timers. Equivalent GetTimeDay() * 24 + GetTimeHour().
GetIsNight
  • (boolean) - true if night, false if day
Returns whether the current world clock time is either earlier than 06:00, or later than 20:00.
AdvanceTime
hours
  • hours (number) - number of world-hours to add to the clock
Advances the time of the world clock, as returned by the GetTime() function. This function will automatically roll the clock over to the next day as required.
SetTimeHour
hour
  • hour (number) - new hour (0-23) to advance the clock to
Advances the time of the world clock so that the current hour matches the input hour number.