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

dispatch

Who is sent where: the response to a heat level as assignments, not as spawns.

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

dispatch

Who is sent where: the response to a heat level as assignments, not as spawns.

Pure planning over plain tables. The host owns the units (people, cars), the road junctions and the places a
unit may enter the world; dispatch chooses among them.

  local Dispatch = require("~.modules.dispatch")
  local orders = Dispatch.plan(cfg, level, incidentView, units)
  -- units:  { { id, kind = "foot" | "car", x, z, available = true } }
  -- orders: { [id] = { role = "investigate" | "pursue" | "sweep" | "cordon" | "stand", x, z } }
  --         in "reported": the nearest go to the last known position; in "pursuit": every assigned unit
  --         pursues it; in "search": they sweep points spread over the search area. Units beyond the level's
  --         counts are told to stand (return to their beat).
  Dispatch.sweepPoints(x, z, radius, n, turn)       -- n points over a disc, a different spread each `turn`
  Dispatch.cordon(junctions, x, z, radius, n)       -- the n junctions nearest the ring of that radius
  Dispatch.entry(candidates, sx, sz, minDistance, canSee?)  -- where a new unit may appear: far enough, unseen
  Dispatch.wanted(cfg, level)                        -- { foot, cars, cordon, checkpoints } for a level

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

pursuitKit.modules.dispatch — who is sent where: the response to a heat level as assignments, not as spawns. Pure planning over plain tables. The host owns the units (people, cars), the road junctions and the places a unit may enter the world; dispatch chooses among them. local Dispatch = require("~.modules.dispatch") local orders = Dispatch.plan(cfg, level, incidentView, units) -- units: { { id, kind = "foot" | "car", x, z, available = true } } -- orders: { [id] = { role = "investigate" | "pursue" | "sweep" | "cordon" | "stand", x, z } } -- in "reported": the nearest go to the last known position; in "pursuit": every assigned unit -- pursues it; in "search": they sweep points spread over the search area. Units beyond the level's -- counts are told to stand (return to their beat). Dispatch.sweepPoints(x, z, radius, n, turn) -- n points over a disc, a different spread each `turn` Dispatch.cordon(junctions, x, z, radius, n) -- the n junctions nearest the ring of that radius Dispatch.entry(candidates, sx, sz, minDistance, canSee?) -- where a new unit may appear: far enough, unseen Dispatch.wanted(cfg, level) -- { foot, cars, cordon, checkpoints } for a level

dist(ax: number, az: number, bx: number, bz: number) → number

argtypedescription
axnumber
aznumber
bxnumber
bznumber

wanted(cfg: any, level: number) → any

The response a 0-based heat level asks for.

argtypedescription
cfgany
levelnumber

sweepPoints(x: number, z: number, radius: number, n: number, turn: number?) → void

`n` points spread over a disc (a sunflower spread, rotated by `turn` so successive sweeps differ).

argtypedescription
xnumber
znumber
radiusnumber
nnumber
turnnumber?

cordon(junctions: { any }, x: number, z: number, radius: number, n: number) → void

The `n` junctions closest to a ring of `radius` round (x, z): where a cordon closes the roads out. junctions: { { id?, x, z } }. Returns a new array, nearest the ring first.

argtypedescription
junctions{ any }
xnumber
znumber
radiusnumber
nnumber

entry(candidates: { any }, sx: number, sz: number, minDistance: number, canSee: ((any) → void

Choose where a new unit may enter: the candidate nearest the suspect that is at least `minDistance` away and (when `canSee` is given) that the suspect cannot see. Returns the candidate or nil.

argtypedescription
candidates{ any }
sxnumber
sznumber
minDistancenumber
canSee((any

plan(cfg: any, level: number, view: any, units: { any }, turn: number?) → void

Orders for every unit given the heat level and the incident's view (state, lkp, search).

argtypedescription
cfgany
levelnumber
viewany
units{ any }
turnnumber?

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.