Persisted data model for a Structure actor. Carries no fields of its own beyond the common SohlActorData base.

The shape of system on a structure actor — i.e. actor.system (equivalently actor.logic.data) when actor.type === "structure". The backing DataModel implements this interface.

interface StructureData<
    TLogic extends SohlActorLogic<StructureData> = SohlActorLogic<any>,
> {
    actionDefs: sohl.entity.action.SohlAction.Data[];
    actorLogic: null | SohlActorLogic<any>;
    appearance: HTMLString;
    currentMoveMedium: MovementMedium;
    dossier: HTMLString;
    hasPlayerOwner: boolean;
    health: { max: number; value: number };
    id: string;
    isOwner: boolean;
    itemLogics: SohlItemLogic<any>[];
    kind: string;
    lastRun?: Record<string, number>;
    logic: TLogic;
    movementProfiles: MovementProfile[];
    name: string;
    parent: null | SohlActor;
    portrait: FilePath;
    scheduledActions?: ScheduledAction[];
    shortcode: string;
    type: string;
    uuid: string;
    getFlag(scope: string, key: string): unknown;
    label(options?: { withName: boolean }): string;
    setFlag(scope: string, key: string, value: unknown): Promise<unknown>;
    update(data: object): Promise<unknown>;
}

Type Parameters

Hierarchy (View Summary)

Properties

Serialized action definitions used to build the logic's actions map.

actorLogic: null | SohlActorLogic<any>

The logic of the owning actor — this actor's own logic when the data is an actor's, the owning actor's logic when it is an item's, or null.

appearance: HTMLString

Rich-text physical-appearance description.

currentMoveMedium: MovementMedium

The medium this actor is currently moving in (selects a profile).

dossier: HTMLString

Rich-text dossier / background notes.

hasPlayerOwner: boolean

Whether the actor is owned by at least one player (non-GM) user.

health: { max: number; value: number }

Overall health as a token-bar-shaped { value, max } (both 0…100, max always 100). Derived every preparation and written back here by the owning actor's logic — never persisted (see SohlActorDataModel). A fresh actor defaults to 100/100; only Being derives it down today.

id: string

The owning document's id.

isOwner: boolean

Whether the current user owns the document (edit permission).

itemLogics: SohlItemLogic<any>[]

The logic instance of every embedded item, in items order.

kind: string

The document kind (its actor or item type id).

lastRun?: Record<string, number>

Generic run record (issue #579) — a map of actionName → the world time (seconds) that action last performed on this document, stamped at the action chokepoint for actions flagged recordsLastRun. The past-tense mirror of scheduledActions: "when did X last happen here?" for any action, without a bespoke field, and it survives after a schedule ends. For an event-driven trigger (no computable next fire) it is the only meaningful temporal fact.

logic: TLogic

The logic instance built from this data.

movementProfiles: MovementProfile[]

Per-medium movement profiles persisted on this actor.

name: string

The owning document's name.

parent: null | SohlActor

The Foundry document (actor or item) this data belongs to, or null.

portrait: FilePath

Path to the actor's portrait image.

scheduledActions?: ScheduledAction[]

Persisted recurring/deferred schedules for this document (issue #588) — each entry defers actionName to anchor + interval. The generic store that replaces the retired bespoke last*Date anchors; a recurring effect's finalize() re-arms these into the event queue on every preparation. Only documents whose data model extends the base SohlDataModel (actors, items, combatants) carry it — hence optional here. See https://kb.heroiclands.org/dev/reference/event-queue/.

shortcode: string

Short identity code for this document.

type: string

The owning document's type (its actor or item kind).

uuid: string

The owning document's globally-unique id, treated as an opaque identity token: pass it through (e.g. into chat-card data) and resolve it back to logic via fvttLogicFromUuid / fvttLogicFromUuidSync — never fromUuid it to a Foundry document inside the logic layer.

Methods

  • Write a namespaced flag on the owning document.

    Parameters

    • scope: string
    • key: string
    • value: unknown

    Returns Promise<unknown>