Skip to content

Custom Journal Page Enhancers

marvin9257 edited this page Jan 6, 2024 · 11 revisions

Introduction

Enhancers are special elements on a Journal Page that allow for interactivity. For example, the entry while editing [[/r 2d6\]] will create a button that makes a roll with two six-sided dice. Core foundry has many other enhanced features for Journal entries - such as dragging and dropping a link to other objects, such as actors and tables. See this page (https://foundryvtt.com/article/journal/) under "Dynamic Document Links."

Custom Enhancers for Twodsix

Twodsix currently has two custom enhancers that extend the core FVTT capability. These enhancers are @DisplayTable and @SkillRoll.

@DisplayTable

Normal dragging and dropping of a Roll Table onto a Journal Entry page creates a link that opens that table. The @DisplayTable option will instead display the table in a html formatted table. For example, displaying one of the compendium macro tables will look like this,

Screenshot 2023-12-08 at 8 42 47 AM

The format for the enhancer is @DisplayTable[UUID or Table Name]{Text Label}. The easiest way to create this display is to drag and drop the table. You should see a UUID link something like @UUID[RollTable.u8586ms09wZNqpwN]{Population}. Change the @UUID prefix to @DisplayTable: @DisplayTable[RollTable.u8586ms09wZNqpwN]{Population}. Subtables are displayed as the default @UUID[Rolltable.uuid]{description} link.

@SkillRoll

The @SkillRoll feature creates a clickable skill roll similar to the way skill rolls work for ship positions (https://github.com/xdy/twodsix-foundryvtt/wiki/How-to-use-the-ship-sheet#positions-tab) except that there are no components to link. The general format is @SkillRoll[skill name | alt skill name / CHR #+]{Custom Text}. For example, this string @SkillRoll[Zero-G/DEX 10+]{Zero-G Test} creates a button label 'Zero-G Test' and rolls a skill check for the Zero-G skill using dexterity characteristic and a difficulty threshold of 10+ (very difficult or difficult - depending on rules). Note that the characteristic and difficulty terms are optional. The skill's default values for characteristic modifier and difficulty are used when nothing is specified in the formula.

If None is entered for the skill, the click will make a characteristic roll. The CHR string should be the abbreviation shown on the actor sheet. So if the characteristic label has been customized, use that custom label in the formula.

For difficulty values that are odd, e.g. 5+, the code chooses the next highest difficulty and adds a custom +1 DM. A player's default character is used for the skill roll actor/context data. As a GM, the selected character is used for the roll.