This package contains art, text, or software code produced using generative AI.
# Narrative Encounter Enhancer
**A Foundry VTT module that transforms mundane encounter rolls into vivid, flavorful narrative descriptions using the OpenAI API.**
---
## 🎯 What It Does
When a GM rolls on a rollable table (e.g., random encounter tables) located in a folder labeled *"Encounters"*, this module:
- Detects the roll automatically.
- Adds an **"Enhance Encounter"** button to the resulting chat message (GM only).
- On click, opens a dialog that lets the GM optionally provide additional context.
- Sends the result (plus optional context) to OpenAI and whispers a vivid, short encounter narrative back to the GM in the chat log.
---
## 🔧 Features
- 🧠 **AI-enhanced output** using OpenAI's GPT models.
- ✍️ **Customizable prompt** using a template that includes your encounter-table text.
- 🎲 **Rolls Number Encountered** if your result includes a rollable formula like 1d3, 2d4, etc.
- 🌍 **World / region context** support to reflect your campaign setting.
- 🧱 **Genre presets** like Sword & Sorcery, Grimdark, Noblebright, etc.
- 🧪 Only triggers for tables stored in folders with “encounter” in the name (including nested folders).
- 👁️ **GM-only visibility**: Only the GM sees the "Enhance Encounter" button and response.