Skip to content

Clock

The clock object represents the time of the world. There is only one clock object, it can be accessed using world.clock.

Properties

freeze

true if clock is frozen, the clock does not tick.

hour

Hour, 0...23.

minute

Minute, 0...59.

multiplier

Fast clock multiplier rate. That is, one minute in real time represents multiplier minutes of world time.

running

true if clock is running, false if the clock is frozen or the world is not running.

time

Current time in ticks since midnight, each tick is one fast clock minute, e.g. 383 is 6:23 (AM)

Events

on_freeze

Fired when the clock is frozen or stopped.

Handler signature

function (time, user_data)

Arguments

  • time - Current time in ticks since midnight.

  • user_data - optional user-provided value (see Events).

on_resume

Fired when the clock resumes.

Handler signature

function (time, multiplier, user_data)

Arguments

  • time - Current time in ticks since midnight.

  • multiplier - Fast clock multiplier rate.

  • user_data - optional user-provided value (see Events).

on_tick

Fired when the clock ticks, once every fast clock minute.

Handler signature

function (time, user_data)

Arguments

  • time - Current time in ticks since midnight.

  • user_data - optional user-provided value (see Events).