module

Hero vs. Villain Points

Endorsements
0
Installs
0.03%
Comments
0
Latest version1.4.0
Minimum Core14
Compatible Core14
File size0 B
Last updated1 month ago
Created1 year ago
Authors
Languages
Systems All systems
Project source Project URL

🎭 Hero vs. Villain Points - Foundry VTT Module

Compatible with Foundry VTT v13+ • Pathfinder 2e

Overview

A lightweight, accessible Hero vs. Villain point tracker inspired by Star Wars Destiny. The tracker renders a row of circles (configurable count) showing Hero (light) and Villain (dark) points. Clicking flips a point from one side to the other while preserving the invariant: hero + villain = total.

Features

  • Headerless, minimal UI: only circles, no extra chrome
  • Settings-driven configuration (Module Settings)
  • Live updates across all clients on every flip
  • Optional player control (Allow Players to Click)
  • Persistent world state; invariant enforced at all times
  • Foundry v13 compliant; ApplicationV2 and mergeObject usage

Installation

  • Install via Manifest (recommended):
    • Manifest URL: https://raw.githubusercontent.com/jkwitchel/foundryvtt-hero-villain-points/main/hero-villain-points/module.json
  • Or Manual Install:
    • Download the ZIP and extract to Data/modules/hero-villain-points.
    • Enable in Game Settings → Manage Modules.
  • Open the tracker with the macro:
    toggleHeroVillainTracker();
     

Module Settings (World)

  • Total Circles: number (default 7; 1–20)
  • Default Hero (light) points: number (default 4; clamped 0..Total)
  • Allow Players to Click: boolean (default false)

On first run (or if invalid), the pool seeds from defaults: hero = Default Hero, villain = Total − hero.

Changing Total Circles or Default Hero renormalizes the pool and re-renders for all clients.

Usage

  • Open the tracker window (macro above). The window shows only circles.
  • Click behavior:
    • If GM: flips the clicked index immediately and syncs to all clients.
    • If Player and Allow Players to Click is enabled: your click requests the GM to apply the flip; everyone updates live.
    • If Player and not allowed: clicks do nothing.

Behavior & Rules

  • Render N = Total Circles circles.
  • Invariant: hero + villain = N, with villain derived: villain = N − hero.
  • State is stored as a world setting and synced via onChange + a lightweight socket nudge for instant updates.

Troubleshooting

  • Ensure PF2e is installed and enabled (if you use it).
  • If you don’t see live updates, verify Allow Players to Click (for players) and that both clients have the tracker window open.

Credits

Author: Jeremy Witchel

License

MIT

Changelog

  • 1.3.0
    • Moved configuration into Module Settings (world) with: Total Circles, Default Hero, Allow Players to Click
    • Headerless, circle-only tracker window; removed in-window Configure UI
    • Live updates on every click across GM and players (GM-mediated for permission safety)
    • Enforced invariant hero + villain = total; villain derived from hero
    • Foundry v13 compliant (ApplicationV2)
  • 1.2.0
    • Foundry v13 modernization; synced via settings onChange; accessibility and styles cleanup
Subscribe
Notify of
0 Comments
0
Would love your thoughts, please comment.x
()
x