dnd-npc-generator / src /content.py
Jordancole21's picture
Deploy native Gradio SEO page and tool
1d5c3e4 verified
Raw
History Blame Contribute Delete
9.36 kB
"""Page copy: how-to, article sections, example intro, FAQs. One H1 lives in the hero."""
HOW_TO_HTML = """
<p>This free <strong>DnD NPC generator</strong> builds non-player characters for the
person who has to run them: the Dungeon Master. Instead of a name and three adjectives,
every result is a complete, table-ready character β€” a performable voice, a motive that
drives scenes, named relationships, a secret, and three plot hooks you can drop into
your next session. It works for 5e and the 2024 rules, runs right on this page, and
needs no signup.</p>
<ol>
<li><strong>Describe the slot you need filled.</strong> Every field is optional. Give a
role ("harbor-master", "fence", "village priest"), or a location, or just what the party
needs from them β€” the generator fills in the rest.</li>
<li><strong>Set their importance.</strong> Background NPCs get local, small-stakes hooks;
Recurring NPCs get an agenda that advances between meetings; Major NPCs get
campaign-relevant secrets built to escalate across an arc.</li>
<li><strong>Pick a demeanor, or don't.</strong> Friendly, gruff, scheming, weary β€” a
single word here shapes the whole performance. Leave it blank and the generator chooses
something that fits the role.</li>
<li><strong>Generate, then run them.</strong> You get a structured NPC sheet, not a wall
of prose. Copy the Markdown into your prep notes or download the file, and hit
Regenerate until the character feels right. The Surprise Me button rolls a role, race,
importance, and demeanor for you.</li>
</ol>
"""
INCLUDES_HTML = """
<p>Most random NPC tools stop at a name and a personality trait. That is the part of NPC
creation that was never hard. The hard part is the moment your players decide the
weigh-clerk is interesting and you have to <em>be</em> him for twenty minutes. Every NPC
this tool generates includes the fields that survive contact with a party:</p>
<ul>
<li><strong>Name and role title</strong> β€” not "merchant" but "Weigh-Clerk of the Salt
Exchange." A specific title tells your players where this person fits in the world
before they say a word.</li>
<li><strong>Appearance</strong> you can read aloud β€” two to four sentences of concrete
physical detail, no stat-block prose.</li>
<li><strong>A performable voice and mannerism.</strong> This is the field that makes an
NPC playable rather than describable. Never "sounds mysterious" β€” instead, "drops the
ends of sentences, taps coins on the counter while listening." An accent, a cadence, and
one physical tic you can actually do at the table.</li>
<li><strong>Personality and motivation</strong> β€” how they treat strangers, and what
they want <em>right now</em>. Motivation is what makes an NPC answer questions the way
they do; without it you're improvising a mood, not a person.</li>
<li><strong>A secret</strong> the party doesn't know, built to surface in play rather
than sit in your notes.</li>
<li><strong>Named relationships</strong> β€” two or three specific people or factions with
the current state of each. Relationships are how one NPC quietly becomes three sessions
of content.</li>
<li><strong>A quote in their voice</strong>, so you can hear them before you perform
them.</li>
<li><strong>Exactly three plot hooks</strong> β€” concrete scenes or complications
involving this NPC, each specific enough to run: a passage they control, an audit that
implicates a patron, a syndicate buying up a son's debts.</li>
<li><strong>A stat suggestion</strong> pointing at an SRD block to borrow ("use
Commoner; if pressed, Spy") so you never build a stat block for someone who might only
get one scene.</li>
<li><strong>A three-sentence quick reference</strong> for the DM screen β€” who they are,
what they want, how to play them.</li>
</ul>
"""
EXAMPLE_INTRO_HTML = """
<p>Here is a complete, unedited output from this generator. The inputs were: role
"canal lock-keeper", importance Recurring, demeanor Gruff β€” everything else left
blank.</p>
"""
RUN_AT_TABLE_HTML = """
<p>A generated NPC earns its place the moment your players talk to it. A few habits
turn a good sheet into a good scene:</p>
<ul>
<li><strong>Anchor the voice to the tic.</strong> You will forget an accent halfway
through a tense negotiation; you will not forget a physical habit. Do the tic first β€”
tap the keys, wipe the counter, crack the knuckles β€” and the voice follows. If you lose
the accent, keep the cadence: dropped sentence-endings survive even when the drawl
doesn't.</li>
<li><strong>Play the motivation, not the plot.</strong> When players ask something you
didn't prep, answer as someone who wants what the motivation says they want. The
lock-keeper who is saving to buy her lock answers every question through that lens β€”
what does this cost me, what is it worth to you.</li>
<li><strong>Let the hooks collide with the party's goals.</strong> Don't schedule the
three plot hooks; hold them until the party wants something. The moment they need to
move cargo quietly is the moment the night-passage under the lock becomes an offer with
a price. Hooks land hardest when the party walks into them.</li>
<li><strong>Reuse before you generate.</strong> The fastest way to make a world feel
alive is for the fence from session two to be the person the party needs in session
nine. A recurring face with an advancing agenda beats three new strangers. Keep every
generated NPC β€” the quick-reference field exists so that bringing one back costs you
ten seconds of reading, not ten minutes.</li>
<li><strong>Promote the ones your players love.</strong> Players decide who matters,
and it is never who you expect. When a Background NPC gets adopted by the table,
regenerate them at Recurring or Major importance with the same role and setting, and
fold the new secret and hooks into your campaign.</li>
</ul>
"""
FAQS = [
(
"How do you make a good D&D NPC?",
"Give them three things: something they want, something they hide, and "
"something you can perform. Motivation makes their answers consistent, a secret "
"gives the DM ammunition for later, and a concrete voice or physical tic makes "
"them memorable at the table. This generator produces all three in every "
"result, plus named relationships and hooks so the NPC connects to the rest of "
"your world.",
),
(
"How do DMs keep track of NPCs across a campaign?",
"The classic failure is inventing a great NPC mid-session and losing them by "
"next week. Keep a single NPC list with a two-line entry each β€” who they are, "
"what they want, where the party left things β€” and update it right after the "
"session while it's fresh. The quick-reference field in every generated NPC is "
"written for exactly that list. Tools that turn session recordings into "
"organized notes can automate the 'right after the session' part, which is "
"where most tracking systems quietly die.",
),
(
"What stat block should an NPC use?",
"Borrow, don't build. Most NPCs never fight, and the ones that do are covered "
"by SRD blocks: Commoner for ordinary folk, Guard or Thug for muscle, Spy for "
"the competent and quiet, Bandit Captain for dangerous veterans, Mage or Priest "
"for casters. Every generated NPC includes a stat suggestion naming which "
"block to grab β€” and which to escalate to if the scene turns violent.",
),
(
"Can I generate shopkeepers, villains, and allies?",
"Yes β€” the importance setting is the lever. Background covers shopkeepers, "
"guards, and one-scene characters with small local hooks. Recurring covers "
"allies, contacts, and rivals with agendas that advance between meetings. "
"Major covers patrons and villain-grade figures whose secrets are "
"campaign-relevant. Put the specifics in the role and party-need fields and "
"the output follows.",
),
(
"How is this different from a character backstory generator?",
"A backstory generator writes a player character's past β€” history the player "
"acts from. An NPC generator writes for the DM's side of the screen: NPCs are "
"performable (voice, mannerism, quote), hook-driven (three scenes you can "
"run), and present-tense (what they want now, not what happened to them at "
"twelve). If you need a player character's history, use our backstory "
"generator linked below instead.",
),
(
"Can I reuse an NPC across campaigns?",
"Absolutely β€” good NPCs are portable. Download the Markdown and keep a "
"personal roster; when a new campaign needs a fence or a ferryman, lift one "
"you already know how to play and swap the named relationships for local "
"ones. The voice and motivation travel intact; only the connections need "
"re-wiring.",
),
(
"Does it support homebrew settings?",
"Yes. Put your setting in the campaign-setting field β€” a sentence is enough "
"(\"floating archipelago ruled by cartographer-priests\") β€” and names, "
"factions, and hooks will be invented to fit it. Add a faction or place name "
"in the notes field if you want it woven in directly.",
),
]