Menu
News
All News
Dungeons & Dragons
Level Up: Advanced 5th Edition
Pathfinder
Starfinder
Warhammer
2d20 System
Year Zero Engine
Industry News
Reviews
Dragon Reflections
White Dwarf 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 Nest
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!
EN Publishing
Twitter
BlueSky
Facebook
Instagram
EN World
BlueSky
YouTube
Facebook
Twitter
Twitch
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
Community
General Tabletop Discussion
*TTRPGs General
Designing a Random Table Generator
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="Janx" data-source="post: 5904833" data-attributes="member: 8835"><p>more hopefully clear techno-babble:</p><p></p><p>I may have missed a point, given this stuff gets long and hard to see the scope of my own thesis...</p><p></p><p></p><p>The Parsing Engine is a generic piece of code that should be fed input from any source. Be it Wiki, chat room post, new post from the forum, etc. It should not be cognizant of where the text came from, it just parses it and performs the actions the Lookup and Script tags tell it to.</p><p></p><p>As I explained in the long-winded example, with the way this thing will be implemented, you're not likely to suffer a problem from an infinite loop as 2 tables refer to each other. The recursive nature of the parsing will cause a stack overflow and the Try..Catch block wrapping the entire thing will clean up the mess.</p><p></p><p>Scripting is where you are likely to have security risks and true infinite loop problems. Once the scripting languages get into being able to define loops, that's where it will get nuts.</p><p></p><p>But don't worry about that yet. Depending on what the scripting language enables, will determine your risk.</p><p></p><p>When I say scripting, I mean any of the wierd stuff that people who like Programming will use, that normal people may not fully understand.</p><p></p><p>calling for a dice roll is probably the simplest. It requires a notation that is a directive to execute and produce a result. {1d6} is pretty easy, and the internet should be chock-full of code that can parse that and produce the result.</p><p></p><p>Things get more complicated when you need to lookup on a table 1d6 times.</p><p>{1d6 [Dragon]} would tell it to roll 1d6, and lookup the Dragon table that many times.</p><p></p><p>Just that simple fragment has complexity. The space between 1d6 and the [Dragon] tag is easily detected and we can tell that a quanity is required.</p><p></p><p>But what of the results. Say we roll a 4. How do you want me to display the results? Comma delimited? Or one per line. That's not so obvious. And remember, this markup may be in the middle of a sentence. One per line would wreck the sentence. Comma delimited would work best for simple results.</p><p></p><p>Example</p><p>Let's see {1d6 [Dragon]} right now.</p><p>produces:</p><p>Let's see Ancient Blue Dragon, Young Red Dragon, Old Yellow Dragon right now.</p><p></p><p>But what if the Dragon table produces stat blocks, not just name of dragons.</p><p></p><p>we might need a way to indicate that we want comma delimited, or a new line per result.</p><p></p><p>That's where functions might come in (just making this stuff up, so it may be rough):</p><p></p><p>{1d6 Commatize([Dragon])} would produce the results with comma seperators</p><p></p><p>{1d6 NewLine([Dragon])} would produce the results with a new line after each result.</p><p></p><p>Then, let's get into variables. Variables let us temporarily stash a value and then use it someplace else. Including to construct the name of another table.</p><p></p><p>Let's say we have a CR1Monster table and stat blocks for each (i'm onluy going to do one).</p><p></p><p>[code]TABLE CR1Monster:1d4</p><p>1: Orc</p><p>2: Elf</p><p>3: Goblin</p><p>4: Flumph</p><p>ENDTABLE</p><p></p><p>BLOCK OrcStatblock</p><p>Orc</p><p>Likes eating elf meat. Uses a sword.</p><p>AC: 8</p><p>Attack: +2, 1d8+2</p><p>HP: {1d8}</p><p>ENDBLOCK[/code]</p><p></p><p>With that table and stat blocks created, I can do cool magic in a wiki or forum post.</p><p></p><p>I can type up flavor text in a PBP game like:</p><p>[GM]You enter the room and see a {$monstername=[CR1Monster]}. It is ready to attack. Here are it's stats:</p><p>{Lookup($monstername+"StatBlock")}[/GM]</p><p></p><p>and after the Parsing engine manipulates it before it saves to the forum, it would then show up to everybody in my post as:</p><p>[GM]You enter the room and see a Orc. It is ready to attack. Here are it's stats:</p><p>Orc</p><p>Likes eating elf meat. Uses a sword.</p><p>AC: 8</p><p>Attack: +2, 1d8+2</p><p>HP: 7</p><p>[/GM]</p><p></p><p>If you follow what's happened, I stashed the result from looking up a CR1Monster into a variable called $monstername. I then used that to programmatically declare the next thing to lookup which was "OrcStatBlock".</p><p></p><p>I can't do that without a variable.</p></blockquote><p></p>
[QUOTE="Janx, post: 5904833, member: 8835"] more hopefully clear techno-babble: I may have missed a point, given this stuff gets long and hard to see the scope of my own thesis... The Parsing Engine is a generic piece of code that should be fed input from any source. Be it Wiki, chat room post, new post from the forum, etc. It should not be cognizant of where the text came from, it just parses it and performs the actions the Lookup and Script tags tell it to. As I explained in the long-winded example, with the way this thing will be implemented, you're not likely to suffer a problem from an infinite loop as 2 tables refer to each other. The recursive nature of the parsing will cause a stack overflow and the Try..Catch block wrapping the entire thing will clean up the mess. Scripting is where you are likely to have security risks and true infinite loop problems. Once the scripting languages get into being able to define loops, that's where it will get nuts. But don't worry about that yet. Depending on what the scripting language enables, will determine your risk. When I say scripting, I mean any of the wierd stuff that people who like Programming will use, that normal people may not fully understand. calling for a dice roll is probably the simplest. It requires a notation that is a directive to execute and produce a result. {1d6} is pretty easy, and the internet should be chock-full of code that can parse that and produce the result. Things get more complicated when you need to lookup on a table 1d6 times. {1d6 [Dragon]} would tell it to roll 1d6, and lookup the Dragon table that many times. Just that simple fragment has complexity. The space between 1d6 and the [Dragon] tag is easily detected and we can tell that a quanity is required. But what of the results. Say we roll a 4. How do you want me to display the results? Comma delimited? Or one per line. That's not so obvious. And remember, this markup may be in the middle of a sentence. One per line would wreck the sentence. Comma delimited would work best for simple results. Example Let's see {1d6 [Dragon]} right now. produces: Let's see Ancient Blue Dragon, Young Red Dragon, Old Yellow Dragon right now. But what if the Dragon table produces stat blocks, not just name of dragons. we might need a way to indicate that we want comma delimited, or a new line per result. That's where functions might come in (just making this stuff up, so it may be rough): {1d6 Commatize([Dragon])} would produce the results with comma seperators {1d6 NewLine([Dragon])} would produce the results with a new line after each result. Then, let's get into variables. Variables let us temporarily stash a value and then use it someplace else. Including to construct the name of another table. Let's say we have a CR1Monster table and stat blocks for each (i'm onluy going to do one). [code]TABLE CR1Monster:1d4 1: Orc 2: Elf 3: Goblin 4: Flumph ENDTABLE BLOCK OrcStatblock Orc Likes eating elf meat. Uses a sword. AC: 8 Attack: +2, 1d8+2 HP: {1d8} ENDBLOCK[/code] With that table and stat blocks created, I can do cool magic in a wiki or forum post. I can type up flavor text in a PBP game like: [GM]You enter the room and see a {$monstername=[CR1Monster]}. It is ready to attack. Here are it's stats: {Lookup($monstername+"StatBlock")}[/GM] and after the Parsing engine manipulates it before it saves to the forum, it would then show up to everybody in my post as: [GM]You enter the room and see a Orc. It is ready to attack. Here are it's stats: Orc Likes eating elf meat. Uses a sword. AC: 8 Attack: +2, 1d8+2 HP: 7 [/GM] If you follow what's happened, I stashed the result from looking up a CR1Monster into a variable called $monstername. I then used that to programmatically declare the next thing to lookup which was "OrcStatBlock". I can't do that without a variable. [/QUOTE]
Insert quotes…
Verification
Post reply
Community
General Tabletop Discussion
*TTRPGs General
Designing a Random Table Generator
Top