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

supply

Paint you can carry: tins by pigment, a capacity, a limit on pigments loaded at once.

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

supply

Paint you can carry: tins by pigment, a capacity, a limit on pigments loaded at once.

The same object is a satchel, a vehicle's shelf, a stash in a doorway or a shop's stock; only the numbers differ.
Tins are fractional while in use (a stream draws 0.02 of a tin a frame) and whole when counted for a player.

  local Supply = require("~.modules.supply")
  local bag = Supply.new({ capacity = 12, slots = 3 })      -- slots: how many different pigments at once (nil = any)
  bag:add("ochre", 6)            -- returns how many were accepted (capacity and slots are respected)
  bag:take("ochre", 0.25)        -- returns how much was really taken
  bag:count("ochre")   bag:total()   bag:room()   bag:pigments()   -- pigments: names with paint, sorted
  bag:transfer(van, "ochre", 4)  -- returns how many moved (limited by what is here and the room there)
  local taken = bag:empty()      -- { ochre = 5.5, ... } and the bag is empty (a confiscation)
  bag:setLimits({ capacity = 20 })
  local data = bag:serialise()   Supply.restore(data)        -- plain tables for a save

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.supply — paint you can carry: tins by pigment, a capacity, a limit on pigments loaded at once. The same object is a satchel, a vehicle's shelf, a stash in a doorway or a shop's stock; only the numbers differ. Tins are fractional while in use (a stream draws 0.02 of a tin a frame) and whole when counted for a player. local Supply = require("~.modules.supply") local bag = Supply.new({ capacity = 12, slots = 3 }) -- slots: how many different pigments at once (nil = any) bag:add("ochre", 6) -- returns how many were accepted (capacity and slots are respected) bag:take("ochre", 0.25) -- returns how much was really taken bag:count("ochre") bag:total() bag:room() bag:pigments() -- pigments: names with paint, sorted bag:transfer(van, "ochre", 4) -- returns how many moved (limited by what is here and the room there) local taken = bag:empty() -- { ochre = 5.5, ... } and the bag is empty (a confiscation) bag:setLimits({ capacity = 20 }) local data = bag:serialise() Supply.restore(data) -- plain tables for a save

new(opts: any) → any

A new, empty supply. opts = { capacity, slots? }.

argtypedescription
optsany

count(pigment: string) → number

argtypedescription
pigmentstring

total( ) → number

room( ) → number

pigments( ) → void

The pigments that have paint, in name order.

add(pigment: string, tins: number) → number

Add tins of a pigment. Returns how many were accepted.

argtypedescription
pigmentstring
tinsnumber

take(pigment: string, tins: number) → number

Use paint. Returns how much was really taken (less than asked when it runs out).

argtypedescription
pigmentstring
tinsnumber

transfer(to: any, pigment: string, tins: number) → number

Move tins of a pigment into another supply. Returns how many moved.

argtypedescription
toany
pigmentstring
tinsnumber

empty( ) → void

Remove everything. Returns what was removed as { pigment = tins }.

setLimits(opts: any) → void

argtypedescription
optsany

serialise( ) → any

restore(data: any) → any

argtypedescription
dataany

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.