fx
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
fx
<!-- 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.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2game.fx.fx — everything a shot looks like. Subscribes to `Core.Ev.SHOT` and `Core.Ev.IMPACT` and turns each into geometry: a flash at the weapon's muzzle, a tracer along the round's path, a casing out of the ejection port, and an impact at the point the round actually struck. WHERE each effect appears is not decided here. The muzzle and ejection-port positions are published by the component that owns the weapon model, and the impact point comes off the raycast that hit it. Nothing in this file guesses a screen position, which is what separates a shot that reads as coming from the weapon from one that reads as a decal on the lens. EVERYTHING IS POOLED. Sustained automatic fire is the case that breaks naive effects: at 900 rounds a minute a fresh entity per shot is fifteen a second per effect, and a few seconds of fire leaves hundreds of live objects along with the frame cost of creating and destroying them. Each effect type owns a fixed pool created once, and a shot takes the next free slot — so the cost of a burst is the same as the cost of one shot.
mats( ) → void
Materials
quatFromZ(nx: ?, ny: ?, nz: ?) → void
Math A quaternion taking +Z onto `n`, so a flat card can be laid against a surface by its normal.
| arg | type | description |
|---|---|---|
| nx | ? | |
| ny | ? | |
| nz | ? |
noise( ) → void
makePool(root: ?, name: ?, count: ?, material: ?, size: ?, blend: ?) → void
Pools One pooled effect type. `spawn` makes an inactive entity; `wake` places it and gives it a life.
| arg | type | description |
|---|---|---|
| root | ? | |
| name | ? | |
| count | ? | |
| material | ? | |
| size | ? | |
| blend | ? |
take(pool: ?) → void
Take the next slot, stealing the oldest if every slot is busy. Stealing is deliberate: under sustained fire the alternative is dropping effects, and a missing tracer is more visible than a recycled one.
| arg | type | description |
|---|---|---|
| pool | ? |
show(it: ?, pos: ?, scale: ?, rot: ?, material: ?) → void
| arg | type | description |
|---|---|---|
| it | ? | |
| pos | ? | |
| scale | ? | |
| rot | ? | |
| material | ? |
hide(it: ?) → void
| arg | type | description |
|---|---|---|
| it | ? |
build(root: ?) → void
Building
| arg | type | description |
|---|---|---|
| root | ? |
clear( ) → void
flashAt(pos: ?) → void
A shot
| arg | type | description |
|---|---|---|
| pos | ? |
tracerFromTo(a: ?, b: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? |
casingFrom(pos: ?, dir: ?) → void
A casing leaves the ejection port on the weapon's right, at a right angle to the bore and slightly up — the direction an ejected case actually goes.
| arg | type | description |
|---|---|---|
| pos | ? | |
| dir | ? |
onShot(shot: ?) → void
| arg | type | description |
|---|---|---|
| shot | ? |
surfaceOf(entityId: ?) → void
An impact Which of the district's own materials a struck surface wears. Concrete and brick throw dust; steel throws sparks; timber throws dust and splinters. Read off the entity's Model rather than guessed from the impact angle.
| arg | type | description |
|---|---|---|
| entityId | ? |
impactCard(point: ?, normal: ?) → void
| arg | type | description |
|---|---|---|
| point | ? | |
| normal | ? |
burst(point: ?, normal: ?, kind: ?) → void
| arg | type | description |
|---|---|---|
| point | ? | |
| normal | ? | |
| kind | ? |
onImpact(impact: ?) → void
| arg | type | description |
|---|---|---|
| impact | ? |
stepItem(it: ?, pool: ?, dt: ?, gravity: ?, collide: ?) → void
Per frame
| arg | type | description |
|---|---|---|
| it | ? | |
| pool | ? | |
| dt | ? | |
| gravity | ? | |
| collide | ? |
update(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ 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".
Scoped to this part · feeds back into the world's score.