Builtin Library
- ..
- .build.state16 B
- .metadata17 B
- README.md6.7 KB
- build.luau25.1 KB
- entrypoint.luau6.0 KB
- scene.json457 KB
README.md
[scene_name]
A campfire clearing to start a world from: a low wooded bowl at the edge of a pond, a path from the spawn to the fire, three log seats and a bench round it, a lantern on a post beside it, a sky that runs through the day from 17:30, with clouds drifting over, and weather that opens fair and changes with one setting. Players arrive on the path facing the fire.
Everything here is yours to keep, change or remove. All of it hangs under one
entity, clearing, so one call clears it and leaves the player setup:
tools.use("scene", "remove", { "clearing" })
Parts
Each part directly under clearing carries a role attribute, so a part is
found, kept or removed by what it is for:
| Part | role | What it is |
|---|---|---|
lighting | sky | The scene setup @builtin::scenes.clearing.lighting: the sky and its hour, the sun and the moonlight that follow it, ambient light and height fog that dim and blue with the hour, and a sky light. |
clouds | sky | A VolumetricSky cloud layer, lit by the sun at every hour. |
weather | sky | The weather, from the Cloudburst package (@cloudburst::cloudburst.Cloudburst, installed when the world was made), shared by every player: fair to start with. A world without Cloudburst has no weather part. |
ground | ground | The terrain, the path over it and a HeightfieldCollider holding the same heights. |
pond | ground | Pond water from the Tidewater package (@tidewater::tidewater.components.WaterBody, installed when the world was made), reeds round its edge and a Water volume that floats what falls in. A world without Tidewater gets a plain still surface instead. |
campfire | prop | A ring of stones and logs, a Fire at medium quality, and a collider that keeps players and the camera out of the flames. |
seats | prop | Three log seats and a plank bench, each with a collider. |
lantern | prop | An iron lantern on a post, with a warm point light that casts shadows. |
plants | decor | Trees, bushes, rocks, grass and flowers, scattered from a seed. |
tools.use("scene", "find", { attribute = { name = "role", value = "decor" } })
tools.use("scene", "remove", { attribute = { name = "role", value = "prop" } })
PlayerSetups and Spawns stand beside the clearing: the player prototype
(a humanoid avatar and an orbiting follow camera) and the spawn on the path.
Packages
A new world made with this scene installs two kits as libraries, each pinned at one version:
- Tidewater (
/source/libs/@tidewater): the pond is its water. Its guides say what else it does: lakes, rivers, waterfalls, floating and swimming.world.uninstallLibrary("@tidewater")takes it out; the next rebuild of this scene then draws the plain surface. - Cloudburst (
/source/libs/@cloudburst): the weather. Its guides say what else it does: placed fog banks, shelter indoors, puddles, its own Luau API.world.uninstallLibrary("@cloudburst")takes it out; the next rebuild of this scene then leaves theweatherpart out.
The weather
The clearing opens on a fair evening (clear_day: a few clouds and a light
breeze). One field of the weather entity's Cloudburst picks the weather, and
the change fades in over changeSeconds (12 s) for every player:
local weather = entity.find("weather").component.get("@cloudburst::cloudburst.Cloudburst")
weather.preset = "steady_rain" -- light_drizzle, passing_shower, tropical_downpour,
-- night_storm_town, hailstorm, sleet_squall, alpine_snow,
-- blizzard, valley_fog, misty_dawn, gale, calm_night, clear_day, ...
cycle is a forecast: the weather changes by itself, step by step, on the
shared clock, so every player (one who joins late too) sees the same weather.
Each step is a preset and its minutes, and blend N gives a step its own fade
in seconds. A forecast whose last step has no minutes runs once and then holds
that last weather; one whose every step has minutes loops:
-- a stormy evening that clears into a calm night, and stays calm
weather.cycle = "night_storm_town:4, steady_rain:3, autumn_drizzle:2 blend 60, calm_night"
-- a day that keeps changing, round and round
weather.cycle = "clear_day:6, passing_shower:3, night_storm_town:3, alpine_snow:5"
A forecast starts from its first step each time it is set. Setting preset
ends the forecast and holds that weather; cycle = "" ends it and holds the
weather it had reached. cycleRepeat (auto, once, loop) names the form
outright, and require("@cloudburst::cloudburst.weather").forecast(...) sets
one from code.
With preset set to "", kind (clear, cloudy, drizzle, rain,
downpour, thunderstorm, snow, sleet, hail, wind, fog, mist, ...)
and intensity (0 to 1) pick one directly, and wind (0 to 1) sets the wind on
its own. Cloudburst's README lists every preset with what it looks like.
The clearing answers it: rain darkens and wets the ground, the logs and the
rocks, and rings the pond; snow settles on everything that faces up; the wind
carries the campfire's smoke; storms dim the sun and the sky light, and
lightning flashes with thunder after it; rain, wind and thunder sound with it.
The weather is placed with fog = false, so the fog is the clearing's own and
follows the hour. fog = true hands the fog to the weather, which thickens it
in fog, rain and snow while it runs; fog = false gives the clearing's fog back.
Changing it
build.luau states the whole clearing as code, and scene.json holds the baked
result. The terrain and the scatter come from one seed and the functions at the
top of the file: change SEED for another clearing with the same plan, move
POND, PATH or SPAWN, or edit heightAt for another landform. Each part is
one section of content(); deleting a section removes that part at the next
rebuild.
The hour is a value of the scene setup:
local setup = entity.find("lighting").component.get("SceneSetup")
setup:set("sky/backdrop/timeOfDay", 21) -- night
setup:set("sky/backdrop/autoCycle", false) -- hold the hour
The day runs while the game plays, on the session clock, so every player sees the same hour; it holds still in edit mode. The sun, the moonlight, the ambient light and the fog follow it: after dark the sky turns dark blue with its stars and moon, the ambient light and the fog dim and blue, and the campfire and the lantern light the clearing.
Entry point
entrypoint.luauholds the scene's load and per-frame hooks, all commented out until needed.