Skip to content

Sequential dice rolls with variable storage for template generation #384

@morinibh

Description

@morinibh

Scope

Scope

Add support for sequential dice roll evaluation with temporary variable storage during template instantiation.

Why is it needed?

Currently, dice rolls in templates execute independently and cannot reference each other's results. This prevents conditional random generation where one roll should determine which table to use for subsequent rolls.

Example use case: Rolling a character faction first, then using that result to roll a faction-specific name from the appropriate table.

Without this feature, users must either:

  • Manually roll multiple properties and delete unused ones
  • Use DataviewJS (losing dice roller syntax elegance)
  • Use additional plugins like Templater

This feature would enable true sequential, dependent random generation during template creation.

Discovery

Proposed Change

Add syntax for storing dice roll results in temporary variables that can be referenced by subsequent rolls:

faction: `dice-mod: [[Table^faction]]|faction`
name: `dice-mod: [[Table^$faction]]`

How it works:

  1. First roll executes: [[Table^faction]] returns "Warrior"
  2. Result is stored in temporary variable faction
  3. Second roll executes: [[Table^$faction]] becomes [[Table^Warrior]]

Validate

not validated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions