Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

grantPredicted

grantPredicted<S>(step, character, trait, value): void

Sets character’s predicted trait from the room, adding it where she lacks it: a one-off change a rule on the room makes, such as a pickup that refills her dash’s charges. Her page learns of it as one correction a trip later, and the prediction checks count it as the grant it is. A lasting effect, such as a slow, belongs in a streamed trait a predicted system reads on every step instead, which her page replays. Call it in the system step runs, inside if (step.authoritative) where the system runs on her page too. As Unreal’s server-side change of a predicted value, which reaches the owner as a correction.

Type Parameter
S extends Schema
Parameter Type
step AuthoritativeStep
character Entity
trait PredictedTrait<S>
value TraitValue<S> | ((previous) => TraitValue<S>)

void