On this page
- Scripting Reference
- Public API (Alphabetical)
WhisperContextMinimal(_subject, _location)WhisperContextSimple(_subject, _location, _story = undefined)WhisperDebugMatch(_storylet, _ctx = undefined, _now = undefined, _filter = undefined)WhisperDebugQuery(_ctx = undefined, _now = undefined, _filter = undefined)WhisperFilter()WhisperGetRunId()WhisperAddInsert(_key, _value, _lang = "en")WhisperInsertResolve(_key, _lang = "en")WhisperInsertSetList(_key, _array, _lang = "en")WhisperLineExplicit( _pool_id, _storylet_id, _text, _tags = undefined, _weight = 1, _once_only = false )WhisperLineSimple( _pool_id, _text, _tags = undefined, _weight = 1, _once_only = false )WhisperNewRun()WhisperNow()WhisperPick(_ctx = undefined, _now = undefined, _filter = undefined)WhisperPickAndFire(_ctx = undefined, _now = undefined, _filter = undefined)WhisperPickAndFireOr(_ctx = undefined, _now = undefined, _filter = undefined, _fallback_fn = undefined)WhisperPickOr(_ctx = undefined, _now = undefined, _filter = undefined, _fallback_fn = undefined)WhisperPoolDebugQuery(_pool_id, _ctx = undefined, _now = undefined, _filter = undefined)WhisperPoolPick(_pool_id, _ctx = undefined, _now = undefined, _filter = undefined)WhisperPoolPickAndFire(_pool_id, _ctx = undefined, _now = undefined, _filter = undefined)WhisperPoolPickAndFireOr(_pool_id, _ctx = undefined, _now = undefined, _filter = undefined, _fallback_fn = undefined)WhisperPoolPickOr(_pool_id, _ctx = undefined, _now = undefined, _filter = undefined, _fallback_fn = undefined)WhisperPoolQuery(_pool_id, _ctx = undefined, _now = undefined, _filter = undefined)WhisperQuery(_ctx = undefined, _now = undefined, _filter = undefined)WhisperResetAll()WhisperSaySimple(_pool_id, _ctx = undefined, _lang = "en")WhisperSayTaggedSimple( _pool_id, _tags_any, _ctx = undefined, _lang = "en" )WhisperSayTextSimple( _pool_id, _ctx = undefined, _lang = "en", _fallback_text = undefined )WhisperSetRunId(_id)WhisperAddVerb(_name, _func)WhisperStateBuild()WhisperStateClear(_reset_auto_ids = false)WhisperStateLoad(_filepath = "")WhisperStateLoadJSON(_json_data)WhisperStateSave(_filepath = "")WhisperStorylet(_id)AddToPool(_pool_id): Add this storylet to the named pool.CanFire(_ctx, _now): Determine whether the storylet can currently fire.DebugAvailability(_ctx, _now, _filter = undefined): Debug this storylet’s availability given context and filters.Fire(_ctx, _now): Fire this storylet, running on_fire and updating usage/cooldown.HasTag(_tag): Check whether this storylet has a given tag.SetAvoidImmediateRepeat(_flag = true): Avoid picking this storylet twice in a row (per pool).SetCooldown(_cooldown): Set cooldown duration (uses the same units as_now).SetMaxUses(_max_uses): Set max total uses (ever). Use < 0 for unlimited.SetMaxUsesPerRun(_max_uses): Set max uses per run/session; < 0 for unlimited.SetOnAvailable(_func): Set hook called when the storylet is eligible during query.SetOnFire(_func): Set hook called when the storylet fires (after selection).SetOnResolved(_func): Alias forSetOnFire.SetOnSelected(_func): Set hook called when the storylet is selected by a pick.SetOnce(): Convenience: set max uses to 1 (ever).SetPredicate(_func): Set predicate function used for custom availability rules.SetWeight(_weight): Set base selection weight (must be > 0).SetData(_data): Set arbitrary user data on this storylet.SetDataCloned(_data): Set arbitrary user data on this storylet, cloned viavariable_clone.GetData(): Get the user data stored on this storylet (may be undefined).AddTag(_tag): Add a tag to this storylet.AddTagsArray(_tags_array): Add multiple tags (skips duplicates already present).SetTags(_tags_array): Replace the entire tag array.AddText(_string, _verb = undefined, _lang = "en"): Add text variation to the main body.GetText(_lang = "en"): Convenience: get just the text of a random variation.TextResolve(_lang = "en"): Resolve content to { id, text, events, data } for this storylet’s body.
WhisperTick(_dt)WhisperTickManual(_enabled)WhisperTickReset()WhisperTickSet(_num)WHISPER_VERB.AddVerb(_name, _func)WhisperVerbInsert(_name)WhisperVerbRunRange(_events, _from_pos, _to_pos, _ctx)
- Public API (Alphabetical)
Scripting Reference
This page documents the public Whisper API.
Everything here is listed in alphabetical order so you can Cmd+F your way to victory.
Public API (Alphabetical)
WhisperContextMinimal(_subject, _location)
Create a minimal context with subject + location only.
Arguments
_subjectAnyMain subject (player, NPC, etc.)._locationAnyLocation identifier.
Returns: Struct
WhisperContextSimple(_subject, _location, _story = undefined)
Create a simple Whisper context struct (subject/location/story fields).
Arguments
_subjectAnyMain subject (player, NPC, etc.)._locationAnyLocation identifier.[_story]Struct,UndefinedOptional story/state struct.
Returns: Struct
WhisperDebugMatch(_storylet, _ctx = undefined, _now = undefined, _filter = undefined)
Debug a single storylet match (returns reasons for failure/success).
Arguments
_storyletStruct.__WhisperStorylet,AnyStorylet struct or storylet id.[_ctx]Struct,UndefinedContext struct passed to predicates and hooks.[_now]Real,UndefinedTime value used for cooldown checks.[_filter]Struct,UndefinedFilter struct ({ tags_all, tags_any, tags_not, tags_prefer, prefer_weight, custom }).
Returns: Struct
WhisperDebugQuery(_ctx = undefined, _now = undefined, _filter = undefined)
Debug a global query (returns details about candidates and why they matched/failed).
Arguments
[_ctx]Struct,UndefinedContext struct passed to predicates and hooks.[_now]Real,UndefinedTime value used for cooldown checks.[_filter]Struct,UndefinedFilter struct ({ tags_all, tags_any, tags_not, tags_prefer, prefer_weight, custom }).
Returns: Array<Struct>
WhisperFilter()
Convenience builder for Whisper filter structs.
Arguments
- None.
Returns: Struct
-
Additional details:
-
This returns a plain struct with fields Whisper understands:
tags_all: array of tags the storylet must have all oftags_any: array of tags the storylet must have at least one oftags_not: array of tags the storylet must not havetags_prefer: array of tags to prefer when choosing (soft preference)prefer_weight: optional weight multiplier when a preferred tag matchescustom: optional functionfunction(_storylet, _ctx) -> Boolfor custom filtering
-
WhisperGetRunId()
Get the current run/session id.
Arguments
- None.
Returns: Real
WhisperAddInsert(_key, _value, _lang = "en")
Register an insertion value for a key.
Arguments
_keyStringInsertion key (no brackets)._valueStringReplacement text.[_lang]StringLanguage code.
Returns: Undefined
WhisperInsertResolve(_key, _lang = "en")
Resolve a single insertion key for a given language.
Arguments
_keyStringInsertion key.[_lang]StringLanguage code.
Returns: String,Undefined
WhisperInsertSetList(_key, _array, _lang = "en")
Register an insertion list for a key, used for random selection.
Arguments
_keyStringInsertion key._arrayArray<String>List of possible replacement strings.[_lang]StringLanguage code.
Returns: Undefined
WhisperLineExplicit( _pool_id, _storylet_id, _text, _tags = undefined, _weight = 1, _once_only = false )
Create a storylet with an explicit id and add it to a pool (track).
Arguments
_pool_idAnyPool / track identifier (e.g. “npc_bridge”)._storylet_idAnyStorylet identifier (e.g. “npc_bridge_hello_1”)._textStringText for this line (may include verbs and inserts)._tagsArray<String>,String,UndefinedTags for filtering (array or single string)._weightReal,UndefinedRelative selection weight (> 0)._once_onlyBool,UndefinedIf true, this line can fire only once ever.
Returns: Struct.__WhisperStorylet
WhisperLineSimple( _pool_id, _text, _tags = undefined, _weight = 1, _once_only = false )
Create a simple storylet and add it to a pool (track), with an auto generated id.
Arguments
_pool_idAnyPool / track identifier (e.g. “npc_bridge”)._textStringText for this line (may include verbs and inserts)._tagsArray<String>,String,UndefinedTags for filtering (array or single string)._weightReal,UndefinedRelative selection weight (> 0)._once_onlyBool,UndefinedIf true, this line can fire only once ever.
Returns: Struct.__WhisperStorylet
WhisperNewRun()
Start a new run/session. This resets per-run usage tracking.
This also clears pool repeat-suppression state (the last picked storylet), so a new run does not remember previous picks.
Arguments
- None.
Returns: Undefined
WhisperNow()
Simple time helper for Whisper cooldowns and usage.
By default, this returns seconds since game start.
If manual ticking is enabled via WhisperTickManual(true), this returns the current manual tick counter. The counter is seeded to the current time (seconds since game start) the first time it is used, unless you explicitly set it with WhisperTickReset() or WhisperTickSet(num).
Arguments
- None.
Returns: Real
WhisperPick(_ctx = undefined, _now = undefined, _filter = undefined)
Pick a storylet from the global storylet list (does not fire it).
Arguments
[_ctx]Struct,UndefinedContext struct passed to predicates and hooks.[_now]Real,UndefinedTime value used for cooldown checks.[_filter]Struct,UndefinedFilter struct ({ tags_all, tags_any, tags_not, tags_prefer, prefer_weight, custom }).
Returns: Struct.__WhisperStorylet,Undefined
WhisperPickAndFire(_ctx = undefined, _now = undefined, _filter = undefined)
Pick and immediately fire a storylet (updates usage/cooldown).
Arguments
[_ctx]Struct,UndefinedContext struct passed to predicates and hooks.[_now]Real,UndefinedTime value used for cooldown checks.[_filter]Struct,UndefinedFilter struct ({ tags_all, tags_any, tags_not, tags_prefer, prefer_weight, custom }).
Returns: Struct.__WhisperStorylet,Undefined
WhisperPickAndFireOr(_ctx = undefined, _now = undefined, _filter = undefined, _fallback_fn = undefined)
Pick and fire a storylet or call a fallback function when nothing matches.
Arguments
[_ctx]Struct,UndefinedContext struct passed to predicates and hooks.[_now]Real,UndefinedTime value used for cooldown checks.[_filter]Struct,UndefinedFilter struct ({ tags_all, tags_any, tags_not, tags_prefer, prefer_weight, custom })._fallback_fnFunction,UndefinedFunction called when no storylet matches.
Returns: Struct.__WhisperStorylet,Any,Undefined
-
Additional details:
_fallback_fnis only called when nothing matches. Signature:function() -> Any.
WhisperPickOr(_ctx = undefined, _now = undefined, _filter = undefined, _fallback_fn = undefined)
Pick a storylet or call a fallback function when nothing matches.
Arguments
[_ctx]Struct,UndefinedContext struct passed to predicates and hooks.[_now]Real,UndefinedTime value used for cooldown checks.[_filter]Struct,UndefinedFilter struct ({ tags_all, tags_any, tags_not, tags_prefer, prefer_weight, custom })._fallback_fnFunction,UndefinedFunction called when no storylet matches.
Returns: Struct.__WhisperStorylet,Any,Undefined
-
Additional details:
_fallback_fnis only called when nothing matches. Signature:function() -> Any.
WhisperPoolDebugQuery(_pool_id, _ctx = undefined, _now = undefined, _filter = undefined)
Debug a pool query (returns details about candidates and match results).
Arguments
_pool_idAnyPool identifier.[_ctx]Struct,UndefinedContext struct passed to predicates and hooks.[_now]Real,UndefinedTime value used for cooldown checks.[_filter]Struct,UndefinedFilter struct ({ tags_all, tags_any, tags_not, tags_prefer, prefer_weight, custom }).
Returns: Array<Struct>
WhisperPoolPick(_pool_id, _ctx = undefined, _now = undefined, _filter = undefined)
Pick a storylet from a pool (does not fire it).
Arguments
_pool_idAnyPool identifier.[_ctx]Struct,UndefinedContext struct passed to predicates and hooks.[_now]Real,UndefinedTime value used for cooldown checks.[_filter]Struct,UndefinedFilter struct ({ tags_all, tags_any, tags_not, tags_prefer, prefer_weight, custom }).
Returns: Struct.__WhisperStorylet,Undefined
WhisperPoolPickAndFire(_pool_id, _ctx = undefined, _now = undefined, _filter = undefined)
Pick and fire a storylet from a pool (updates usage/cooldown).
Arguments
_pool_idAnyPool identifier.[_ctx]Struct,UndefinedContext struct passed to predicates and hooks.[_now]Real,UndefinedTime value used for cooldown checks.[_filter]Struct,UndefinedFilter struct ({ tags_all, tags_any, tags_not, tags_prefer, prefer_weight, custom }).
Returns: Struct.__WhisperStorylet,Undefined
WhisperPoolPickAndFireOr(_pool_id, _ctx = undefined, _now = undefined, _filter = undefined, _fallback_fn = undefined)
Pick and fire a storylet from a pool or call a fallback function when nothing matches.
Arguments
_pool_idAnyPool identifier.[_ctx]Struct,UndefinedContext struct passed to predicates and hooks.[_now]Real,UndefinedTime value used for cooldown checks.[_filter]Struct,UndefinedFilter struct ({ tags_all, tags_any, tags_not, tags_prefer, prefer_weight, custom })._fallback_fnFunction,UndefinedFunction called when no storylet matches.
Returns: Struct.__WhisperStorylet,Any,Undefined
-
Additional details:
_fallback_fnis only called when nothing matches. Signature:function() -> Any.
WhisperPoolPickOr(_pool_id, _ctx = undefined, _now = undefined, _filter = undefined, _fallback_fn = undefined)
Pick a storylet from a pool or call a fallback function when nothing matches.
Arguments
_pool_idAnyPool identifier.[_ctx]Struct,UndefinedContext struct passed to predicates and hooks.[_now]Real,UndefinedTime value used for cooldown checks.[_filter]Struct,UndefinedFilter struct ({ tags_all, tags_any, tags_not, tags_prefer, prefer_weight, custom })._fallback_fnFunction,UndefinedFunction called when no storylet matches.
Returns: Struct.__WhisperStorylet,Any,Undefined
-
Additional details:
_fallback_fnis only called when nothing matches. Signature:function() -> Any.
WhisperPoolQuery(_pool_id, _ctx = undefined, _now = undefined, _filter = undefined)
Query eligible storylets inside a specific pool.
Arguments
_pool_idAnyPool identifier.[_ctx]Struct,UndefinedContext struct passed to predicates and hooks.[_now]Real,UndefinedTime value used for cooldown checks.[_filter]Struct,UndefinedFilter struct ({ tags_all, tags_any, tags_not, tags_prefer, prefer_weight, custom }).
Returns: Array<Struct.__WhisperStorylet>
WhisperQuery(_ctx = undefined, _now = undefined, _filter = undefined)
Query eligible storylets using the global storylet list.
Arguments
[_ctx]Struct,UndefinedContext struct passed to predicates and hooks.[_now]Real,UndefinedTime value used for cooldown checks.[_filter]Struct,UndefinedFilter struct ({ tags_all, tags_any, tags_not, tags_prefer, prefer_weight, custom }).
Returns: Array<Struct.__WhisperStorylet>
WhisperResetAll()
Destroy and recreate all Whisper singletons (manager, verbs, inserts).
Arguments
- None.
Returns: Undefined
WhisperSaySimple(_pool_id, _ctx = undefined, _lang = "en")
Pick and fire a line from a pool and resolve its text. Returns { id, text, events, data } or undefined.
Arguments
_pool_idAnyPool / track identifier.[_ctx]Struct,UndefinedContext struct (optional).[_lang]String,UndefinedLanguage code.
Returns: Struct,Undefined
WhisperSayTaggedSimple( _pool_id, _tags_any, _ctx = undefined, _lang = "en" )
Pick and fire a line from a pool using simple tag filters. Returns { id, text, events, data } or undefined.
Arguments
_pool_idAnyPool / track identifier._tags_anyArray<String>,String,UndefinedAt least one of these tags must be present.[_ctx]Struct,UndefinedContext struct (optional).[_lang]String,UndefinedLanguage code.
Returns: Struct,Undefined
WhisperSayTextSimple( _pool_id, _ctx = undefined, _lang = "en", _fallback_text = undefined )
Pick and fire a line from a pool and return only the text.
Arguments
_pool_idAnyPool / track identifier.[_ctx]Struct,UndefinedContext struct (optional).[_lang]String,UndefinedLanguage code.[_fallback_text]String,UndefinedFallback text when no line matches.
Returns: String,Undefined
WhisperSetRunId(_id)
Explicitly set the current run/session id.
Arguments
_idRealNew run identifier.
Returns: Undefined
WhisperAddVerb(_name, _func)
Register a verb callback.
Arguments
_nameStringVerb name._funcFunctionCallback taking (_ctx, _event).
Returns: Undefined
WhisperStateBuild()
Build a Whisper save payload (JSON-ready struct).
This is intended for embedding into your own save system.
Arguments
- None.
Returns: Struct
WhisperStateClear(_reset_auto_ids = false)
Clear Whisper runtime state (usage counters, run state, tick state, and pool repeat suppression).
This keeps your storylets and pools; it only resets runtime counters/state.
Arguments
[_reset_auto_ids]BoolIf true, resets the auto id counter used byWhisperLineSimple.
Returns: Undefined
WhisperStateLoad(_filepath = "")
Load Whisper state from a file in the sandbox (or a custom path).
If _filepath is "", this defaults to "whisper_state.json".
Arguments
[_filepath]StringFile path (relative to sandbox, or an absolute path on supported platforms).
Returns: Bool
WhisperStateLoadJSON(_json_data)
Load a Whisper save payload from JSON.
You can pass either a JSON string, or a struct (for example, produced by json_parse).
Arguments
_json_dataString,StructJSON string or parsed struct.
Returns: Bool
-
Additional details:
- This restores runtime state only (usage counters, run id, tick state, and pool repeat suppression). It does not restore storylet content (text/tags/predicates), pool memberships, verbs, or insertions.
- Loading merges into the current runtime state: entries not present in the payload are not removed.
WhisperStateSave(_filepath = "")
Save Whisper state to a file in the sandbox (or a custom path).
If _filepath is "", this defaults to "whisper_state.json".
Arguments
[_filepath]StringFile path (relative to sandbox, or an absolute path on supported platforms).
Returns: Bool
WhisperStorylet(_id)
Public factory to create or fetch a Whisper storylet.
Arguments
_idAnyStorylet identifier.
Returns: Struct.__WhisperStorylet
-
Additional details:
- The returned struct type is named
__WhisperStoryletin code. Even though it has__in the name, it is intended to be the public storylet handle you configure and fire.
- The returned struct type is named
Public methods
-
AddToPool(_pool_id): Add this storylet to the named pool.-
Arguments:
_pool_idAnyPool identifier.
-
Returns:
Struct.__WhisperStorylet
-
-
CanFire(_ctx, _now): Determine whether the storylet can currently fire.-
Arguments:
_ctxStructContext struct passed to predicate._nowRealCurrent time value for cooldown checks.
-
Returns:
Bool
-
-
DebugAvailability(_ctx, _now, _filter = undefined): Debug this storylet’s availability given context and filters.-
Arguments:
_ctxStructContext struct passed to predicates._nowRealCurrent time value for cooldowns._filterStruct,UndefinedFilter struct ({ tags_all, tags_any, tags_not, tags_prefer, prefer_weight, custom }).
-
Returns:
Struct
-
-
Fire(_ctx, _now): Fire this storylet, running on_fire and updating usage/cooldown.-
Arguments:
_ctxStructContext struct passed to hooks._nowRealCurrent time value for cooldowns.
-
Returns:
Bool
-
-
HasTag(_tag): Check whether this storylet has a given tag.-
Arguments:
_tagStringTag to look for.
-
Returns:
Bool
-
-
SetAvoidImmediateRepeat(_flag = true): Avoid picking this storylet twice in a row (per pool).-
Arguments:
[_flag]Bool,UndefinedEnable/disable.
-
Returns:
Struct.__WhisperStorylet
-
-
SetCooldown(_cooldown): Set cooldown duration (uses the same units as_now).-
Arguments:
_cooldownRealCooldown amount.
-
Returns:
Struct.__WhisperStorylet
-
-
SetMaxUses(_max_uses): Set max total uses (ever). Use < 0 for unlimited.-
Arguments:
_max_usesRealMax uses (< 0 means unlimited).
-
Returns:
Struct.__WhisperStorylet
-
-
SetMaxUsesPerRun(_max_uses): Set max uses per run/session; < 0 for unlimited.-
Arguments:
_max_usesRealMax uses per run (< 0 means unlimited).
-
Returns:
Struct.__WhisperStorylet
-
-
SetOnAvailable(_func): Set hook called when the storylet is eligible during query.-
Arguments:
_funcFunction,UndefinedCallback signature:function(_ctx, _storylet).
-
Returns:
Struct.__WhisperStorylet
-
-
SetOnFire(_func): Set hook called when the storylet fires (after selection).-
Arguments:
_funcFunction,UndefinedCallback signature:function(_ctx, _storylet).
-
Returns:
Struct.__WhisperStorylet
-
-
SetOnResolved(_func): Alias forSetOnFire.-
Arguments:
_funcFunction,UndefinedCallback signature:function(_ctx, _storylet).
-
Returns:
Struct.__WhisperStorylet
-
-
SetOnSelected(_func): Set hook called when the storylet is selected by a pick.-
Arguments:
_funcFunction,UndefinedCallback signature:function(_ctx, _storylet).
-
Returns:
Struct.__WhisperStorylet
-
-
SetOnce(): Convenience: set max uses to 1 (ever).-
Arguments:
- None.
-
Returns:
Struct.__WhisperStorylet
-
-
SetPredicate(_func): Set predicate function used for custom availability rules.-
Arguments:
_funcFunction,UndefinedCallback signature:function(_ctx) -> Bool.
-
Returns:
Struct.__WhisperStorylet
-
-
SetWeight(_weight): Set base selection weight (must be > 0).-
Arguments:
_weightRealNew base weight.
-
Returns:
Struct.__WhisperStorylet
-
-
SetData(_data): Set arbitrary user data on this storylet.-
Arguments:
_dataAnyData payload (any type).
-
Returns:
Struct.__WhisperStorylet
-
-
SetDataCloned(_data): Set arbitrary user data on this storylet, cloned viavariable_clone.-
Arguments:
_dataAnyData payload (any type).
-
Returns:
Struct.__WhisperStorylet
-
-
GetData(): Get the user data stored on this storylet (may be undefined).-
Arguments:
- None.
-
Returns:
Any
-
-
AddTag(_tag): Add a tag to this storylet.-
Arguments:
_tagStringTag to add.
-
Returns:
Struct.__WhisperStorylet
-
-
AddTagsArray(_tags_array): Add multiple tags (skips duplicates already present).-
Arguments:
_tags_arrayArray<String>Tag list to add.
-
Returns:
Struct.__WhisperStorylet
-
-
SetTags(_tags_array): Replace the entire tag array.-
Arguments:
_tags_arrayArray<String>Tag list.
-
Returns:
Struct.__WhisperStorylet
-
-
AddText(_string, _verb = undefined, _lang = "en"): Add text variation to the main body.-
Arguments:
_stringStringRaw template string (may contain markers).[_verb]String,UndefinedVerb to trigger on completion.[_lang]StringLanguage code.
-
Returns:
Struct.__WhisperStorylet
-
-
GetText(_lang = "en"): Convenience: get just the text of a random variation.-
Arguments:
_langStringLanguage code.
-
Returns:
String,Undefined
-
-
TextResolve(_lang = "en"): Resolve content to { id, text, events, data } for this storylet’s body.-
Arguments:
_langStringLanguage code.
-
Returns:
Struct,Undefined
-
WhisperTick(_dt)
Advance manual cooldown time by the provided tick amount (no-op unless manual ticking is enabled).
Arguments
_dtRealTick amount (delta-time).
Returns: Real,Undefined
WhisperTickManual(_enabled)
Enable or disable manual ticking for WhisperNow().
When enabled, cooldown time only advances when you call WhisperTick(_dt).
Arguments
_enabledBoolIf true, enable manual ticking.
Returns: Undefined
WhisperTickReset()
Reset the manual tick counter used by WhisperNow() to 0.
Arguments
- None.
Returns: Undefined
WhisperTickSet(_num)
Set the manual tick counter used by WhisperNow() to an explicit value.
Arguments
_numRealNew manual tick value.
Returns: Undefined
WHISPER_VERB.AddVerb(_name, _func)
Register a verb callback.
Arguments
_nameStringVerb name._funcFunctionCallback taking (_ctx, _event).
Returns: Undefined
-
Additional details:
- Verb callbacks run as
function(_ctx, _event). _eventincludes at least:name,position,trigger,meta.args.
- Verb callbacks run as
WhisperVerbInsert(_name)
Build an inline verb marker string for the given verb name, but only if it’s registered. Returns “” if the verb isn’t registered.
Arguments
_nameStringVerb name.
Returns: String
WhisperVerbRunRange(_events, _from_pos, _to_pos, _ctx)
Run verb events whose positions fall between the previous and new cursor.
Arguments
_eventsArray<Struct>Events array from resolved text._from_posRealPrevious cursor position (exclusive lower bound)._to_posRealNew cursor position (inclusive upper bound)._ctxStructContext passed to verb callbacks.
Returns: Undefined
-
Additional details:
- This is mainly for typewriter text. As your cursor moves forward, call this to fire any verbs that were crossed.