Function: onLabelStarting()
> onLabelStarting(value): void
Defined in: src/index.ts:432
Is a function that will be executed every time a label is about to be started, either via
narration.call, narration.jump, or a choice of type "call" / "jump".
By default (when this is not set), the label starts immediately, exactly like before this hook
existed. If you set it, you take control: call defaultStart() yourself whenever you actually
want the label to run — right away, or later (e.g. on a subsequent player action in your
template). Until defaultStart() is called, nothing about the label happens: it is not added to
the history and no step of it runs.
Parameters
value
(labelId, props, options, defaultStart) => StepLabelResultType | Promise<StepLabelResultType>
Returns
void
Example
Game.onLabelStarting((labelId, props, options, defaultStart) => {
pendingLabelStart = defaultStart; // keep it for later, don't run it now
})