Token Z

Token Z

Version: V12
Any System

    Easily manage the Z-Index of tokens.


    Note that as of V12, Token Z replaces the core FVTT Token sorting and removes the sort buttons from the token hud.

    The Problem

    In Foundry VTT tokens are sorted by 2 parameters: Elevation and Z-Index. Is possible to change elevation via the token hud but the z-index field is internal and can't be changed. Token-Z handles this problem.

    • Elevation always has priority over Z-Index, tokens with higher elevation will always be on top.
    • Z-Index comes into play when tokens are at the same elevation. In core Foundry whatever token was selected last will be on top. This can be a problem because smaller tokens can end up being covered by larger tokens, making them hard or impossible to select.

    The Solution

    Token-Z solves this problem by forcing a token order based on some parameters so that tokens never end up beeing covered by others. For example, no matter what token was selected last, if a small token is on the same space as a large token, the small token will always be on top.

    Auto Sorting

    Z-Index FieldZ-Index Field

    Token-Z is opinionated and will auto sort based on some parameters:

    • Elevation: With a maximum priority
    • Size: with a weight of -1 (this means a token that is 2x2 will have a -4 z-index to it)
    • Selected: with a weight of 1 (a selected token will have a +1 z-index applied)
    • Defeated: with a weight of -1000

    Manual Sorting

    Simply input a z-index value in the new field in the token config.

    Pushing Back

    If you want to push a token back, you can press the Z key (rebindable). The pushing is temporary and refreshing the page or changing scene will restore the automatic sorting.