Menu
News
All News
Dungeons & Dragons
Level Up: Advanced 5th Edition
Pathfinder
Starfinder
Warhammer
2d20 System
Year Zero Engine
Industry News
Reviews
Dragon Reflections
Columns
Weekly Digests
Weekly News Digest
Freebies, Sales & Bundles
RPG Print News
RPG Crowdfunding News
Game Content
ENterplanetary DimENsions
Mythological Figures
Opinion
Worlds of Design
Peregrine's Next
RPG Evolution
Other Columns
From the Freelancing Frontline
Monster ENcyclopedia
WotC/TSR Alumni Look Back
4 Hours w/RSD (Ryan Dancey)
The Road to 3E (Jonathan Tweet)
Greenwood's Realms (Ed Greenwood)
Drawmij's TSR (Jim Ward)
Community
Forums & Topics
Forum List
Latest Posts
Forum list
*Dungeons & Dragons
Level Up: Advanced 5th Edition
D&D Older Editions
*TTRPGs General
*Pathfinder & Starfinder
EN Publishing
*Geek Talk & Media
Search forums
Chat/Discord
Resources
Wiki
Pages
Latest activity
Media
New media
New comments
Search media
Downloads
Latest reviews
Search resources
EN Publishing
Store
EN5ider
Adventures in ZEITGEIST
Awfully Cheerful Engine
What's OLD is NEW
Judge Dredd & The Worlds Of 2000AD
War of the Burning Sky
Level Up: Advanced 5E
Events & Releases
Upcoming Events
Private Events
Featured Events
Socials!
Twitch
YouTube
Facebook (EN Publishing)
Facebook (EN World)
Twitter
Instagram
TikTok
Podcast
Features
Top 5 RPGs Compiled Charts 2004-Present
Adventure Game Industry Market Research Summary (RPGs) V1.0
Ryan Dancey: Acquiring TSR
Q&A With Gary Gygax
D&D Rules FAQs
TSR, WotC, & Paizo: A Comparative History
D&D Pronunciation Guide
Million Dollar TTRPG Kickstarters
Tabletop RPG Podcast Hall of Fame
Eric Noah's Unofficial D&D 3rd Edition News
D&D in the Mainstream
D&D & RPG History
About Morrus
Log in
Register
What's new
Search
Search
Search titles only
By:
Forums & Topics
Forum List
Latest Posts
Forum list
*Dungeons & Dragons
Level Up: Advanced 5th Edition
D&D Older Editions
*TTRPGs General
*Pathfinder & Starfinder
EN Publishing
*Geek Talk & Media
Search forums
Chat/Discord
Menu
Log in
Register
Install the app
Install
The
VOIDRUNNER'S CODEX
is coming! Explore new worlds, fight oppressive empires, fend off fearsome aliens, and wield deadly psionics with this comprehensive boxed set expansion for 5E and A5E!
Community
General Tabletop Discussion
*TTRPGs General
Non-evocative Names
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="MNblockhead" data-source="post: 9325586" data-attributes="member: 6796661"><p>So I asked ChatGPT to just create a FoundryVTT script macro version of the PowerShell script and it did. And it works. </p><p></p><p>[ATTACH=full]359616[/ATTACH]</p><p></p><p>The only thing I didn't like is that it lists common names multiple times in the script so that they are more likely to be rolled. I had ChatGPT rewrite it with weighted values. Which it did. Now, this is a simple script, but by having ChatGPT generate the code I can have a weighted list of hundreds of surnames and hundreds of given names and not have to waste my time copy-pasting or typing them in. </p><p></p><p>The macro script is below for those interest. I kept the number of names low so the script isn't crazy long. </p><p></p><p>[CODE=javascript]let firstNames = {</p><p> "Sigtrygg": 1,</p><p> "Thor": 10,</p><p> "Erik": 10,</p><p> "Harald": 5,</p><p> "Egil": 5,</p><p> "Ragnar": 5,</p><p> "Sven": 5,</p><p> "Bjorn": 5,</p><p> "Alrik": 5,</p><p> "Gudmund": 5,</p><p> "Leif": 5,</p><p> "Vidkun": 5,</p><p> "Sigurd": 5,</p><p> "Ivar": 5,</p><p> "Hrani": 5,</p><p> "Hilding": 5,</p><p> "Olaf": 5,</p><p> "Gunnar": 5,</p><p> "Thorbrand": 5</p><p>};</p><p></p><p>let surnames = {</p><p> "Hrafnsson": 1,</p><p> "Eiriksson": 10,</p><p> "Thorsson": 10,</p><p> "Haraldsson": 5,</p><p> "Egilsson": 5,</p><p> "Ragnarsson": 5,</p><p> "Svennsson": 5,</p><p> "Bjornsson": 5,</p><p> "Alriksson": 5,</p><p> "Gudmundsson": 5,</p><p> "Leifsson": 5,</p><p> "Vidkunsson": 5,</p><p> "Sigurdsson": 5,</p><p> "Ivarsson": 5,</p><p> "Hranisson": 5,</p><p> "Hildingsson": 5,</p><p> "Olafsson": 5,</p><p> "Gunnarsson": 5,</p><p> "Thorbrandsson": 5</p><p>};</p><p></p><p>// Calculate the total weights for first names and surnames</p><p>let totalFirstNamesWeight = Object.values(firstNames).reduce((a, b) => a + b, 0);</p><p>let totalSurnamesWeight = Object.values(surnames).reduce((a, b) => a + b, 0);</p><p></p><p>// Generate a random number between 1 and the total weights</p><p>let randomFirstNameNumber = Math.floor(Math.random() * totalFirstNamesWeight) + 1;</p><p>let randomSurnameNumber = Math.floor(Math.random() * totalSurnamesWeight) + 1;</p><p></p><p>// Function to find the name based on the random number</p><p>function findName(names, randomNumber) {</p><p> let cumulativeWeight = 0;</p><p> for (let name in names) {</p><p> cumulativeWeight += names[name];</p><p> if (randomNumber <= cumulativeWeight) {</p><p> return name;</p><p> }</p><p> }</p><p>}</p><p></p><p>// Retrieve the first name and surname based on the random numbers</p><p>let firstName = findName(firstNames, randomFirstNameNumber);</p><p>let surname = findName(surnames, randomSurnameNumber);</p><p></p><p>// Output the generated full name</p><p>ChatMessage.create({</p><p> content: `Generated Norse Name: ${firstName} ${surname}`</p><p>});</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="MNblockhead, post: 9325586, member: 6796661"] So I asked ChatGPT to just create a FoundryVTT script macro version of the PowerShell script and it did. And it works. [ATTACH type="full" width="493px"]359616[/ATTACH] The only thing I didn't like is that it lists common names multiple times in the script so that they are more likely to be rolled. I had ChatGPT rewrite it with weighted values. Which it did. Now, this is a simple script, but by having ChatGPT generate the code I can have a weighted list of hundreds of surnames and hundreds of given names and not have to waste my time copy-pasting or typing them in. The macro script is below for those interest. I kept the number of names low so the script isn't crazy long. [CODE=javascript]let firstNames = { "Sigtrygg": 1, "Thor": 10, "Erik": 10, "Harald": 5, "Egil": 5, "Ragnar": 5, "Sven": 5, "Bjorn": 5, "Alrik": 5, "Gudmund": 5, "Leif": 5, "Vidkun": 5, "Sigurd": 5, "Ivar": 5, "Hrani": 5, "Hilding": 5, "Olaf": 5, "Gunnar": 5, "Thorbrand": 5 }; let surnames = { "Hrafnsson": 1, "Eiriksson": 10, "Thorsson": 10, "Haraldsson": 5, "Egilsson": 5, "Ragnarsson": 5, "Svennsson": 5, "Bjornsson": 5, "Alriksson": 5, "Gudmundsson": 5, "Leifsson": 5, "Vidkunsson": 5, "Sigurdsson": 5, "Ivarsson": 5, "Hranisson": 5, "Hildingsson": 5, "Olafsson": 5, "Gunnarsson": 5, "Thorbrandsson": 5 }; // Calculate the total weights for first names and surnames let totalFirstNamesWeight = Object.values(firstNames).reduce((a, b) => a + b, 0); let totalSurnamesWeight = Object.values(surnames).reduce((a, b) => a + b, 0); // Generate a random number between 1 and the total weights let randomFirstNameNumber = Math.floor(Math.random() * totalFirstNamesWeight) + 1; let randomSurnameNumber = Math.floor(Math.random() * totalSurnamesWeight) + 1; // Function to find the name based on the random number function findName(names, randomNumber) { let cumulativeWeight = 0; for (let name in names) { cumulativeWeight += names[name]; if (randomNumber <= cumulativeWeight) { return name; } } } // Retrieve the first name and surname based on the random numbers let firstName = findName(firstNames, randomFirstNameNumber); let surname = findName(surnames, randomSurnameNumber); // Output the generated full name ChatMessage.create({ content: `Generated Norse Name: ${firstName} ${surname}` }); [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Community
General Tabletop Discussion
*TTRPGs General
Non-evocative Names
Top