areas
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
areas
<!-- 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/v2areas — every region of Lumenvale lives in the one scene at its own world offset; this module moves Amelia between them, keeps her inside each one, stops her walking through buildings, applies each area's light and ambient life, and rolls random encounters in the wild. local Areas = require("game.world.areas") Areas.register("murmurwood", { name = "The Murmurwood", -- shown on the area title card origin = { -400, 0, 0 }, -- world offset; everything below is relative bounds = { -20, -12, 20, 10 }, -- minX, minZ, maxX, maxZ Amelia may walk in spawns = { fromEmberbrook = { 18, 2 }, start = { 0, 0 } }, exits = { { x = 20, z = 2, radius = 1.6, to = "emberbrook", spawn = "fromMurmurwood" } }, blockers = { { -3, -9, 3, -6 } }, -- rects (x1, z1, x2, z2) she can't walk into atmosphere = "forest", -- game.fx.atmosphere preset (particles, shafts) look = function() ... end, -- tune Sun / Ambient / Sky / fog by name on entry encounters = { rate = 0.06, pools = { { "bramblewisp", "mossback" } } }, -- per metre walked music = "murmurwood", -- forwarded on the "areaEntered" event for audio }) Areas.travel("murmurwood", "fromEmberbrook") Before every area's `look` runs, the scene's authored (Emberbrook golden) lighting is restored, so a look only states what differs. Events (game.world.events): "areaLeaving"(fromId), "areaEntered"(id, def), "encounter"(pool). Fades go through Areas.setFader(fn(toBlack, seconds)), which the UI registers; without one, travel is a cut.
copy(v: any) → any
| arg | type | description |
|---|---|---|
| v | any |
snapshotLook( ) → void
restoreLook( ) → void
register(id: string, def: any) → void
| arg | type | description |
|---|---|---|
| id | string | |
| def | any |
get(id: string) → any
| arg | type | description |
|---|---|---|
| id | string |
current( ) → string
all( ) → void
setFader(fn: ((boolean, number) → void
| arg | type | description |
|---|---|---|
| fn | ((boolean, number |
toWorld(id: string, x: number, z: number) → void
| arg | type | description |
|---|---|---|
| id | string | |
| x | number | |
| z | number |
blocked(x: number, z: number) → boolean
Is the world point (x, z) inside one of the current area's blockers?
| arg | type | description |
|---|---|---|
| x | number | |
| z | number |
amelia( ) → any
applyArea(id: string, spawn: string?) → void
| arg | type | description |
|---|---|---|
| id | string | |
| spawn | string? |
travel(id: string, spawn: string?) → boolean
Move Amelia to another area (fade out, place, fade in). Returns false if busy.
| arg | type | description |
|---|---|---|
| id | string | |
| spawn | string? |
enter(id: string, spawn: string?) → void
Enter an area without a fade (game start / load).
| arg | type | description |
|---|---|---|
| id | string | |
| spawn | string? |
isBusy( ) → boolean
grace(seconds: number) → void
Suppress encounters for a while (after a battle, a cutscene, a menu).
| arg | type | description |
|---|---|---|
| seconds | number |
update(dt: number, canAct: boolean) → void
Per-frame: exits + random encounters. `canAct` is false while a dialogue, battle or menu has the player.
| arg | type | description |
|---|---|---|
| dt | number | |
| canAct | boolean |
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.
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.