Once
Returns the given value on the first call for a slot, then the empty string on every subsequent call.
Category: Sequence
Returns: any (accepts any type, but the value returned is always a string)
Signature
Once(slotKey, value)
The first argument is a slot name. The second is the value to return once.
Examples
Once("first_meeting", "I've never seen anyone like you.")
// delivers the line only the first time
"You're back. " + Once("bench_note", "There's a carving on the bench you didn't notice before.")
// appends the extra detail only on the first visit
Notes
Once is useful for one-time flavor text (a character’s first-meeting line, a location’s initial description) that plays once and never repeats within the run.
Whatever type of value you pass, the value Once returns is converted to a string. Passing a number or a bool works, but comparing the result against a non-string variable needs care since the two sides won’t share a type.
The fired-slot record is captured in save snapshots, so a snapshot-restored game doesn’t repeat a line it already delivered. It also resets at the start of a new run, so a fresh playthrough delivers every one-time line again.
Pick a unique slotKey for each call site that needs independent behavior.
Two Once("greeting", line) calls in different nodes share the same slot,
and only the first one fires. Pick and Cycle
share the same slot-key behavior.
For repeated cycling through a list instead of one-time delivery, see Cycle.