Flicker
A component script.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2Flicker — drives a sibling Light's intensity (and optionally its colour) with a layered, slightly-irregular oscillation: living fire, a failing bulb, a breathing ember, a pulsing wisp. Attach to an entity that also carries a `@builtin::components.Light` (point or directional). Each frame the light's intensity is pushed around `base` by up to `amount`, at roughly `hz` flickers per second. `chaos` controls how organic it looks — 0 is a clean sine, 1 gutters and stutters. With `colorShift` on, the light tints toward `hot*` at the bright peaks and `dim*` in the dips, so embers visibly cool as they fade. Generic on purpose: nothing about it is Mistwood-specific, so any scene can drop it onto a lamp, torch, monitor, or magic orb. Fields: base number baseline intensity (default 1) amount number peak deviation from base (default 0.4) hz number flicker rate in Hz (default 8) chaos number 0 = smooth sine .. 1 = chaotic guttering (default 0.6) minScale number floor as a fraction of base; the light never drops below base*minScale, so it never fully dies (default 0.12) colorShift bool also drive the light colour between dim* and hot* (default false) hotR/G/B number colour at the bright peak (default warm ember) dimR/G/B number colour at the dim trough (default deep ember) Usage: local fire = entity.spawn("campfire", { temporary = true }) entity(fire).component.add("@builtin::components.Light", { kind = "point", intensity = 3, radius = 9, colorR = 1, colorG = 0.5, colorB = 0.2 }) entity(fire).component.add("mistwood.Flicker", { base = 3, amount = 1.4, hz = 9, chaos = 0.8, colorShift = true })
clamp(v: ?, lo: ?, hi: ?) → void
| arg | type | description |
|---|---|---|
| v | ? | |
| lo | ? | |
| hi | ? |
seedPhase(id: ?) → void
Distinct per-instance phase so a forest of flames never beats in unison.
| arg | type | description |
|---|---|---|
| id | ? |
wave(p: ?, chaos: ?) → void
Layered incommensurate sines -> organic flicker in [-1, 1].
| arg | type | description |
|---|---|---|
| p | ? | |
| chaos | ? |
findLight( ) → void
awake( ) → void
update(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ 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".
Scoped to this part · feeds back into the world's score.