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

gunplay

Paint in the air and what it does when it lands: Wren's shots, the Wardens'

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

gunplay

Paint in the air and what it does when it lands: Wren's shots, the Wardens'

greywash coming back, cover on everything paintable, and the marks left behind. WORLD state, shared by every
player: one sky of projectiles, one cover tracker, one splat store, one field of timed effects.

It joins paintKit's arms / ballistics / impact / cover / splats to the game: who fired a shot (so the offence
goes to the right player), which hits are solvent on a painter (so the right player's colour is washed), and
the moments the rest of the game and the host care about, on the hub.

  local Gunplay = require("metropolisGame.logic.gunplay")
  local g = Gunplay.new({ paintCfg = cfg, query = physicsQuery, hub = hub })
  g.cover   g.splats   g.field   g.air          -- paintKit stores (drawn by the host through fx)
  local r = g:fire("p1", arms, { origin, dir, mount, owner = actorId })   -- paintKit arms:fire's result; the shots fly
  g:hostile({ by, arm, from, at, wash, speed, gravity, range, radius, splash })   -- a pursuer's shot (pursuitKit firefight)
  local out = g:step(dt, { [actorId] = playerId })    -- fly everything; resolve what landed
  -- out = { { type = "paint", player, report },       paintKit impact's report for a player's shot (cover, offences ...)
  --         { type = "washed", player, amount, by },  solvent hit a painter
  --         { type = "stripped", x, z, removed } }    solvent on a surface took marks off it
  g:tick(dt)                                           -- cover wipes and returns, effects run out, marks fade
  g:effectOn(id, "slow")   g:slickAt(x, z)             -- queries the host's movers ask each tick
  g:serialise()   g:restore(data)                      -- world splats, persistent cover (lenses, relays), effects

Hub events: "shotsFired" { player, arm, pigment, n, loudness, heard, x, z }, "shotLaunched" { shot } (every
projectile, with its id, start, velocity, gravity and range: enough to replay its flight), "shotEnded" { id, hit }
(hit nil when it was spent), "paintLanded" { player, report },
"coverEffect" { id, kind, part, effect, seconds, by }, "paintedOut" { id, kind, seconds, by }, "coverBack" { id, kind },
"hostileShot" { by, arm, from, at }, "washed" { player, amount, by }, "effectEnded" { id, effect }.

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

metropolisGame.logic.gunplay — paint in the air and what it does when it lands: Wren's shots, the Wardens' greywash coming back, cover on everything paintable, and the marks left behind. WORLD state, shared by every player: one sky of projectiles, one cover tracker, one splat store, one field of timed effects. It joins paintKit's arms / ballistics / impact / cover / splats to the game: who fired a shot (so the offence goes to the right player), which hits are solvent on a painter (so the right player's colour is washed), and the moments the rest of the game and the host care about, on the hub. local Gunplay = require("metropolisGame.logic.gunplay") local g = Gunplay.new({ paintCfg = cfg, query = physicsQuery, hub = hub }) g.cover g.splats g.field g.air -- paintKit stores (drawn by the host through fx) local r = g:fire("p1", arms, { origin, dir, mount, owner = actorId }) -- paintKit arms:fire's result; the shots fly g:hostile({ by, arm, from, at, wash, speed, gravity, range, radius, splash }) -- a pursuer's shot (pursuitKit firefight) local out = g:step(dt, { [actorId] = playerId }) -- fly everything; resolve what landed -- out = { { type = "paint", player, report }, paintKit impact's report for a player's shot (cover, offences ...) -- { type = "washed", player, amount, by }, solvent hit a painter -- { type = "stripped", x, z, removed } } solvent on a surface took marks off it g:tick(dt) -- cover wipes and returns, effects run out, marks fade g:effectOn(id, "slow") g:slickAt(x, z) -- queries the host's movers ask each tick g:serialise() g:restore(data) -- world splats, persistent cover (lenses, relays), effects Hub events: "shotsFired" { player, arm, pigment, n, loudness, heard, x, z }, "shotLaunched" { shot } (every projectile, with its id, start, velocity, gravity and range: enough to replay its flight), "shotEnded" { id, hit } (hit nil when it was spent), "paintLanded" { player, report }, "coverEffect" { id, kind, part, effect, seconds, by }, "paintedOut" { id, kind, seconds, by }, "coverBack" { id, kind }, "hostileShot" { by, arm, from, at }, "washed" { player, amount, by }, "effectEnded" { id, effect }.

new(o: any) → any

argtypedescription
oany

emit(self: any, name: string, payload: any) → void

argtypedescription
selfany
namestring
payloadany

announce(self: any, player: string?, report: any) → void

argtypedescription
selfany
playerstring?
reportany

fire(player: string, arms: any, aim: any) → any

A player fires the arm that is up. `aim.owner` is the firing actor (never hit by its own shots).

argtypedescription
playerstring
armsany
aimany

hostile(e: any) → void

A pursuer's solvent shot (as pursuitKit's firefight makes it) takes to the air.

argtypedescription
eany

step(dt: number, painters: any?) → void

Fly everything for dt and resolve what landed. `painters` maps an actor id to the player it is.

argtypedescription
dtnumber
paintersany?

tick(dt: number) → void

Cover wipes and returns, timed effects run out, fading marks age.

argtypedescription
dtnumber

effectOn(id: string, effect: string) → void

Whether a thing is under a timed effect ("slow", "mark", "blind" ...), and for how long.

argtypedescription
idstring
effectstring

slickAt(x: number, z: number) → string

The id of a slick covering a point of road, or nil.

argtypedescription
xnumber
znumber

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 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.