Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld 07a07267-3…

Gunplay

<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this component provides and who consumes it, then delete both comment lines. -->

by◐lolboy21·posted 1mo ago
What it does

Gunplay

<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this component provides and who consumes it, then delete both comment lines. -->

TODO: describe this component.

Interface

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

conforms to

zero/source-extract/v2

Gunplay.component — UNBROKEN FRONT's weapon state machine. Sits on `Mount_Gunplay` under the scene's `Systems` entity. It owns every authoritative fact about the weapon in the player's hands: what is equipped, how many rounds are in the magazine, how many in reserve, whether the weapon is mid-reload and which stage of it, whether the sights are up, and where each shot went. It draws every number from `Core.Weapons` — seven firearms, each with its own rate of fire, magazine, reload times, spread, movement penalty and recoil pattern — so a weapon behaves as its definition says and adding an eighth weapon is adding a table entry, not writing code. It renders NOTHING. The view model is posed by OperatorController, which reads the state this writes: `Core.State.ads`, `.reloadStage`, `.recoil`. That split is deliberate — the authoritative weapon state and the first-person presentation of it are different jobs, and the presentation must never be able to change what the ammunition actually is. The reload is a real sequence, not a timer with an ammo assignment at the end of it. `ROUNDS_ENTER` is the moment the fresh magazine is seated, and that is the only line in this file that moves rounds from reserve to magazine. Everything before it is mechanical, and an interrupt before it leaves the magazine exactly as empty as it was.

readInput( ) → void

quatRotate(qx: ?, qy: ?, qz: ?, qw: ?, vx: ?, vy: ?, vz: ?) → void

Small maths the engine does not hand us here Rotate a vector by a quaternion. The engine gives us the camera rig's rotation as a quaternion, and a shot direction has to be built from it.

argtypedescription
qx?
qy?
qz?
qw?
vx?
vy?
vz?

noise( ) → void

Deterministic pseudo-noise in [-1, 1]. The engine has no `Random` global, and a spread that is reproducible is easier to test than one that is not.

weapon( ) → void

ammo( ) → void

reserve( ) → void

setAmmo(n: ?) → void

argtypedescription
n?

setReserve(n: ?) → void

argtypedescription
n?

applyRecoil(w: ?) → void

Recoil is walked from the weapon's own pattern rather than drawn from a random number, so a weapon's climb is learnable and its character is real.

argtypedescription
w?

fireOnce(w: ?) → void

One shot: spend a round, kick the weapon, trace the round, and tell the world what it hit.

argtypedescription
w?

startReload(empty: ?) → void

argtypedescription
empty?

cancelReload(reason: ?) → void

argtypedescription
reason?

switchTo(id: ?) → void

Weapon switching

argtypedescription
id?

stepWeapon(dt: ?) → void

Per-frame

argtypedescription
dt?

stepInput( ) → void

tick(dt: ?) → void

argtypedescription
dt?

fillFromLoadout( ) → void

Lifecycle A fresh combat load. Death and respawn always return a fighting weapon; an empty gun with no reserve is a dead end, and this game will not strand the player in one. Called on spawn and whenever the loadout changes.

awake( ) → void

update(dt: ?) → void

argtypedescription
dt?

editorUpdate(dt: ?) → void

argtypedescription
dt?

onDestroy( ) → void

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

Showing up to 3 levels deep. Open a part to see what it holds further down.

11+items
▣
module · born here
❒asset
# core <!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. --> TODO: describe this module.
▲ 0↑ born
▣
module · born here
❒asset
# input <!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. --> TODO: describe this module.
▲ 0↑ born
backing path · game/gunplay/Gunplay.component

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.