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

arms

Paint arms: weapons that fire pigment out of the same tins the murals use.

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

arms

Paint arms: weapons that fire pigment out of the same tins the murals use.

An arm is data (cfg.arms[name], see modules/config): how many projectiles a shot throws and how they scatter,
how fast and far they fly, what a hit adds, how many shots a tin gives, how loud it is. This module is the
hands: which arms are owned, which is up, the cadence between shots, the paint each shot costs. It builds the
projectiles of a shot (origin and velocity, scatter from a seeded generator) and hands them back; flight and
hits are modules/ballistics, what a hit does is modules/impact.

  local Arms = require("~.modules.arms")
  local arms = Arms.new(cfg, supply, { arms = { "pistol" }, rng = rng })   -- rng() -> [0, 1), seeded by the host
  arms:own("lob")   arms:owns("lob")   arms:select("lob")   arms:cycle(1)   arms.arm
  arms:selectPigment("ochre")   arms:cyclePigment(1)   arms.pigment
  arms:tick(dt)                               -- cools the cadence
  local r = arms:fire({ origin = { x, y, z }, dir = { x, y, z }, mount = nil, owner = "player" })
  -- { ok = false, reason = "no arm" | "cooling" | "empty" | "no pigment" | "not mounted" | "blocked" }
  -- { ok = true, arm, pigment, used = tins, loudness, heard,
  --   shots = { { arm, pigment, owner, x, y, z, vx, vy, vz, gravity, range, radius, cover, splash } },   pellet / lob / stream
  --   cone = { arm, pigment, owner, x, y, z, dx, dy, dz, range, halfAngle, cover, radius } }              cone (cover = this pulse's)
  arms:block("washed")   arms:block(nil)      -- the host forbids firing (and why); nil lifts it
  arms:ammo()            -- { shots, tins, pigment } with the pigment that is up
  arms:view()            -- { { id, mode, selected, shots, perTin, cooling (0..1), mount, usable, reason } } for a wheel
  arms:serialise()   arms:restore(data)       -- owned arms and what is selected

A stream or cone arm is fired every tick while the trigger is held: `fire` answers "cooling" between pulses, so
the caller needs no cadence of its own. A shot costs 1 / shotsPerTin of a tin of the pigment that is up; when
less than a shot is left of it the arm falls to another pigment the supply still holds.

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.arms — paint arms: weapons that fire pigment out of the same tins the murals use. An arm is data (cfg.arms[name], see modules/config): how many projectiles a shot throws and how they scatter, how fast and far they fly, what a hit adds, how many shots a tin gives, how loud it is. This module is the hands: which arms are owned, which is up, the cadence between shots, the paint each shot costs. It builds the projectiles of a shot (origin and velocity, scatter from a seeded generator) and hands them back; flight and hits are modules/ballistics, what a hit does is modules/impact. local Arms = require("~.modules.arms") local arms = Arms.new(cfg, supply, { arms = { "pistol" }, rng = rng }) -- rng() -> [0, 1), seeded by the host arms:own("lob") arms:owns("lob") arms:select("lob") arms:cycle(1) arms.arm arms:selectPigment("ochre") arms:cyclePigment(1) arms.pigment arms:tick(dt) -- cools the cadence local r = arms:fire({ origin = { x, y, z }, dir = { x, y, z }, mount = nil, owner = "player" }) -- { ok = false, reason = "no arm" | "cooling" | "empty" | "no pigment" | "not mounted" | "blocked" } -- { ok = true, arm, pigment, used = tins, loudness, heard, -- shots = { { arm, pigment, owner, x, y, z, vx, vy, vz, gravity, range, radius, cover, splash } }, pellet / lob / stream -- cone = { arm, pigment, owner, x, y, z, dx, dy, dz, range, halfAngle, cover, radius } } cone (cover = this pulse's) arms:block("washed") arms:block(nil) -- the host forbids firing (and why); nil lifts it arms:ammo() -- { shots, tins, pigment } with the pigment that is up arms:view() -- { { id, mode, selected, shots, perTin, cooling (0..1), mount, usable, reason } } for a wheel arms:serialise() arms:restore(data) -- owned arms and what is selected A stream or cone arm is fired every tick while the trigger is held: `fire` answers "cooling" between pulses, so the caller needs no cadence of its own. A shot costs 1 / shotsPerTin of a tin of the pigment that is up; when less than a shot is left of it the arm falls to another pigment the supply still holds.

new(cfg: any, supply: any, opts: any?) → any

New hands over a supply. opts = { arms = { name, ... }?, rng = function?, mounts = { [mount] = true }? }.

argtypedescription
cfgany
supplyany
optsany?

own(name: string) → boolean

Add an arm. The first arm owned is selected. Returns false for a name the config does not have.

argtypedescription
namestring

owns(name: string) → boolean

argtypedescription
namestring

disown(name: string) → boolean

Take an arm away (confiscated). Selection falls to the first arm left.

argtypedescription
namestring

select(name: string) → boolean

argtypedescription
namestring

cycle(list: { string }, current: string?, step: number) → string

argtypedescription
list{ string }
currentstring?
stepnumber

cycle(step: number) → string

Step to the next (1) or previous (-1) owned arm. Returns its name.

argtypedescription
stepnumber

selectPigment(name: string) → boolean

argtypedescription
namestring

cyclePigment(step: number) → string

argtypedescription
stepnumber

block(reason: string?) → void

Forbid firing for a reason the host names (washed out, holstered, in a cutscene); nil lifts it.

argtypedescription
reasonstring?

tick(dt: number) → void

argtypedescription
dtnumber

cost(a: any) → number

argtypedescription
aany

loaded(self: any, need: number) → string

the pigment that is up, falling to another the supply still has a shot of

argtypedescription
selfany
neednumber

basis(dx: number, dy: number, dz: number) → void

two unit vectors square to d (and to each other)

argtypedescription
dxnumber
dynumber
dznumber

scatter(dx: number, dy: number, dz: number, spread: number, u1: number, u2: number) → void

A direction scattered inside a cone of `spread` degrees half-angle round (dx, dy, dz), evenly over its disc. `u1`, `u2` are two numbers in [0, 1). Exposed for tests and for anything else that needs the same scatter.

argtypedescription
dxnumber
dynumber
dznumber
spreadnumber
u1number
u2number

canFire(aim: any?) → void

Whether the arm that is up could fire now, and why not.

argtypedescription
aimany?

fire(aim: any) → any

Fire the arm that is up. See the header for `aim` and the result.

argtypedescription
aimany

ammo( ) → any

Shots left with the pigment that is up (whole shots; seconds for a stream or cone), its tins and its name.

view(aim: any?) → void

Every owned arm for a selector: { { id, mode, selected, shots, perTin, cooling, mount, usable, reason } }.

argtypedescription
aimany?

serialise( ) → any

restore(data: any) → void

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.