Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofpackage paintKit.package·originates fromworld 0a0b119f-a…

surfaces

What paint does to the thing it lands on, and for how long.

byzero-proxy @ DESKTOP-DB3UJOJ·posted 11d ago
What it does

surfaces

What paint does to the thing it lands on, and for how long.

Paint on a wall is a mark. Paint on a lens, a windscreen, a road or a person may be an effect with a duration.
Which is data: cfg.surfaces[kind][tool] (or [kind].any) = { effect, seconds?, radius?, offence? }. This module
looks the rule up and keeps the timed effects that are running, including ones that cover an area.

  local Surfaces = require("~.modules.surfaces")
  local rule = Surfaces.rule(cfg.surfaces, "lens", "spray")   -- { effect = "blind", ... } or nil
  local field = Surfaces.field()
  field:apply("cam12", rule)                    -- start (or restart) a timed effect on a thing
  field:applyAt("slick7", rule, x, z)           -- an effect that covers rule.radius round a point
  field:has("cam12", "blind")   field:left("cam12", "blind")   -- seconds left (0 when not active)
  field:at(x, z, "slick")                       -- the id of an area effect covering that point, or nil
  field:clear("cam12", "blind")                 -- repaired / cleaned (returns true if it was active)
  local ended = field:tick(dt)                  -- { { id, effect } } that ran out this tick
  field:serialise()   Surfaces.restore(data)

An effect with no `seconds` lasts until cleared.

The interface is documented in the header of init.luau; this file repeats it for the asset browser.

Interface

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

conforms to

zero/source-extract/v2

paintKit.modules.surfaces — what paint does to the thing it lands on, and for how long. Paint on a wall is a mark. Paint on a lens, a windscreen, a road or a person may be an effect with a duration. Which is data: cfg.surfaces[kind][tool] (or [kind].any) = { effect, seconds?, radius?, offence? }. This module looks the rule up and keeps the timed effects that are running, including ones that cover an area. local Surfaces = require("~.modules.surfaces") local rule = Surfaces.rule(cfg.surfaces, "lens", "spray") -- { effect = "blind", ... } or nil local field = Surfaces.field() field:apply("cam12", rule) -- start (or restart) a timed effect on a thing field:applyAt("slick7", rule, x, z) -- an effect that covers rule.radius round a point field:has("cam12", "blind") field:left("cam12", "blind") -- seconds left (0 when not active) field:at(x, z, "slick") -- the id of an area effect covering that point, or nil field:clear("cam12", "blind") -- repaired / cleaned (returns true if it was active) local ended = field:tick(dt) -- { { id, effect } } that ran out this tick field:serialise() Surfaces.restore(data) An effect with no `seconds` lasts until cleared.

rule(table_: any, kind: string, tool: string?) → any

The rule for a tool on a kind of surface: the tool's own, else the kind's `any`, else nil.

argtypedescription
table_any
kindstring
toolstring?

field( ) → any

slot(id: string, effect: string) → string

argtypedescription
idstring
effectstring

apply(id: string, rule: any) → boolean

Start or restart a rule's effect on a thing. Returns false when the rule has no effect to time.

argtypedescription
idstring
ruleany

applyAt(id: string, rule: any, x: number, z: number) → boolean

Start an area effect round a point.

argtypedescription
idstring
ruleany
xnumber
znumber

has(id: string, effect: string) → boolean

argtypedescription
idstring
effectstring

left(id: string, effect: string) → number

Seconds left of an effect (0 when inactive, math.huge when it lasts until cleared).

argtypedescription
idstring
effectstring

clear(id: string, effect: string) → boolean

argtypedescription
idstring
effectstring

at(x: number, z: number, effect: string) → string

The id of an area effect of this kind covering (x, z), or nil. With several, the one with the lowest id.

argtypedescription
xnumber
znumber
effectstring

tick(dt: number) → void

Count down. Returns the effects that ended, in id order.

argtypedescription
dtnumber

serialise( ) → void

restore(rows: { any }) → any

argtypedescription
rows{ any }

Problems

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

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬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.