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: 5903485" data-attributes="member: 8835"><p>a topic after my own heart.</p><p></p><p>you're basically needing a table definition language and a macro language to engage it.</p><p></p><p>An old DOS tool I used call Campaign Manager had this.</p><p></p><p>So you could easily define basic tables, and use the macro language to make some of the line items in the table cascade to another table, etc.</p><p></p><p>the foundation should actually be a macro language that you can embed in other text (like an adventure document). I'm not quite sure where the final usage would be, maybe a big text box users can paste their adventure in?</p><p></p><p>Anyway, the macro language is basically interruptions in normal text/html that your engine can detect and replace with the correct content after processing.</p><p></p><p>Much like your example:</p><p>[FIRSTNAME] [LASTNAME] is a [GENDER] [RACE] of [AGE] age. </p><p>There are [1d6] [CR1MONSTER] in the room.</p><p></p><p>The table entries are in effect interpreted text, so you can have a row in the table call up another macro that might be another table.</p><p></p><p>Because you want to consider a variety of uses for your macro language, you'll want to define the syntax to be robust enough to handle future uses, but not so complicated nobody can use it.</p><p></p><p>what you've demonstrated so far is:</p><p>macros are enclosed in brackets (perhaps to differentiate from html)</p><p>[table:TABLENAME] will output the result from a table</p><p>[1d6] will cause it to output the result from a dice roll specification</p><p>[1d6 table:TABLENAME] will cause it to output 1d6 results from the table</p><p>[result=table:TABLENAME] will create a variable called result and put the outcome of TABLENAME and output it[result] will output the value of result</p><p>[?result=table:TABLENAME] will create a variable called result and put the outcome of TABLENAME but and not output it (you might not want it yet in your text)</p><p>[table:TABLENAME:result] will output the result from a table by looking up result in the table.</p><p></p><p>This syntax is a bit more complicated, but it opens up more correct possibilities like:</p><p>[table:FIRSTNAME] [table:LASTNAME] is a [table:GENDER] [result=table:RACE] of [table:AGE:result] age. </p><p></p><p>Compared to Morrus's example, this is more correct because Age is affected by Race (elves live longer, so the valid ages should be different).</p><p></p><p>I don't like prefixing table names with table:, but it's good to have a clear syntax that makes it easier to parse. You could rule that all variables are prefixed with $ like the old Basic used to be. That would actually simplify things.</p><p></p><p>[FIRSTNAME] [LASTNAME] is a [GENDER] [$race=RACE] of [AGE$race] age. </p><p></p><p>this makes it like Morrus's example, but allows for easy detection of variables. Starting with a $ means it's a variable. An equal sign indicates an assignment to a variable, and a $ in the middle of the table name indicates to use that variable.</p><p></p><p>From there comes the table definition syntax. the old CM program I mentioned chose numbers randomly from a range. To do a multi-die effect (like 2d10), you'd have to calculate where to put the numbers:</p><p></p><p>RACE:2d10</p><p>2: Elf</p><p>5:Human</p><p>10:Gnome</p><p>15<img src="https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f600.png" class="smilie smilie--emoji" loading="lazy" width="64" height="64" alt=":D" title="Big grin :D" data-smilie="8"data-shortname=":D" />warf</p><p>17:Half-Elf</p><p>18:Halfling</p><p>20: Half-Orc</p><p></p><p>Anything equal or less than but greater than the previous was a match.</p><p></p><p>Note, the conundrum of the concept of using a variable to get from Race to Age. There's index (or key) for the table is numbers only.</p><p></p><p>Let's modify our syntax one more time to allow for passing a number into the table instead of rolling, versus generating the name of a table.</p><p>[TABLENAME$VARNAME] concatenates the two to use a different table named by the combination thereof. [AGE$race] where $race=Elf means to use the AGEElf table.</p><p></p><p>[TABLENAME:$VARNAME] means to return the result as if the value of $VARNAME had been rolled. thus [AGE:20] or [AGE:$val] where $val=20 would return the result where a 20 had been rolled on the table.</p><p></p><p>PS. Make this macro language be case-insensitive. It's too easy for humans to goof that up and not worth the hassle. When in doubt, force macro strings to uppercase when interpeting them.</p></blockquote><p></p>
[QUOTE="Janx, post: 5903485, member: 8835"] a topic after my own heart. you're basically needing a table definition language and a macro language to engage it. An old DOS tool I used call Campaign Manager had this. So you could easily define basic tables, and use the macro language to make some of the line items in the table cascade to another table, etc. the foundation should actually be a macro language that you can embed in other text (like an adventure document). I'm not quite sure where the final usage would be, maybe a big text box users can paste their adventure in? Anyway, the macro language is basically interruptions in normal text/html that your engine can detect and replace with the correct content after processing. Much like your example: [FIRSTNAME] [LASTNAME] is a [GENDER] [RACE] of [AGE] age. There are [1d6] [CR1MONSTER] in the room. The table entries are in effect interpreted text, so you can have a row in the table call up another macro that might be another table. Because you want to consider a variety of uses for your macro language, you'll want to define the syntax to be robust enough to handle future uses, but not so complicated nobody can use it. what you've demonstrated so far is: macros are enclosed in brackets (perhaps to differentiate from html) [table:TABLENAME] will output the result from a table [1d6] will cause it to output the result from a dice roll specification [1d6 table:TABLENAME] will cause it to output 1d6 results from the table [result=table:TABLENAME] will create a variable called result and put the outcome of TABLENAME and output it[result] will output the value of result [?result=table:TABLENAME] will create a variable called result and put the outcome of TABLENAME but and not output it (you might not want it yet in your text) [table:TABLENAME:result] will output the result from a table by looking up result in the table. This syntax is a bit more complicated, but it opens up more correct possibilities like: [table:FIRSTNAME] [table:LASTNAME] is a [table:GENDER] [result=table:RACE] of [table:AGE:result] age. Compared to Morrus's example, this is more correct because Age is affected by Race (elves live longer, so the valid ages should be different). I don't like prefixing table names with table:, but it's good to have a clear syntax that makes it easier to parse. You could rule that all variables are prefixed with $ like the old Basic used to be. That would actually simplify things. [FIRSTNAME] [LASTNAME] is a [GENDER] [$race=RACE] of [AGE$race] age. this makes it like Morrus's example, but allows for easy detection of variables. Starting with a $ means it's a variable. An equal sign indicates an assignment to a variable, and a $ in the middle of the table name indicates to use that variable. From there comes the table definition syntax. the old CM program I mentioned chose numbers randomly from a range. To do a multi-die effect (like 2d10), you'd have to calculate where to put the numbers: RACE:2d10 2: Elf 5:Human 10:Gnome 15:Dwarf 17:Half-Elf 18:Halfling 20: Half-Orc Anything equal or less than but greater than the previous was a match. Note, the conundrum of the concept of using a variable to get from Race to Age. There's index (or key) for the table is numbers only. Let's modify our syntax one more time to allow for passing a number into the table instead of rolling, versus generating the name of a table. [TABLENAME$VARNAME] concatenates the two to use a different table named by the combination thereof. [AGE$race] where $race=Elf means to use the AGEElf table. [TABLENAME:$VARNAME] means to return the result as if the value of $VARNAME had been rolled. thus [AGE:20] or [AGE:$val] where $val=20 would return the result where a 20 had been rolled on the table. PS. Make this macro language be case-insensitive. It's too easy for humans to goof that up and not worth the hassle. When in doubt, force macro strings to uppercase when interpeting them. [/QUOTE]
Insert quotes…
Verification
Post reply
Community
General Tabletop Discussion
*TTRPGs General
Designing a Random Table Generator
Top