Foundry Virtual Tabletop - API Documentation - Version 14
    Preparing search index...

    Interface TokenMovementActionConfigDescriptor

    interface TokenMovementActionConfigDescriptor {
        canSelect:
            | boolean
            | ((token: TokenDocument | PrototypeToken) => boolean);
        costMultiplier?: number;
        deriveTerrainDifficulty?:
            | ((nonDerivedDifficulties: { [action: string]: number }) => number)
            | null;
        getAnimationOptions?: (
            token: TokenDocument,
        ) => Pick<
            TokenAnimationOptions,
            "duration"
            | "movementSpeed"
            | "easing"
            | "ontick",
        >;
        getCostFunction?: (
            token: TokenDocument,
            options: TokenMeasureMovementPathOptions,
        ) => TokenMovementActionCostFunction;
        icon?: string;
        img?: string;
        label: string;
        measure?: boolean;
        order?: number;
        speedMultiplier?: number;
        teleport?: boolean;
        terrainAction?: string | null;
        visualize?: boolean;
        walls?: string | null;
    }
    Index

    Properties

    canSelect: boolean | ((token: TokenDocument | PrototypeToken) => boolean)

    Can the current User select this movement action for the given Token? If selectable, the movement action of the Token can be set to this movement action by the User via the UI and when cycling. Default: true.

    costMultiplier?: number

    The cost multiplier. This property is ignored if getCostFunction is defined. Default: 1.

    deriveTerrainDifficulty?:
        | ((nonDerivedDifficulties: { [action: string]: number }) => number)
        | null

    If set, this function is used to derive the terrain difficulty from from nonderived difficulties, which are those that do not have deriveTerrainDifficulty set. Used by foundry.data.regionBehaviors.ModifyMovementCostRegionBehaviorType. Derived terrain difficulties are not configurable via the behavior UI.

    getAnimationOptions?: (
        token: TokenDocument,
    ) => Pick<
        TokenAnimationOptions,
        "duration"
        | "movementSpeed"
        | "easing"
        | "ontick",
    >

    Get the default animation options for this movement action. Default: () => ({speedMultiplier}).

    getCostFunction?: (
        token: TokenDocument,
        options: TokenMeasureMovementPathOptions,
    ) => TokenMovementActionCostFunction

    The cost modification function. Default: () => cost => cost * costMultiplier.

    icon?: string

    The FontAwesome icon class.

    img?: string

    An image filename. Takes precedence over the icon if both are supplied.

    label: string

    The label of the movement action.

    measure?: boolean

    Is the movement measured? The distance, cost, spaces, and diagonals of a segment that is not measured are always 0. Default: true.

    order?: number

    The number that is used to sort the movement actions / movement action configs. Determines the order in the Token Config/HUD and of cycling. Default: 0.

    speedMultiplier?: number

    The movement speed multiplier. This property is ignored if getAnimationOptions is defined.

    teleport?: boolean

    Is teleportation? If true, the movement does not go through all grid spaces between the origin and destination: it goes from the origin immediately to the destination grid space. Default: false.

    terrainAction?: string | null

    Derive the terrain difficulty from this movement action. If null, the terrain difficulty is always 1. This property is ignored if deriveTerrainDifficulty is defined.

    visualize?: boolean

    Is segment of the movement visualized by the ruler? Default: true.

    walls?: string | null

    The type of walls that block this movement, if any. Default: "move".