Log inGet started
World

Verdigris Cloister

Branchmain
Branchesmain
Commit65770846aa

README.md

Screens

The campaign's front of house: the title screen, the mission briefing, the between-mission seed catalogue, the botanical herbarium codex, and the two end cards — plus the progression that strings them into a campaign of four rooms.

One instance, on a root entity named Screens. It registers a single screen, vc_campaign, and re-registers it whenever the page changes.

local s = entity.find("Screens").component.get("Screens")
s.show("codex")          -- title | briefing | catalogue | codex | ending | playing
s.currentPage()          -- the page on the glass
s.isModal()              -- true whenever a page is covering the game
s.finishMission("won", "The hall held.", units)   -- units is Core.state().units shape
s.refreshVoice()         -- re-check whether this page's line has a clip, and redraw

Methods are dot-called, not colon-called: s.show("codex"), not s:show("codex").

The campaign it drives

game.campaign owns the data: the four rooms, the wound table, the run, and Campaign.settle(), which turns a finished mission's unit table into wounds and deaths. The run lives at Core.state().campaign, so any slice can read it.

The flow:

title ──Take up the tools──> briefing ──Go in──> playing
                                ^                   │
                                │            missionEnded
                                │                   v
                          catalogue <───────── (won, more rooms)
                                                    │
                                              (lost, or the last room)
                                                    v
                                                 ending

playing is not a page — it takes the screens down and hands the frame to the board. The component leaves it when the rules slice fires missionEnded, or when the Director's snapshot() grows an outcome (polled at 0.75 s while a mission runs; it only reads, so it is not a clock).

What it consumes

FromHowDegrades to
rulesDirector:startMission(missionId, { squad, mission })the mission starts anyway, board only
rulesCore.SIGNAL.missionEnded { outcome, reason }finishMission(...) called by hand
rulesDirector:snapshot() → .outcome, .unitsno wounds recorded, campaign still advances
audiogame.audio.lines' NARRATION[key].textthe abbot's own written briefing is printed instead
audioConductor:narrate(key) on Ambiencethe line is printed and marked TEXT ONLY
hudgame.ui.hud.hud's SCREENS mapnothing; the hud stays up over the page

The narration keys are the audio slice's: title, brief_<missionId>, victory, defeat. Whatever is spoken is printed word for word — the page renders the audio slice's .text, so a muted player reads exactly what a listening one hears, and a line that failed to generate is a quiet line rather than a lost one. The mark beside it reads SPOKEN when a clip exists and TEXT ONLY when it does not; clicking it replays the line.

What it publishes

SignalPayloadMeaning
screens:modal{ open, page }a full-screen page is up (or has come down)
screens:missionStart{ mission, squad }the player pressed "Go in"
screens:narrate{ id, key, text, voice, mission }this line wants speaking

It also emits Core.SIGNAL.playSfx (ui_click, ui_confirm, ui_back) and Core.SIGNAL.playMusic (title, briefing, mission, victory, defeat).

Two things about the frame

The hud is hidden while a page is up. Its screens are rooted in area nodes, and an area is a floating window, so it draws above any ordinary screen at any layer — a modal page at layer 8000 still has the initiative queue sitting on top of it. screens:modal is published for whoever would rather listen than be hidden, and the stand-down is re-asserted four times a second so a hud hot-reload cannot put the queue back over a title screen.

Motion is off in edit mode. Edit pauses time, so an entrance animation whose first keyframe is opacity: 0 would hold that frame forever and the page would read as blank while every data query said it was there. kit.setMotion() is the switch; the component flips it on every render.

Keeping the entity

Screens is a root entity spawned at runtime, not part of main.scene's build.luau (which the plan phase owns). It replicates as a WorldEntity, so it is live for every session in this world, but it is a pending scene change until someone accepts it. /source/game/ui/screens/install.luau re-creates it idempotently if it ever goes missing:

run /source/game/ui/screens/install.luau