StaticPlanet

StaticPlanet

class

Celestial body with its own day cycle in world ticks

  • load-only Usable only while mods load. The game seals these members once loading finishes, so a call or a write from a running world raises an error.

Fields

NameTypeDescription
day_length_ticks integer Simulation ticks per full local day
phase_offset_ticks integer Added to the phase after day wrap
dawn_phase_ticks integer Day phase of the dawn anchor
solar_noon_phase_ticks integer Day phase of the solar noon anchor
sunset_phase_ticks integer Day phase of the sunset anchor
latitude_deg number Observer latitude used by the solar model
day_of_year integer Day of the tropical year fixing solar declination
weather_severity_min load-only number Calmest point the weather cycle reaches, from 0 clear sky to 1 full storm
weather_severity_max load-only number Stormiest point the weather cycle reaches, from 0 clear sky to 1 full storm

Functions

StaticPlanet:cosmetic_hours_from_day_phase_ticks(day_phase_tick)

Cosmetic hours [0, 24) for a tick in local day-phase space

day_phase_tick integer Tick within the local day

returns number

StaticPlanet:time_of_day_hours_from_ticks(total_game_ticks)

Solar hour [0, 24) for a world tick

total_game_ticks integer Absolute world tick

returns number

StaticPlanet:resolve_time_of_day_hours(world_time_auto_advance, locked_world_time_of_day_phase_ticks, total_game_ticks)

Solar hour honouring a locked time of day

world_time_auto_advance boolean False freezes the sky at the locked phase
locked_world_time_of_day_phase_ticks integer Phase used while frozen
total_game_ticks integer Absolute world tick

returns number

Standard members (5)

Every class of this kind carries these.

StaticPlanet.cast(object) Trying to cast Object into StaticPlanet
StaticPlanet.get_class() Return StaticPlanet class object
StaticPlanet.find(name) Looks StaticPlanet up in db, nil when there is none
StaticPlanet.get(name) Takes StaticPlanet from db, reports a miss to the log
StaticPlanet.reg(name) load-only Register a new StaticPlanet static object
Inherited from Prototype (2)
Inherited from Object (1)