VagantBody
The vagant — the thing the player IS. It sits on the `Vagant` PlayerPrototype's `body` entity, so the engine clones one per joining player, and every vagant on the fen is driven by its own copy.
VagantBody
The vagant — the thing the player IS. It sits on the Vagant PlayerPrototype's
body entity, so the engine clones one per joining player, and every vagant on
the fen is driven by its own copy.
On awake it takes the stand-in avatar back off, builds the figure out of
vagant.rig over vagant.parts — coat, wraps, boots, satchel, the broad hat,
the lantern and the jasey — and poses it. Every frame after that it measures how
fast its own entity is travelling, turns that into a gait, and hands the whole
of what the vagant is doing to vagant.anim, which writes every joint.
It also owns the lantern: the point light the player sees the fen by, the flame
that gutters as the oil runs out, the glass that goes dead when the flame does,
and the way all three are smothered to fl.TUNE.WIG_LIGHT_SCALE while the wig
is down. And it makes the noise a body makes — footfalls on grass, on mud, in
water, and the splash going in and coming out.
It READS fl.state and never writes it.
Public fields
netWig: boolean— the wig is down. Written by the owning client, read by every peer.netWet: number— how soaked the wig is, 0..1, quantised to twentieths.netLit: boolean— the lantern is burning.netOil: number— what is left in it, 0..1, quantised to twenty-fifths.netWade: number— 1 while standing in a cut.netReach: number— 1 while a relight is being held.netCaught: boolean— the fen has you.lanternIntensity: number— the point light's intensity at a full lantern (default 6.0). The single biggest lever on how the game looks: high enough that the reeds a few metres out are legible, low enough that the coat half a metre from the flame stays wool rather than going to white.lanternRadius: number— its radius in metres at a full lantern (default 24).gameMap: AssetRef<inputMap>— the game's control scheme (vagant). Used only to know when a relight is being HELD, so the vagant reaches for the lamp instead of standing beside it — from a key, a pad button or a thumb alike.
The seven net* fields exist because fl.state is the LOCAL client's night.
The owning peer copies what a remote peer cannot see into them, on change only,
and every peer poses from them — so another player's vagant is hooded and
guttering on your screen too.
Lifecycle
awake()— drops the stand-in avatar, builds the rig, subscribes torelightand to thecaughtsignal.start()— re-checks whether this body is the local player's, and rebuilds ifawakeran before the scene could answer.update(dt)— measures speed, blends every state, poses the rig, drives the lantern and the wig, fires footfalls.editorUpdate(dt)— the same, guarded onengine.paused, so the figure stands, breathes and holds a burning lantern in edit mode too.onDestroy()— releases the input map and despawns the rig's root, which cascades the whole body.
Usage
The scene already carries it. To retune the light on a live body:
local body = layers.active.players.localPlayer.avatar.component.get("VagantBody")
body.lanternIntensity = 8.0
Scoped to this part · feeds back into the world's score.