Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld 07158574-5…

systemSettings

Which of several components stating one scene-wide system's settings is in force. A scene-wide system (screen-space reflections, ambient occlusion, depth of field, fog, exposure, environment lighting, weather, ...) runs under one set of settings, and more than one component insta…

by◐lumi·posted 1mo ago
What it does

systemSettings

Which of several components stating one scene-wide system's settings is in force. A scene-wide system (screen-space reflections, ambient occlusion, depth of field, fog, exposure, environment lighting, weather, ...) runs under one set of settings, and more than one component instance can state them at once: two hosts in one scene, an instance and the one replacing it while a script reloads, or the instances a scene module's builder makes while it records a rebuild beside the ones its last build placed.

Each component instance takes a claim on the system and states its settings through it every frame:

local Ssr = require("@builtin::systems.reflections.ssr")
local systemSettings = require("@builtin::modules.systemSettings")

local claim = systemSettings.claim("@builtin::systems.reflections.ssr", {
    push = Ssr.set,       -- puts the settings in force
    release = Ssr.clear,  -- takes the system down
    live = Ssr.active,    -- whether the system is up
})

function update(_dt)
    claim:state(signatureOf(opts()), opts())
end

function onDestroy()
    claim:release()
end

What is in force

The claims on one system are kept in the order they last stated something new, and the newest is in force.

  • A claim whose settings changed moves to the newest place and pushes them: the last component edited wins.
  • A claim that joins stating exactly what is in force takes the newest place and pushes nothing.
  • Releasing a claim while others are live hands the system to the newest of them, which pushes its own settings when they differ. Only the last claim released takes the system down.
  • The claim in force pushes again when the system it brought up is no longer up (a script's clear(), a feature torn down from outside), so a component standing in the scene keeps its system running. A push that left the system down, such as a setting that turns it off, is not repeated.

Exports

  • systemSettings.claim(key, spec) -> Claim: a claim on the system named key (the path of the module that drives it). spec.push(opts) puts settings in force, spec.release() takes the system down, and the optional spec.live() says whether it is up.
  • claim:state(sig, opts): state the settings for this frame. sig is a string that differs whenever opts does.
  • claim:release(): let the system go, from onDestroy.
  • claim:inForce() -> boolean: whether this claim's settings are in force.
  • systemSettings.count(key) -> number: how many live claims state the system.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

module systemSettings Which of several components stating one scene-wide system's settings is in force, so a component going away never takes down a system another live component still states. require @builtin::modules.systemSettings

registryFor(key: string) → Registry

argtypedescription
keystring

indexOf(list: { any }, item: any) → number

argtypedescription
list{ any }
itemany

pushNow(reg: Registry, claim: any) → void

argtypedescription
regRegistry
claimany

state(self: any, sig: string, opts: any) → void

State this claim's settings for the frame. Call it every frame the component runs; it pushes only when this claim is in force and the settings changed, or the system it brought up is no longer up.

argtypedescription
selfany
sigstringA string that differs whenever `opts` differs.
optsanyThe settings, handed to the spec's `push` when they are pushed.

release(self: any) → void

Let the system go; call it from the component's `onDestroy`. The newest other live claim on the system takes over, and the system is taken down only when this was the last one.

argtypedescription
selfany

inForce(self: any) → boolean

Whether this claim's settings are the ones in force.

argtypedescription
selfany

claim(key: string, spec: ClaimSpec) → Claim

A claim on the scene-wide system named `key`. Every claim made with the same key shares one registry, so a component makes one per instance, at the top of its script, keyed by the path of the module that drives the system.

argtypedescription
keystringThe system's name: the path of the module that drives it.
specClaimSpecHow to put settings in force, take the system down and read whether it is up.

examples

local claim = systemSettings.claim("@builtin::systems.reflections.ssr", { push = Ssr.set, release = Ssr.clear, live = Ssr.active })

count(key: string) → number

How many live claims state the system named `key`.

argtypedescription
keystringThe system's name, as given to `claim`.
⌬ Types
ClaimSpec = {Claim = {

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.