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: 5905675" data-attributes="member: 8835"><p>ah yes, that's Dependency checking in developer parlance. the inifinite loop test helps detect that. Because we can collate the entire chain of tags an Asset has relations to, we can then verify that they all exist.</p><p></p><p>Additionally, we can allow for the Parser to ignore tags that it cannot resolve (find an Assset for). So if it found [JanxTable1] in the text, but no such table existed, it would leave that tag in place in the output. It'll be pretty obvious to the user what happened.</p><p></p><p>For a developer specification, I think you'll need:</p><ul> <li data-xf-list-type="ul">glossary of terms</li> <li data-xf-list-type="ul">DB table definitions</li> <li data-xf-list-type="ul">screen explanations and sketches</li> <li data-xf-list-type="ul">use case/user stories of usage examples</li> <li data-xf-list-type="ul">syntax of Tags/Scripts</li> <li data-xf-list-type="ul">syntax for Tables in Asset Body (what are the delimiters, structure for defining a table, similar to TableSmith or other tools</li> <li data-xf-list-type="ul">syntax for Blocks in Asset Body (does it allow html or vBulletin formatting, etc)<br /> Parser flow chart/ pseudo-code explanation of its process</li> </ul><p></p><p>For the parser, here's the basic pseudo code:</p><p></p><p>[code]function string ParseText(string Input) {</p><p> string Output = Input;</p><p> List<Tag> arrTags = GetAllTags(Input);</p><p> foreach(Tag t in arrrTags) {</p><p> Output = t.ExecuteTag(Output);</p><p> } //end of looping on arrTags</p><p> return Output ;</p><p>}</p><p></p><p>class Tag {</p><p> //properties and stuff would be defined here.</p><p> function string ExecuteTag(string Output) {</p><p> string result = this.TagValue;</p><p> switch (Tag.Type) {</p><p> case "Asset":</p><p> result = this.ExecuteAsset();</p><p> break;</p><p> case "Script":</p><p> result = this.ExecuteScript();</p><p> break; </p><p> } //end of switching on tag type</p><p> </p><p> this.UpdateOutputforTag(result,Output);</p><p></p><p> return Output;</p><p> }</p><p>}</p><p></p><p>function string ExecuteAsset() {</p><p> string result = this.GetAssetResult();</p><p> </p><p> result = ParseText(result);</p><p></p><p> return result;</p><p>}</p><p></p><p>[/code]</p><p></p><p>the ExecuteAsset() function would go look up the Asset in the asset library, and do a table result or block result and call ParseText() on that result before returning it.</p><p></p><p>the ExecuteScript would be similar, but do whatever script parsing meant.</p><p></p><p>This is all just pseudo-code. Not entirely correct, but shows the gist of the process for a programmer to follow.</p></blockquote><p></p>
[QUOTE="Janx, post: 5905675, member: 8835"] ah yes, that's Dependency checking in developer parlance. the inifinite loop test helps detect that. Because we can collate the entire chain of tags an Asset has relations to, we can then verify that they all exist. Additionally, we can allow for the Parser to ignore tags that it cannot resolve (find an Assset for). So if it found [JanxTable1] in the text, but no such table existed, it would leave that tag in place in the output. It'll be pretty obvious to the user what happened. For a developer specification, I think you'll need: [LIST] [*]glossary of terms [*]DB table definitions [*]screen explanations and sketches [*]use case/user stories of usage examples [*]syntax of Tags/Scripts [*]syntax for Tables in Asset Body (what are the delimiters, structure for defining a table, similar to TableSmith or other tools [*]syntax for Blocks in Asset Body (does it allow html or vBulletin formatting, etc) Parser flow chart/ pseudo-code explanation of its process [/LIST] For the parser, here's the basic pseudo code: [code]function string ParseText(string Input) { string Output = Input; List<Tag> arrTags = GetAllTags(Input); foreach(Tag t in arrrTags) { Output = t.ExecuteTag(Output); } //end of looping on arrTags return Output ; } class Tag { //properties and stuff would be defined here. function string ExecuteTag(string Output) { string result = this.TagValue; switch (Tag.Type) { case "Asset": result = this.ExecuteAsset(); break; case "Script": result = this.ExecuteScript(); break; } //end of switching on tag type this.UpdateOutputforTag(result,Output); return Output; } } function string ExecuteAsset() { string result = this.GetAssetResult(); result = ParseText(result); return result; } [/code] the ExecuteAsset() function would go look up the Asset in the asset library, and do a table result or block result and call ParseText() on that result before returning it. the ExecuteScript would be similar, but do whatever script parsing meant. This is all just pseudo-code. Not entirely correct, but shows the gist of the process for a programmer to follow. [/QUOTE]
Insert quotes…
Verification
Post reply
Community
General Tabletop Discussion
*TTRPGs General
Designing a Random Table Generator
Top