Skip to main content

SetTimecycle

This function was added in DSL 10

Description

Sets the given timecycle object for a specific hour, season, and weather condition. Unlike the SetExtraTimecycle function, this function applies the timecycle only to exterior environments, and does not affect interior scenes.

info

A timecycle object (userdata) can be obtained from the following functions:

function SetTimecycle(hour, season, weather, timecycle) --[[ ... ]] end

Parameters

  • hour: number - An integer value ranging from 0 to 23.
  • season: number - An integer value ranging from 0 to 3.
  • weather: number - An integer value ranging from 0 to 5.
  • timecycle: userdata - A timecycle object.

Return Values

None.

Example

Applies the current timecycle for the next timecycle.

local Hour = ClockGet()
local Season = SeasonGet()
local Weather = WeatherGet()

local TC = CopyTimecycle(GetTimecycle(Hour, Season, Weather))
SetTimecycle(Hour + 1, Season, Weather, TC)