Viv JavaScript Runtime - v0.10.2
    Preparing search index...

    Interface ActionView

    A read-only entity view for an action that has been performed.

    For details on semantics and constraints, see EntityView, which this interface extends.

    interface ActionView {
        active: string[];
        ancestors: string[];
        bindings: RoleBindings;
        bystanders: string[];
        caused: string[];
        causes: string[];
        descendants: string[];
        entityType: Action;
        gloss: string | null;
        id: string;
        importance: number;
        initiator: string;
        location: string;
        name: string;
        partners: string[];
        present: string[];
        recipients: string[];
        relayedActions: string[];
        report: string | null;
        scratch: Record<string, unknown>;
        tags: string[];
        timeOfDay: TimeOfDay | null;
        timestamp: number;
        [key: string]: ExpressionValue;
    }

    Hierarchy (View Summary)

    Indexable

    • [key: string]: ExpressionValue

      Additional properties whose structure depends entirely on the host application, with the caveat that the Viv runtime expects a plain object all the way down. As such, the values embedded here should not include types like functions or members of custom classes, but rather exclusively the types defined in the ExpressionValue union.

    Index

    Properties

    active: string[]

    Array containing entity IDs for all characters who participated in this action, meaning all present characters who were cast in non-bystander roles. This field supports story sifting.

    ancestors: string[]

    Array containing entity IDs for all causal ancestors of this one (always deduplicated).

    bindings: RoleBindings

    The final bindings constructed for the action. Bindings map roles to the respective entities (or symbols) that were cast in those roles.

    bystanders: string[]

    Array containing entity IDs for any bystanders who witnessed, but did not participate in, this action. This field supports story sifting.

    caused: string[]

    Array containing entity IDs for all the actions directly caused by this one. The array will initially be empty, but may be mutated later on by subsequent actions (always deduplicated).

    causes: string[]

    Array containing entity IDs for all the actions that directly caused this one, if any. This data, produced as the simulation proceeds through what I call causal bookkeeping, greatly facilitates story sifting. The value here will always be deduplicated.

    descendants: string[]

    Array containing entity IDs for all causal descendants of this one (always deduplicated).

    entityType: Action

    Discriminator for the action entity type.

    gloss: string | null

    A simple string (derived from an author-defined template) describing this action in a sentence or so.

    This field is not readonly because it is set after an action is first recorded.

    id: string

    A unique identifier for the entity.

    importance: number

    A numeric score capturing the importance of this action, for purposes of story sifting.

    initiator: string

    Entity ID for the initiator of this action. This field supports story sifting.

    location: string

    Entity ID for the storyworld location where this action was performed.

    name: string

    The name of the action being performed.

    partners: string[]

    Array containing entity IDs for the initiator and any entities cast in partner roles (i.e., co-initiator roles) of this action. This field supports story sifting.

    present: string[]

    Array containing entity IDs for all characters who participated in or otherwise directly witnessed this action, meaning all active characters and also bystanders. This field supports story sifting.

    recipients: string[]

    Array containing entity IDs for any recipients of this action. This field supports story sifting.

    relayedActions: string[]

    Array containing entity IDs for all actions about which this one relays knowledge. An action is said to relay knowledge about another one when it casts it in one of its roles.

    report: string | null

    A more detailed string (derived from an author-defined template) describing this action in a paragraph or so.

    This field is not readonly because it is set after an action is first recorded.

    scratch: Record<string, unknown>

    A blackboard storing arbitrary variables that a Viv author may set in the course of an action definition.

    These can be derived via expressions included in the action definition's scratch field, and variables can also be set or mutated by assignments in the effects field (and also technically by side effects from arbitrary custom function calls, which may be placed almost anywhere in an action definition). In Viv parlance, scratch variables are set via the $ notation, as in $&foo = 77, which is really just syntactic sugar for @this.scratch.foo == 77 -- i.e., syntactic sugar for setting a top-level property in this object. This data persists in the action's entity data so that subsequent actions may refer to it as needed, via expressions like @past_action.scratch.baz.

    tags: string[]

    Tags on the action. These are meant to facilitate search over actions, for story sifting, and their function may be extended in the host application.

    This field is not readonly because it is set after an action is first recorded.

    timeOfDay: TimeOfDay | null

    The time of day at which the action was performed. If the host application does not model time of day, this will be null.

    timestamp: number

    The timestamp (in story time) at which this action occurred. Like all Viv timestamps, this is represented as the number of minutes that have elapsed, in story time, since the running simulation instance in the host application first commenced.