config.module
README.md
config
The whole kit's behaviour as one data table.
Nothing in pursuitKit holds a number of its own: observers, what counts as an offence, how heat becomes levels,
how long a search lasts, how an arrest is staged, how fast a pursuer runs, are all read from a config the game
passes in. `Config.DEFAULTS` is a complete, neutral starting point; a game overrides what it needs:
local Config = require("~.modules.config")
local cfg = Config.merge(Config.DEFAULTS, { heat = { max = 150 }, observers = { guard = { halfAngle = 70 } } })
local ok, problems = Config.validate(cfg)
Schema (every key is read by the module named in brackets):
observers[kind] [perception, awareness]
range = { day, night } metres at full light and in the dark (light 0..1 blends between them)
halfAngle degrees either side of where it faces
nearRange metres within which it notices whatever way it faces (0 for none)
fill, minFill, drain awareness per second at point-blank, the least while in view, and lost unseen
suspiciousAt, alertAt awareness thresholds (0..1)
onAlert "pursue" | "report" | "cheer" | "none"
report = { delay, via } for onAlert = "report": seconds to make it, and via "direct" | "relay" (a relay,
such as a call box, can be jammed by the host cancelling the report)
pursuer true when this kind can chase and grab
vertical = { up, down } degrees above and below level it can look (nil: any)
faction the name of the body it belongs to (carried on arrest events)
sequence the arrest sequence its grab starts (cfg.arrest.sequences[name]; nil: the main one)
acts[name] = { loudness, illegal } what the suspect is doing; loudness scales fill [perception]
concealment[tag] = factor multiplies fill; several tags multiply together [perception]
described = { fillFactor } fill multiplier while the suspect matches a whole description; a part
match scales toward it [perception]
known = { fillFactor } fill multiplier for an observer that knows the suspect's face [perception]
noise = { awareness } the awareness an observer in earshot of a noise rises to [director]
frame = { right } the sign of x on the right of someone facing +z: -1 in the engine's
frame (x east, z south, y up), +1 where z points north [pursuer, vehiclePursuit]
strikes = { fillPerStrike, max } standing record: each strike adds this share to fill [perception]
heat = { max, levels = { { at, name } }, offences[name] = points,
pursuitTick = { every, points }, decay = { grace, perSecond }, escape = { factor } } [heat]
incident = { noticeAt, clearBelow, reportedTimeout, loseSight, escapedHold,
search = { base, perLevel, radius, grow, radiusMax = { base, perLevel }, outsideRate, hiddenRate } }
grab = { range, windup, escapeDistance, recovery, vehicle = { speedBelow, within, hold } } [grab]
arrest = { stages = { { name, duration, breakable?, breakHold?, skippableAfter?, control? } }, breakOffence,
sequences[name] = { stages, breakOffence?, outcome?, handover = { atLevel }? } } [arrest, director]
response[level + 1] = { foot, cars, cordon, checkpoints, searchFactor } [dispatch]
pursuer = { foot = { patrol, investigate, chase, tired, stamina, recover, arrive, leash? },
car = { street, avenue, arrive, wheels = true }, <any other profile>, minSpawnDistance } [pursuer, dispatch]
firefight, roadblocks, vehiclePursuit, theft, roster, record, party: see the header of the module of that name
The interface is documented in the header of init.luau; this file repeats it for the asset browser.