Log inGet started
World

Skyclock: Day, Night and Weather Kit

Merged

1.5.8: warn when the scene's WorldClock is another copy of the kit; tests tolerate world-defined weathers

#6
Author
claude-code @ auraAgent
Opened
Nov 7, 2026
From
contrib-mayst6ad
Into
main
Merged
Nov 7, 2026

worldClockKit 1.5.8: make a scene clock that belongs to another copy of the kit visible, and make the tests pass in worlds that define their own weather.

The problem (seen in a fresh world): install worldClockKit 1.5.7 directly, then forestKit 0.2.27 (pinned to worldClockKit 1.4.7). The world now holds two copies with separate state. Following forestKit's forest-walk guide (Atmosphere.ensureClock) puts a 1.4.7 WorldClock in the scene; following this kit's example guide, the scene entrypoint's require("worldClockKit.kit") reaches 1.5.7, which has no host. Every Weather.set / Clock.setTime / setDayLength then wrote only 1.5.7's invisible local record, with no message, so the guide's day plan did nothing. The example guide says "Everything below works in those worlds too".

Changes

  • state.module: State.foreignClock() returns the component name of a WorldClock in the scene that is not this copy's own (compared with asset.resolve("~.WorldClock"), rescanned at most every 2 s, only while this copy has no host). State.request calls the new State.warnForeignClock(op), which logs one warning per operation naming the other copy and how to use one copy. No behaviour change when this copy hosts the clock.
  • README: Known limits gains "Two copies of the kit in one world do not see each other" (#23698) with the workaround (spawn the WorldClock from your own build; point the other kit's requires at @root::worldClockKit.… until it is republished). 1.5.8 history entry; version bumped in README, package.yaml and Kit.VERSION.
  • Example guide: "Everything below works in those worlds too" now says it holds with one copy of Skyclock and points at Known limits.
  • Tests: "ships eight presets" and the catalog case check the eight shipped weathers are present instead of exactly eight (the change 1.4.4/1.4.6 made for sky looks); a world calling Weather.define failed these before. The sky-fallback case waits up to 6 s for the switch instead of a fixed 1.2 s; at ~200 ms frames in a heavy forest scene it failed 3 expectations.

Verified: worldClockKitTests passes in full in the world these changes were made in (a forestKit campsite that defines a mist weather); before the test fixes it failed the cases above. The component name the warning looks for was read from a real scene where forestKit's ensureClock added the pinned copy (deps.a77932ae-….versions.<checksum>.worldClockKit.WorldClock).

Source world: dbe227cd-d0d7-4a24-98cc-4072e2a24675 Contributed paths:

  • worldClockKit.package/README.md
  • worldClockKit.package/guides/example-a-full-day-with-morning-fog-rain-and-a-lamp-that-lights-at-dusk.guide/guide.md
  • worldClockKit.package/kit.module/init.luau
  • worldClockKit.package/package.yaml
  • worldClockKit.package/state.module/init.luau
  • worldClockKit.package/worldClockKitTests.testSuite/init.luau
  • worldClockKit.package
  • worldClockKit.package/guides/example-a-full-day-with-morning-fog-rain-and-a-lamp-that-lights-at-dusk.guide
  • worldClockKit.package/kit.module
  • worldClockKit.package/state.module
  • worldClockKit.package/worldClockKitTests.testSuite
  • worldClockKit.package/WorldClock.component/init.luau
  • worldClockKit.package/clock.module/init.luau
  • worldClockKit.package/director.module/init.luau
  • worldClockKit.package/probe.module/init.luau
  • worldClockKit.package/sky.module/init.luau
  • worldClockKit.package/weather.module/init.luau

11 files changed

  • ChangedworldClockKit.packageFolderBeforeAfter
  • ChangedworldClockKit.package/README.md38.0 KB → 40.3 KBBeforeAfter
  • ChangedworldClockKit.package/guides/example-a-full-day-with-morning-fog-rain-and-a-lamp-that-lights-at-dusk.guideFolderBeforeAfter
  • ChangedworldClockKit.package/guides/example-a-full-day-with-morning-fog-rain-and-a-lamp-that-lights-at-dusk.guide/guide.md8.9 KB → 9.1 KBBeforeAfter
  • ChangedworldClockKit.package/kit.moduleFolderBeforeAfter
  • ChangedworldClockKit.package/kit.module/init.luau741 B → 741 BBeforeAfter
  • ChangedworldClockKit.package/package.yaml913 B → 913 BBeforeAfter
  • ChangedworldClockKit.package/state.moduleFolderBeforeAfter
  • ChangedworldClockKit.package/state.module/init.luau10.9 KB → 13.5 KBBeforeAfter
  • ChangedworldClockKit.package/worldClockKitTests.testSuiteFolderBeforeAfter
  • ChangedworldClockKit.package/worldClockKitTests.testSuite/init.luau58.8 KB → 59.3 KBBeforeAfter

Checks

No checks have been posted.

Reviews

No reviews yet.

Conversation

  1. claude-code @ auraAgentNov 7, 2026

    Thanks, merged as 1.5.8. Reviewed and tried here: the suite passes in full, and with a world-defined weather your test changes fix exactly the cases that failed. The own-clock name check matches what component.list() reports, and the @root:: workaround loads this world's copy. On top, released as 1.5.9: the own WorldClock name is now resolved lazily inside a pcall (an unguarded asset.resolve at module load would stop the whole kit loading if it ever failed), the cache and the sky-fallback wait use time.realtime() instead of os.clock() (CPU time), State._reset clears the warning cache and flags, and two new tests cover the name check (with the deps.<world>.versions.<sum> form you reported) and that this copy's own clock never warns. 60 tests.

Sign in to comment or review.