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
O.G.R.E. Instructions [wiki thread]
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="Morrus" data-source="post: 7137461" data-attributes="member: 1"><p><span style="color: #3E3E3E">EN World's <a href="http://www.enworld.org/forum/dnd_portal.php" target="_blank"><strong>Online Generic Randomizer Engine</strong></a> (OGRE) is a powerful, flexible framework to create your own random generators and share them with other EN World members. You can create anything from the very simple (a random color generator which rolls a d6 to choose a color) to something very complex (such as an entire, detailed populated village with homes and businesses).</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">This is accomplished by the creation of two types of object: <strong>tables</strong> and <strong>generators</strong>.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Once someone creates a table or a generator, it is available for use by anyone else creating their own tables and generators. In this way, generators can reference and include other generators as part of their own output. So if Bob has created a table which picks a random color such as green, blue, or red, and Alice has created a table which picks a random object, such as box, table, or book, Eric can create a generator which references both of those pre-existing tables to generate an object of a random color, such as a blue box or a green table.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">In this way you can create random generators for your tabletop gaming needs. From random elf names to potion descriptions, to entire treasure hoards and NPCs. </span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"><span style="font-size: 18px"><strong>Tables</strong></span></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"><img src="https://web.archive.org/web/20160914235550im_/http://www.enworld.org/newsimages/traps1.jpg" alt="" class="fr-fic fr-dii fr-draggable " data-size="" style="" /></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">A table is a simple chart. It contains a list of possible die rolls and a corresponding result. You've seen dozens of them in various RPG books: <a href="https://web.archive.org/web/20160914235550/http://www.enworld.org/forum/showwiki.php?title=Appendix+G:+Traps" target="_blank">here's</a> an example from the 1E DMG for AD&D, and here is the infamous <a href="https://web.archive.org/web/20160914235550/http://www.enworld.org/forum/showwiki.php?title=Random+Harlot+Table" target="_blank">Random Harlot Table</a>. In itself, a table doesn't do anything - it's simply a source of data referenced by a <strong>generator</strong> (see below). An example table looks like this:</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">1) Red</span></p><p><span style="color: #3E3E3E">2) Green</span></p><p><span style="color: #3E3E3E">3) Blue</span></p><p><span style="color: #3E3E3E">4) Yellow</span></p><p><span style="color: #3E3E3E">5) Black</span></p><p><span style="color: #3E3E3E">6) White</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">It has a dice roll on the left, and corresponding results on the right. When encountering this table, OGRE would roll 1d6 and report back a colour.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Tables aren't necessarily pretty; they're not what the user ultimately sees. A Dwarven-name generator, for example, might consist of four tables each of which just returns a random syllable. Remember, tables are just the data.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">A more complex table might involved 2d100+35 and have a vast range of resulting outputs; some of those outputs might themselves be calls to additional tables!</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"><span style="font-size: 18px"><strong>Generators</strong></span></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">A generator is what the end user actually sees and uses. Generators are lumps of text which reference tables. In essence, they are a text-based framework into which any number of random entries can be inserted. You reference a table in a generator by using its name in curly brackets. So, if the above example table is called "colors" and is created by Morrus, a very simple generator might read:<span style="color: #a52a2a">You see a Morrus(colors) box. </span></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">OGRE would then output something like: "You see a green box." </span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">A slightly longer, but still very simple generator might look like this:<span style="color: #a52a2a">After travelling for 2d6+20 days, the admin(Size) admin(Colours) level 1d20 admin(pathinderracecore) admin(pathfinderclasscore) sees admin(pathfinderdesertencounter) in the desert and admin(pathfinderforestencounter) in the forest.</span></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Which might output something like: "After travelling for 27 days, the large blue level 15 dwarf wizard sees 5 venomous snakes in the desert and 1 giant stag beetle in the forest."</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Of course, generators can be<em> much</em> more complex than this, calling on dozens of tables and formatted in various attractive or useful ways - for example, you might create a generator which generates an entire <em>Pathfinder</em> character and presents it in an attractive character sheet.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Generators use a rich-text WYSIWYG text editor to help you format your desired output, and also accept HTML for more complex table-based layout choices.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"><span style="font-size: 18px"><strong>Sharing</strong></span></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">The basic concept of OGRE is a crowd-sourced, shared data-set. Every user who creates a new table or generator adds to the overall data resource. You might create a random table of NPC elf names today, and in six month's time, someone making their village generator might call on that table for some of the NPCs. In another six months, someone creating a world generator might call on the village generator, which calls on the elven NPC name generator - and so on. You can probably imagine much larger and more complex and intricate structures than that.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Yes, there is error checking for infinite loops.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"><span style="font-size: 18px"><strong>Syntax for calling tables and generators</strong></span></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Tables and generators are called using the following syntax:</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"> <ul> <li data-xf-list-type="ul"><strong>Table:</strong> {username(tablename)}</li> <li data-xf-list-type="ul"><strong>Generator:</strong> {username[generatorname]}</li> </ul><p>Both generators and tables can call other generators and tables.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"><span style="font-size: 18px"><strong>Lookups</strong></span></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Sometimes you may need to specify the die roll <em>before</em> calling a table (perhaps you're applying modifiers to it, or want to apply the same die roll to multiple tables, or are using the table to look up specific data rather than roll). </span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"> <ul> <li data-xf-list-type="ul">The format for changing the roll output is as follows: {username(tablename)<span style="color: red">[replacedroll]</span>|capscontrol}</li> <li data-xf-list-type="ul">You can either use numbers, variables, or rolls in the "<span style="color: red">replacedroll</span>" slot.</li> <li data-xf-list-type="ul">Here are some examples:<ul> <li data-xf-list-type="ul">{admin(cave_monster)[3]} which would always give the roll result of 3.</li> <li data-xf-list-type="ul">{$x:7}{admin(cave_monster)[$x]} which would always give the result of $x, which in this case is 7.</li> <li data-xf-list-type="ul">{admin(cave_monster)[{2d6}]} which would give a number between 1 and 13.</li> </ul></li> <li data-xf-list-type="ul">It is also be possible to do math within the added roll number like so: {admin(cave_monster)[{2d6+9*$x}]}</li> </ul><p><span style="font-size: 18px"><strong>Caps Control</strong></span></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Because the creator of a table or generator never knows whether their creation will be referenced in isolation, at the start of, or in the middle of a sentence, any reference to a table/generator entry may also contain a modifying tag to alter the way it is displayed. There are four basic options: all lower-case, all upper-case, and two variations on first-letter-uppercase. </span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">The formatting for capitalization is as follows: {username(tableorblock)|capitalizationcode}</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">These are the capitalization codes:</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">|allcaps - ALL LETTERS ARE CAPITALIZED LIKE THIS.</span></p><p><span style="color: #3E3E3E">|firstcaps - The First Letter Of Each Word Is Capitalized Like This</span></p><p><span style="color: #3E3E3E">|firstcap - The first letter of the first word in the sentence is capitalized like this.</span></p><p><span style="color: #3E3E3E">|nocaps - none of the letters are capitalized like this. </span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"><span style="font-size: 18px"><strong>Integers</strong></span></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Sometimes when you perform calculations on variables you may need to drop decimal places, runs up, or round down. The format is similar to the caps functions and follows an | symbol as follows:</span></p><p><span style="color: #3E3E3E">|int (removes decimal places leaving the whole number only)</span></p><p><span style="color: #3E3E3E">|intup (round up)</span></p><p><span style="color: #3E3E3E">|inddwn (round down)</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"><span style="font-size: 18px"><strong>Putting it all together</strong></span></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">You can create as many tables and generators as you wish. Both tables and generators can reference each other, and you can freely use resources that others have created. So, if you're designing a big village generator, and somebody has already created a great tavern generator, you don't need to reinvent the wheel: you can simply call the existing tavern generator when you need it.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"><strong>Scripts</strong></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"> <ul> <li data-xf-list-type="ul"><strong>Set Variable</strong>: {$varname: value} - the $ sign is required in variable names. The "value" can be a text, a numeric value or a dice script ie:{2d6} or a single variable (even itself) +/- a numeric number ie: {$varname: {$varname+10}}.</li> <li data-xf-list-type="ul"><strong>Print Variable</strong>: {print: $varname}</li> <li data-xf-list-type="ul"><strong><strong>If/Else</strong>: </strong>{if: $varname=3} If condition text {elseif: $varname=2} Elseif condition text {else} Else condition text {/if}</li> <li data-xf-list-type="ul"><strong>Loops:</strong> {loop: 4} This text will display 4 times {/loop}</li> <li data-xf-list-type="ul"><strong>Execute Script</strong>: {script|script_name: arg1, arg2, arg3}</li> <li data-xf-list-type="ul"><strong>Shortcut For Dice Roll Script</strong>: {[x]d[y]} = {script|dice: x, y} - note dice script allows + or -[z] ie: {2d6+4}</li> <li data-xf-list-type="ul"><strong>Switch:</strong> {switch: $varname} {case: 1} First text {case: 2} Second Text {case: 3} Third Text {case: default} Default text {/switch}</li> </ul><p>Numerical variables mathematically interact (you can +-/* them). You can also "add" text string variables as follows.This adds the variables $Class and $Alignment. The ", " (comma space) in the middle isn't part if the format; it's there because I wanted to add a comma and space between them, so the output would be: "$Class, $Alignment" rather than "$Class$Alignment".<span style="color: #a52a2a">{$p: {print: $Class}, {print: $Alignment}}{print: $p} {print: $p}</span></span></p><p><span style="color: #3E3E3E"><span style="color: #a52a2a"></span></span></p><p><span style="color: #3E3E3E"><span style="font-size: 18px"><strong>User Input Variables</strong></span></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Variables can be set using the Set Variable script, above. However, sometimes you may wish to have the user input one or more variables which will then be used in the generator. </span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">To add a custom user-input variable, start creating a generator, then click the "Add A User-Input Variable" link. This will make some forms appear. </span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">The "Name" form will change how you refer to the variable in the generator. For instance, if you entered "gender" into the name form, you would refer to the variable in the generator with "{print:$gender}" or "{if:$gender=male}" etc. The "Name" form will also be the title of the variable when it's displayed on the view_block page.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Each "Option" form will change what the variable's value will be. For instance, if you made a variable named "gender" and gave it the options "male" and "female," {print:$gender} would either output "male" or "female' depending on which is selected by the user.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">The "Add Option" link will add another option to the variable it is in. You must have at least two options for each variable. The page won't let you submit if you don't.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Clicking the "Preview" link inside each user-input variable will change the forms into a select box, so you can preview how the generator will output with the different options. After you clicked the "preview" link inside a variable, it will change into an edit link, which will let you edit the options and add/delete options again.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">If you don't click the preview button inside a variable, it will output as "Variable Value" when you previewing the generator.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">After you've submitted or edited a generator with custom user-inputs, each variable will appear as a select box for the user to choose from before executing a generator.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">NOTE - a generator with user input variables still works when called from elsewhere. In this case, the variables won't be selected, so the first (default) values for each are used. </span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"><span style="font-size: 18px"><strong>Rating, Favorites, & Commenting</strong></span></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">You can rate any generator (from 1-10) based on how good it is. Visitors can then view the <a href="https://web.archive.org/web/20160914235550/http://www.enworld.org/forum/dnd_browse.php?orderby=rating&order=DESC&type=block" target="_blank">b</a><a href="https://web.archive.org/web/20160914235550/http://www.enworld.org/forum/dnd_browse.php?orderby=rating&order=DESC&type=block" target="_blank">est rated generators.</a> You are also able to comment on and discuss generators.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">You can mark generators as "Favorites". A list of all your favorite generators is accessed from the OGRE menu.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"><span style="font-size: 18px"><strong>How to make your First Generator</strong></span></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">If you follow these instructions to make a simple generator, you'll have the hang of it in no time. Think of this like a tutorial/walkthrough. </span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">First, create a table. This will be a simple list of colours, shapes, sizes, or something.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"> <ul> <li data-xf-list-type="ul">Click on "Create" in the menu at the top of OGRE</li> <li data-xf-list-type="ul">From the page that appears, select the "Create a Table" tab</li> <li data-xf-list-type="ul">Give your table a title</li> <li data-xf-list-type="ul">Give it a die roll range (such as 1d6 or 2d4 or 2d6+3)</li> <li data-xf-list-type="ul">Enter the die rolls down the left column, and the corresponding result in the right column. You can enter single rolls (1, 2, 3, etc.) or die roll ranges (1-3, 4-7, etc.). Try putting in some adjectives - colours, sizes, or something simple.</li> <li data-xf-list-type="ul">Enter a quick description so that anyone else who references your table knows what it does.</li> <li data-xf-list-type="ul">Select the "Testing" catagory. This'll keep it all tidy while you play. You can always move it later.</li> <li data-xf-list-type="ul">Don't worry about a thumbnail image for now. You should always put them on Generators, but they're not important for Tables.</li> <li data-xf-list-type="ul">Hit "Save Table"</li> </ul><p>You now have your first table. It's a list of colours, shapes, sizes, or whatever you chose. </span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Now, create TWO more tables in exactly the same manner. Put them in the Testing category, too, so other people know you're just trying stuff out. Make the tables as follows:</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"> <ul> <li data-xf-list-type="ul">Another descriptive table (colours, shapes, sizes, what-have-you). That way you now have two tables which deliver a random adjective. They might be size and colour, or shape and size, or brightness and loudness, or whatever you decided to do.</li> <li data-xf-list-type="ul">A table which lists some ITEMS. Maybe box, cat, mat, mouse, tree, house or something. Again, doesn't matter what - you're just testing a this point.</li> </ul><p>So now you are the proud creator of THREE tables! You remembered to put them in the Testing category, right? That ensures everyone else knows they might not be perfect.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Next you're going to make your first GENERATOR. This will use the info gathered from your three tables.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"> <ul> <li data-xf-list-type="ul">Click on the Create a Generator tab (on the "Create" page)</li> <li data-xf-list-type="ul">Give it a title. This title should be a full title - "Dwarf Name Generator" or whatever. End it with "Generator" or "Creator" or something, so that when people Google a random generator, the title of your generator will make them click on it.</li> <li data-xf-list-type="ul">Now to enter the contents of your new generator. This will be your three tables. Use the "Browse Tables" link below the content box to find your first table. Copy the "Table Reference" below the table and enter it in the content box for your new table.</li> <li data-xf-list-type="ul">Do the same for your other two tables. The two adjectival ones first, then your item table last. It should look like this (though with your username and tablenames, not mine):<span style="color: #a52a2a"> {Morrus(Size Categories)} {Morrus(Colors)} {Morrus(assorted_items)} </span></li> <li data-xf-list-type="ul">Clicking the "preview" link will make a box pop up with a demo of what your generator output will look like. Using my above example, mine would look like "small green ball" or "big blue box" or something.</li> <li data-xf-list-type="ul">Feel free to adjust the grammar, layout, etc. of your output and insert any words, punctuation or sentences. You might change it to <span style="color: #a52a2a">"You see a {Morrus(Size Categories)} {Morrus(Colors)} {Morrus(assorted_items)}"</span></li> <li data-xf-list-type="ul">Add a description, a 150x150pm image, select the "Testing" category, and save your generator. You're finished! It will appear on the main ("Portal") page of OGRE and be available for others to include in their own creations!</li> </ul><p>Now remember, a table or generator is for ANYONE to use. You are welcome to reference my many tables, for example, and I may well incorporate some of your stuff into mine.</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Here's an example of a fairly simple (but more complex than the one we just made) generator which describes a pirate ship. You'll f<a href="https://web.archive.org/web/20160914235550/http://www.enworld.org/forum/dnd_view_block.php?id=235" target="_blank">ind it here </a>if you want to try it out, but below I've pasted the generator content so you can see how I did it. You'll see I used a basic sentence structure, referenced a bunch of tables (some of which reference other tables and generators themselves, such as my English Town Name Creator), and incorporated a simple loop to randomize the amount of stuff in the cargo hold. Hopefully this will help make it clearer how to do these things! </span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">Anyhow, here's the code:</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E">[TABLE="class: cms_table_outer_border, width: 800, align: center"]</span></p><p><span style="color: #3E3E3E">[TR]</span></p><p><span style="color: #3E3E3E">[TD]<span style="color: #a52a2a">{Morrus(pirate_ship_name_compiled)}, under the command of Captain {Morrus(pirate_names)}, is a {Morrus(general_extraneous_item_descripton)} {Morrus(pirate_ship_type)} originally out of Port {Morrus[English Town Name Creator]}. Its hold is currently filled with a cargo of {Morrus(trade_goods)}. Other items in the hold include {loop:{1d4}}{Morrus[Mundane Treasure Generator]}, {/loop} and {Morrus[Mundane Treasure Generator]}. The ship's first mate is {Morrus(pirate_names)}.</span><span style="color: #ff0000"></span></span></p><p><span style="color: #3E3E3E"><span style="color: #ff0000"></span>[/TD]</span></p><p><span style="color: #3E3E3E">[/TR]</span></p><p><span style="color: #3E3E3E">[/TABLE]</span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"></span></p><p><span style="color: #3E3E3E"></span></p></blockquote><p></p>
[QUOTE="Morrus, post: 7137461, member: 1"] [COLOR=#3E3E3E]EN World's [URL="http://www.enworld.org/forum/dnd_portal.php"][B]Online Generic Randomizer Engine[/B][/URL] (OGRE) is a powerful, flexible framework to create your own random generators and share them with other EN World members. You can create anything from the very simple (a random color generator which rolls a d6 to choose a color) to something very complex (such as an entire, detailed populated village with homes and businesses). This is accomplished by the creation of two types of object: [B]tables[/B] and [B]generators[/B]. Once someone creates a table or a generator, it is available for use by anyone else creating their own tables and generators. In this way, generators can reference and include other generators as part of their own output. So if Bob has created a table which picks a random color such as green, blue, or red, and Alice has created a table which picks a random object, such as box, table, or book, Eric can create a generator which references both of those pre-existing tables to generate an object of a random color, such as a blue box or a green table. In this way you can create random generators for your tabletop gaming needs. From random elf names to potion descriptions, to entire treasure hoards and NPCs. [SIZE=5][B]Tables[/B][/SIZE] [IMG]https://web.archive.org/web/20160914235550im_/http://www.enworld.org/newsimages/traps1.jpg[/IMG] A table is a simple chart. It contains a list of possible die rolls and a corresponding result. You've seen dozens of them in various RPG books: [URL="https://web.archive.org/web/20160914235550/http://www.enworld.org/forum/showwiki.php?title=Appendix+G:+Traps"]here's[/URL] an example from the 1E DMG for AD&D, and here is the infamous [URL="https://web.archive.org/web/20160914235550/http://www.enworld.org/forum/showwiki.php?title=Random+Harlot+Table"]Random Harlot Table[/URL]. In itself, a table doesn't do anything - it's simply a source of data referenced by a [B]generator[/B] (see below). An example table looks like this: 1) Red 2) Green 3) Blue 4) Yellow 5) Black 6) White It has a dice roll on the left, and corresponding results on the right. When encountering this table, OGRE would roll 1d6 and report back a colour. Tables aren't necessarily pretty; they're not what the user ultimately sees. A Dwarven-name generator, for example, might consist of four tables each of which just returns a random syllable. Remember, tables are just the data. A more complex table might involved 2d100+35 and have a vast range of resulting outputs; some of those outputs might themselves be calls to additional tables! [SIZE=5][B]Generators[/B][/SIZE] A generator is what the end user actually sees and uses. Generators are lumps of text which reference tables. In essence, they are a text-based framework into which any number of random entries can be inserted. You reference a table in a generator by using its name in curly brackets. So, if the above example table is called "colors" and is created by Morrus, a very simple generator might read:[COLOR=#a52a2a]You see a Morrus(colors) box. [/COLOR] OGRE would then output something like: "You see a green box." A slightly longer, but still very simple generator might look like this:[COLOR=#a52a2a]After travelling for 2d6+20 days, the admin(Size) admin(Colours) level 1d20 admin(pathinderracecore) admin(pathfinderclasscore) sees admin(pathfinderdesertencounter) in the desert and admin(pathfinderforestencounter) in the forest.[/COLOR] Which might output something like: "After travelling for 27 days, the large blue level 15 dwarf wizard sees 5 venomous snakes in the desert and 1 giant stag beetle in the forest." Of course, generators can be[I] much[/I] more complex than this, calling on dozens of tables and formatted in various attractive or useful ways - for example, you might create a generator which generates an entire [I]Pathfinder[/I] character and presents it in an attractive character sheet. Generators use a rich-text WYSIWYG text editor to help you format your desired output, and also accept HTML for more complex table-based layout choices. [SIZE=5][B]Sharing[/B][/SIZE] The basic concept of OGRE is a crowd-sourced, shared data-set. Every user who creates a new table or generator adds to the overall data resource. You might create a random table of NPC elf names today, and in six month's time, someone making their village generator might call on that table for some of the NPCs. In another six months, someone creating a world generator might call on the village generator, which calls on the elven NPC name generator - and so on. You can probably imagine much larger and more complex and intricate structures than that. Yes, there is error checking for infinite loops. [SIZE=5][B]Syntax for calling tables and generators[/B][/SIZE] Tables and generators are called using the following syntax: [LIST] [*][B]Table:[/B] {username(tablename)} [*][B]Generator:[/B] {username[generatorname]} [/LIST] Both generators and tables can call other generators and tables. [SIZE=5][B]Lookups[/B][/SIZE] Sometimes you may need to specify the die roll [I]before[/I] calling a table (perhaps you're applying modifiers to it, or want to apply the same die roll to multiple tables, or are using the table to look up specific data rather than roll). [LIST] [*]The format for changing the roll output is as follows: {username(tablename)[COLOR=red][replacedroll][/COLOR]|capscontrol} [*]You can either use numbers, variables, or rolls in the "[COLOR=red]replacedroll[/COLOR]" slot. [*]Here are some examples: [LIST] [*]{admin(cave_monster)[3]} which would always give the roll result of 3. [*]{$x:7}{admin(cave_monster)[$x]} which would always give the result of $x, which in this case is 7. [*]{admin(cave_monster)[{2d6}]} which would give a number between 1 and 13. [/LIST] [*]It is also be possible to do math within the added roll number like so: {admin(cave_monster)[{2d6+9*$x}]} [/LIST] [SIZE=5][B]Caps Control[/B][/SIZE] Because the creator of a table or generator never knows whether their creation will be referenced in isolation, at the start of, or in the middle of a sentence, any reference to a table/generator entry may also contain a modifying tag to alter the way it is displayed. There are four basic options: all lower-case, all upper-case, and two variations on first-letter-uppercase. The formatting for capitalization is as follows: {username(tableorblock)|capitalizationcode} These are the capitalization codes: |allcaps - ALL LETTERS ARE CAPITALIZED LIKE THIS. |firstcaps - The First Letter Of Each Word Is Capitalized Like This |firstcap - The first letter of the first word in the sentence is capitalized like this. |nocaps - none of the letters are capitalized like this. [SIZE=5][B]Integers[/B][/SIZE] Sometimes when you perform calculations on variables you may need to drop decimal places, runs up, or round down. The format is similar to the caps functions and follows an | symbol as follows: |int (removes decimal places leaving the whole number only) |intup (round up) |inddwn (round down) [SIZE=5][B]Putting it all together[/B][/SIZE] You can create as many tables and generators as you wish. Both tables and generators can reference each other, and you can freely use resources that others have created. So, if you're designing a big village generator, and somebody has already created a great tavern generator, you don't need to reinvent the wheel: you can simply call the existing tavern generator when you need it. [B]Scripts[/B] [LIST] [*][B]Set Variable[/B]: {$varname: value} - the $ sign is required in variable names. The "value" can be a text, a numeric value or a dice script ie:{2d6} or a single variable (even itself) +/- a numeric number ie: {$varname: {$varname+10}}. [*][B]Print Variable[/B]: {print: $varname} [*][B][B]If/Else[/B]: [/B]{if: $varname=3} If condition text {elseif: $varname=2} Elseif condition text {else} Else condition text {/if} [*][B]Loops:[/B] {loop: 4} This text will display 4 times {/loop} [*][B]Execute Script[/B]: {script|script_name: arg1, arg2, arg3} [*][B]Shortcut For Dice Roll Script[/B]: {[x]d[y]} = {script|dice: x, y} - note dice script allows + or -[z] ie: {2d6+4} [*][B]Switch:[/B] {switch: $varname} {case: 1} First text {case: 2} Second Text {case: 3} Third Text {case: default} Default text {/switch} [/LIST] Numerical variables mathematically interact (you can +-/* them). You can also "add" text string variables as follows.This adds the variables $Class and $Alignment. The ", " (comma space) in the middle isn't part if the format; it's there because I wanted to add a comma and space between them, so the output would be: "$Class, $Alignment" rather than "$Class$Alignment".[COLOR=#a52a2a]{$p: {print: $Class}, {print: $Alignment}}{print: $p} {print: $p} [/COLOR] [SIZE=5][B]User Input Variables[/B][/SIZE] Variables can be set using the Set Variable script, above. However, sometimes you may wish to have the user input one or more variables which will then be used in the generator. To add a custom user-input variable, start creating a generator, then click the "Add A User-Input Variable" link. This will make some forms appear. The "Name" form will change how you refer to the variable in the generator. For instance, if you entered "gender" into the name form, you would refer to the variable in the generator with "{print:$gender}" or "{if:$gender=male}" etc. The "Name" form will also be the title of the variable when it's displayed on the view_block page. Each "Option" form will change what the variable's value will be. For instance, if you made a variable named "gender" and gave it the options "male" and "female," {print:$gender} would either output "male" or "female' depending on which is selected by the user. The "Add Option" link will add another option to the variable it is in. You must have at least two options for each variable. The page won't let you submit if you don't. Clicking the "Preview" link inside each user-input variable will change the forms into a select box, so you can preview how the generator will output with the different options. After you clicked the "preview" link inside a variable, it will change into an edit link, which will let you edit the options and add/delete options again. If you don't click the preview button inside a variable, it will output as "Variable Value" when you previewing the generator. After you've submitted or edited a generator with custom user-inputs, each variable will appear as a select box for the user to choose from before executing a generator. NOTE - a generator with user input variables still works when called from elsewhere. In this case, the variables won't be selected, so the first (default) values for each are used. [SIZE=5][B]Rating, Favorites, & Commenting[/B][/SIZE] You can rate any generator (from 1-10) based on how good it is. Visitors can then view the [URL="https://web.archive.org/web/20160914235550/http://www.enworld.org/forum/dnd_browse.php?orderby=rating&order=DESC&type=block"]b[/URL][URL="https://web.archive.org/web/20160914235550/http://www.enworld.org/forum/dnd_browse.php?orderby=rating&order=DESC&type=block"]est rated generators.[/URL] You are also able to comment on and discuss generators. You can mark generators as "Favorites". A list of all your favorite generators is accessed from the OGRE menu. [SIZE=5][B]How to make your First Generator[/B][/SIZE] If you follow these instructions to make a simple generator, you'll have the hang of it in no time. Think of this like a tutorial/walkthrough. First, create a table. This will be a simple list of colours, shapes, sizes, or something. [LIST] [*]Click on "Create" in the menu at the top of OGRE [*]From the page that appears, select the "Create a Table" tab [*]Give your table a title [*]Give it a die roll range (such as 1d6 or 2d4 or 2d6+3) [*]Enter the die rolls down the left column, and the corresponding result in the right column. You can enter single rolls (1, 2, 3, etc.) or die roll ranges (1-3, 4-7, etc.). Try putting in some adjectives - colours, sizes, or something simple. [*]Enter a quick description so that anyone else who references your table knows what it does. [*]Select the "Testing" catagory. This'll keep it all tidy while you play. You can always move it later. [*]Don't worry about a thumbnail image for now. You should always put them on Generators, but they're not important for Tables. [*]Hit "Save Table" [/LIST] You now have your first table. It's a list of colours, shapes, sizes, or whatever you chose. Now, create TWO more tables in exactly the same manner. Put them in the Testing category, too, so other people know you're just trying stuff out. Make the tables as follows: [LIST] [*]Another descriptive table (colours, shapes, sizes, what-have-you). That way you now have two tables which deliver a random adjective. They might be size and colour, or shape and size, or brightness and loudness, or whatever you decided to do. [*]A table which lists some ITEMS. Maybe box, cat, mat, mouse, tree, house or something. Again, doesn't matter what - you're just testing a this point. [/LIST] So now you are the proud creator of THREE tables! You remembered to put them in the Testing category, right? That ensures everyone else knows they might not be perfect. Next you're going to make your first GENERATOR. This will use the info gathered from your three tables. [LIST] [*]Click on the Create a Generator tab (on the "Create" page) [*]Give it a title. This title should be a full title - "Dwarf Name Generator" or whatever. End it with "Generator" or "Creator" or something, so that when people Google a random generator, the title of your generator will make them click on it. [*]Now to enter the contents of your new generator. This will be your three tables. Use the "Browse Tables" link below the content box to find your first table. Copy the "Table Reference" below the table and enter it in the content box for your new table. [*]Do the same for your other two tables. The two adjectival ones first, then your item table last. It should look like this (though with your username and tablenames, not mine):[COLOR=#a52a2a] {Morrus(Size Categories)} {Morrus(Colors)} {Morrus(assorted_items)} [/COLOR] [*]Clicking the "preview" link will make a box pop up with a demo of what your generator output will look like. Using my above example, mine would look like "small green ball" or "big blue box" or something. [*]Feel free to adjust the grammar, layout, etc. of your output and insert any words, punctuation or sentences. You might change it to [COLOR=#a52a2a]"You see a {Morrus(Size Categories)} {Morrus(Colors)} {Morrus(assorted_items)}"[/COLOR] [*]Add a description, a 150x150pm image, select the "Testing" category, and save your generator. You're finished! It will appear on the main ("Portal") page of OGRE and be available for others to include in their own creations! [/LIST] Now remember, a table or generator is for ANYONE to use. You are welcome to reference my many tables, for example, and I may well incorporate some of your stuff into mine. Here's an example of a fairly simple (but more complex than the one we just made) generator which describes a pirate ship. You'll f[URL="https://web.archive.org/web/20160914235550/http://www.enworld.org/forum/dnd_view_block.php?id=235"]ind it here [/URL]if you want to try it out, but below I've pasted the generator content so you can see how I did it. You'll see I used a basic sentence structure, referenced a bunch of tables (some of which reference other tables and generators themselves, such as my English Town Name Creator), and incorporated a simple loop to randomize the amount of stuff in the cargo hold. Hopefully this will help make it clearer how to do these things! Anyhow, here's the code: [TABLE="class: cms_table_outer_border, width: 800, align: center"] [TR] [TD][COLOR=#a52a2a]{Morrus(pirate_ship_name_compiled)}, under the command of Captain {Morrus(pirate_names)}, is a {Morrus(general_extraneous_item_descripton)} {Morrus(pirate_ship_type)} originally out of Port {Morrus[English Town Name Creator]}. Its hold is currently filled with a cargo of {Morrus(trade_goods)}. Other items in the hold include {loop:{1d4}}{Morrus[Mundane Treasure Generator]}, {/loop} and {Morrus[Mundane Treasure Generator]}. The ship's first mate is {Morrus(pirate_names)}.[/COLOR][COLOR=#ff0000] [/COLOR][/TD] [/TR] [/TABLE] [/COLOR] [/QUOTE]
Insert quotes…
Verification
Post reply
Community
General Tabletop Discussion
*TTRPGs General
O.G.R.E. Instructions [wiki thread]
Top