Skip to content

Modifies Foundry VTT ruler to display when dragging tokens, add token speed highlighting, do pathfinding, calculate elevation

License

Notifications You must be signed in to change notification settings

caewok/fvtt-elevation-ruler

Repository files navigation

Version (latest) Foundry Version License

Forge Installs Latest Release Download Count All Downloads

Elevation Ruler

This module allows the default Foundry measurement ruler to track change in elevation. Elevation can be changed while using the ruler in five ways:

  1. Manually. Hit the specified hot key (default: '[' to increment and ']' to decrement).
  2. Token. When hovering over a token with the ruler, the origin or destination elevation (as applicable) will update.
  3. Elevated Vision. If the Elevated Vision module is present, it will use that elevation information. (Elevation Ruler v0.5+)
  4. Enhanced Terrain Layer. If a terrain layer is present with a finite max elevation, that max elevation will be used for the elevation.
  5. Levels. If the Levels module is present, the ruler will look for Levels-enabled tiles and default to the bottom elevation of that tile. In Elevation Ruler v0.5+, it will also originate elevation at the bottom of the active layer if the Levels layers UI is active.

The distance calculation updates based on the distance measured, assuming a straight line in three dimensions between origin and destination, taking into account elevation change.

If you add a waypoint, elevation will be tracked at each waypoint.

If you choose to move the origin token (by hitting spacebar) after measuring, the token elevation will be updated along each waypoint.

As of v0.6.0, Elevation Ruler works with Drag Ruler.

Installation

Add this Manifest URL in Foundry to install.

Dependencies

(Elevation Ruler 0.4+ requires Foundry v9 because it replaces the DF Hotkeys dependency with the Foundry keybindings introduced in v9.) (Elevation Ruler 0.5+ requires Foundry v10 due to improvements in the Foundry Ruler API.)

Modules that add functionality

*Enhanced Terrain Layer has an issue in v10 that may need to be resolved before it will function with this module.

Known conflicts

In general, modules that overwrite or extend the Ruler Class may cause the elevation ruler module to fail to display or calculate correctly.

What systems does it work on?

It has been tested on dnd5e. Because it adds to the functionality of the underlying Foundry measurement ruler, it may work on other systems as well, unless the system overrides key Foundry measurement functions in the Ruler Class. Please submit an issue in this GitHub if you experience issues when running on your preferred system!

How to Use

To use, start measuring with the Foundry measurement ruler as normal. While doing so, hit '[' to increase the elevation at the destination by one step. A step is equal to the grid size (typically 5 feet). Hit ']' to decrease the elevation at the destination by one step.

Settings

  • Change the elevation increment hotkeys
  • Toggle using terrain for elevation measurement. Requires Enhanced Terrain Layer.

Details

Measuring diagonals

Nearly every elevation measurement creates a diagonal path from the origin to the elevated or decremented altitude. Elevation Ruler attempts to use the default system measurement to measure these diagonals. For dnd5e, the total distance along the diagonal will follow the chosen dnd5e measurement rule: 5-5-5, 5-10-5, or Euclidean.

For example, here is the measurement that is displayed in DnD 5e with the 5-5-5 rule, where a diagonal move counts as 5 feet:

Screenshot DnD 5e 5-5-5 Measurement

The token would move two squares left and two squares "up". This first move can be accomplished by moving diagonally up and to the left twice. This totals 10 feet under the DnD 5e 5-5-5 rule (same as if moving two squares left). Moving down two squares then adds a

The token would then moves two squares down in 2-D and down one square in elevation. Similarly to the first move, the second can be accomplished by moving diagonally down 1 square and then down one more square in 2-D, or 10 feet total.

In contrast, using the 5-10-5 rule, the first move incurs an extra 5-foot penalty because moving twice diagonally costs 15 feet.

Screenshot DnD 5e 5-10-5 Measurement

Finally, the DnD Euclidean rule relies on Pythagorean's Theorem, rounded to the nearsest foot. Here the token is first elevated 10 feet (14 feet of movement total along the diagonal in 3-D) and then lowered 5 feet (11 feet of movement total).

Screenshot DnD 5e Euclidean Measurement

Terrain measurement

To use terrain measurement, first set up one or more terrains using Enhanced Terrain Layer. Set a maximum value for the terrain layer.

Screenshot Terrain Setup

Now when you drag the ruler over a terrain area, the ruler will automatically adjust the elevation based on the terrain maximum height. Note that this is based on the center-point of the current ruler position. You can still increment the values up or down manually, and those values will persist as you move the ruler around.

Screenshot Terrain Measurement

Token measurement

Similarly, as you can see in the previous screenshot, if you drag the ruler over a token that has been elevated or lowered, the ruler will reflect the elevation of that token (plus or minus manually incremented values).

This is particularly useful where you have an elevated character at the origin, and want to fire or move downwards. Or vice-versa where you are aiming at an elevated token and need total distance to the elevated target.

This video shows both terrain and token measurement in action.

Video Terrain Measurement

Levels measurement

For a multi-level scene using the Levels module, the ruler will pick up on holes and Levels-enabled tiles.

In general, when the ruler endpoint is within a Levels-enabled tile, the bottom-most elevation of the bottom tile will be displayed.

If you start the ruler on a token, the ruler will stay at the bottom-most elevation of the current floor for that token, unless it encounters a hole, a token, or an area that is not within a Levels-enabled tile.

Hitting spacebar can move the token between levels if you start the ruler measurement at your token. Note that this may allow players to move between levels at points other than at stairs, holes, or elevators, just as directly adjusting a token's elevation would.

Elevation changes when moving the token with spacebar

As with the normal Foundry ruler, if you begin a measurement at your token, you can hit spacebar to move the token. Elevation is modified at the end of each waypoint segment move. This may allow you, for example, to jump over a wall if that wall has a maximum height under your current elevation as can be set up using the Wall Height module (or Levels + Wall Height).

About

Modifies Foundry VTT ruler to display when dragging tokens, add token speed highlighting, do pathfinding, calculate elevation

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published