Instance

Gamehoster.Instance is the one view of the instance you are in: the shared state of the match, its instance schema fields eased for this frame at the top level, with the raw samples and a persistent bag underneath.

The instance view

MemberHolds
fields each instance schema field, eased for this frame, at the top level (e.g. Gamehoster.Instance.wave, Gamehoster.Instance.rocksLeft).
.currentthe newest authoritative sample, un-interpolated.
.prevthe previous sample.
.datathe instance's front-end persistent bag, kept for the whole match.
var wave = Gamehoster.Instance.wave
var advanced = Gamehoster.Instance.current.wave !== Gamehoster.Instance.prev.wave
if (advanced) Gamehoster.Instance.data.flashUntil = Gamehoster.Frame.time + 0.5
Read the eased wave, and flash when the authoritative wave advances.

The instance bodies

Three client-only bodies sit beside the instance schema and shape the one instance view. Each is optional.

BodyWhen it runsFor
gamehoster-instance-enter.js when you join Seed the instance's .data bag as the instance first comes into view.
gamehoster-instance-smooth.js each frame Shape how a field eases between authoritative samples, or override one outright.
gamehoster-instance-exit.js when the instance leaves your view Tidy up anything the instance's bag held.
Gamehoster.Persist.Set('flashUntil', 0)
Gamehoster.Persist.Set('shake', 0)
An instance enter body: seed the bag with Gamehoster.Persist.Set; the render reads it back as Gamehoster.Instance.data.