Вы находитесь на странице: 1из 36

TableSmith 4.

5
RPG Generation Tool
Copyright 2005 by Bruce A. Gulke. All rights reserved.
TableSmith 4.5 Users' Manual

TableSmith 4.5
Welcome to TableSmith! This powerful tool is intended to aid RPG Gamemasters by
providing an easy-to-use system for creating and using tables and charts for their
campaigns.
This help file is brief, but TableSmith features an intuitive interface, so no more is needed.
With a small amount of effort, you'll be up and running in no time!
· Legal Information
The usual legal software information.
· System Requirements
What do you need to run TableSmith?
· TableSmith Interface
Instructions on using the program.
· TableSmith Categories
How to categorize your tables.
· Basic File Format
Explains the basic TableSmith scripting format and includes a short tutorial.
· Advanced TableSmith Scripting
Covers the advanced features of TableSmith's scripting format.
· Quick Reference Page
A summary of TableSmith's scripting format for easy reference.
· Support
TableSmith technical support policy.
· Other Utilities
Other programs from TableSmith's author.
· Revision History
The history of TableSmith's development.
Please note: TableSmith is shareware - please register! Read Legal Information for
registration information.

Page 2 of 36
TableSmith 4.5 Users' Manual

TableSmith Legal Information


The TableSmith software is owned by Bruce Gulke. Bruce Gulke grants to the user a
nonexclusive license to use the TableSmith software solely for his or her personal purposes.
The user may not commercially distribute, sublicense, resell, or otherwise transfer for any
consideration, or reproduce for any such purposes, the TableSmith software or any
modification or derivation thereof, either alone or in conjunction with any other product or
program. Further, the user may not modify the TableSmith software, other than for his or
her own personal use.
This software and accompanying electronic materials are provided "as is" without warranty
of any kind. Further, Bruce Gulke does not guarantee, warrant, or make any representations
regarding the use, or the results of use, of the software or electronic materials in terms of
correctness, reliability, accuracy, or otherwise. All risk as to the results and/or performance
of the software is assumed by you. If the software or electronic material are defective, you,
and not Bruce Gulke or his authorized representatives, assume the entire cost of all
necessary service, repair, or other correction.
The above is the only warranty of any kind, either express or implied, including but not
limited to the implied warranties of merchantability and fitness for a particular purpose, that
is made by Bruce Gulke on this software. No oral or written information or advice given by
Bruce Gulke or his authorized representatives shall create a warranty or in any way increase
the scope of this warranty and you may not rely on any such advice or information.
Neither Bruce Gulke nor anyone else who has been involved in the creation, production,
testing, distribution, or delivery of this software shall be liable for any direct, indirect,
consequential, or incidental damages, (including damages for business interruption, loss of
business profits, loss of business information, or anything of the like) arising out of the use
or inability to use said software even if Bruce Gulke has been advised of the possibility of
such damages.
By using the TableSmith you acknowledge that you have read this statement, understand it,
and agree to be bound by its terms and conditions.
TableSmith is shareware. If you wish to register TableSmith, contact Bruce Gulke
(akira@mythosa.net) for current address information (or you can register via PayPal -
www.paypal.com). Registration costs $10 (though you can pay more if you wish), and will
encourage further development of TableSmith and other helpful utilities.

TableSmith System Requirements


TableSmith is a 32-bit Windows application. Any system with Windows 98, Windows ME,
Windows NT (4.0+), Windows 2000, or Windows XP should have no problem running the
program. For optimum performance, a display setting with at least 256 colors should be
used.
Note: TableSmith is not supported on Windows 95.

Page 3 of 36
TableSmith 4.5 Users' Manual

TableSmith Interface
The TableSmith main window consists of five main areas, each explained below.

Menu and Toolbar


At the top of the window is the menu and (at the top left side) the toolbar. Each button
duplicates a commonly-used menu option. Each menu item is explained below:
· File
o Create New Table - Create a new table in the category you specify.
o Toggle Generator/Archives - Switches between the generator interface and
the archives interface.
o Print - Print the results window.
o Export Results - If you wish to save the current batch of results, click this
button. You will be prompted for a filename and location, and a file will be
generated for you. This file will be in the format type you specified under
"Preferences" (HTML, XML, or text).
o Preferences - Displays the Preferences dialog (discussed below).
o Exit - Exits TableSmith.
· Edit
o Edit Table - Allows you to edit the selected table (see TableSmith Basic File
Format for more information).
o Copy Selected to Clipboard - Copies selected text from the results window to
the Windows clipboard.
o Select All - Selects all text in the results window.
· Table
o Roll - Rolls on the selected table as many times as is displayed in the textbox
left of the Dice button.
o Reload - If you create a new category folder, copy files into a category folder,
or edit a Table file, and wish to use your changes immediately, you must first
click the 'Reload' button. This tells TableSmith to re-read the Tables folder
and update itself accordingly. Note that 'reloading' is done automatically each
time the program starts up.
o Display Hidden Categories - Normally you don't see "hidden" categories
(folders that start with "~"; see TableSmith Categories for more information).
Selecting this menu option will allow you to see those categories and select
tables from them.
o Break - Allows you to 'break', or halt, the execution of the current table. This
may generate error messages from that run if the table is halted in the
middle of a function, though this is not cause for concern.
· Help
o Help - Displays this help information.
o Add-Ons... - Displays information about any add-ons you may have installed.
o About... - Displays information about TableSmith.

Page 4 of 36
TableSmith 4.5 Users' Manual
The buttons in the toolbar are used for "Roll", "Edit Table", and "Reload". They duplicate the
functionality of the menu items of the same name.

Category and Table Lists


Below the toolbar you will find a drop-down list and a standard listbox, the first for
Categories and the other for Tables. The Category list is used to select Table Categories.
When a Category is selected, all the Tables in that Category will be loaded into the Table
list. When a Table is selected in that list, it is the one that will be used when the "Roll"
button is clicked.

Archives
TableSmith has an "Archives" feature, which allows you to easily store generated results for
easy retrieval. To access the Archives, click the "Archives" button, found above the
Category and Table Lists. You'll see a folder/file hierarchy, similar to Windows Explorer. The
hierarchy works as you would expect it to: Folders may be opened or closed, revealing (or
hiding) other folders as well as files. To view a file, simply select it. The stored results file
will appear in the Results Window. Above the hierarchy are three buttons: The leftmost
button may be used to create new folders. To use it, click on an existing folder, click the
button, then type the new folder's name when prompted. The second button is used to copy
generated results into the Archives. Click the folder where you want to copy the result
window contents, click the copy button, and type in a filename when prompted. In the
future, when you click on that file, it will appear in the Results Window. The rightmost
button is for deletion. Select the file or folder you want to remove, then click the 'X'. Note
that you will not be asked to confirm the deletion unless you are removing a folder that is
not empty. You cannot delete the topmost "Archives" folder.
To return to the Category and Table Lists, click the button above the archives that says
"Generate".

Results Window
The majority of the TableSmith interface is taken up by the Results Window. This is where
the results from rolling on a Table are displayed. This window is similar to a Web browser,
and will display items in HTML format, if specified.

Parameters
Some Tables use 'parameters', values that can be passed into them. A Table's parameters,
and their current values, will be displayed in the lists in this area, beneath the Results
Window (the "Show/Hide" button can be used to shrink this area and give the Results
Window more room). To change the parameter values, click the "Change" button, and use
the Parameters dialog to enter the values you wish to use (the Parameters window will start
at the first parameter listed, unless you've chosen one in particular, in which case that will
be the first parameter displayed).

Hyperlist
The lower left of the window constitutes the TableSmith's "Hyperlist". The purpose of the
Hyperlist is to allow you easy access to Tables you use often (similar to how "Favorites" lists
work elsewhere in Windows). Whereas the Tables in the Table listbox change based on the
Category selected, the Tables listed in the Hyperlist remain the same.
To assign a Table to the Hyperlist, simply click 'Add' and the current Table will be appended
to the list. To remove a Table, click the 'Remove' button when a Table is selected. Use
'Clear' to completely clear ths list. To run a Table in the list, just click on its name.

Page 5 of 36
TableSmith 4.5 Users' Manual

Preferences
You may set preferences governing how TableSmith acts in certain situations. Selecting
"Preferences" from the "File" menu will display a dialog box listing these preferences. They
are organized into three categories, and are detailed below:

Interface
· Use textured backgrounds - Check if you want to use the colorful backgrounds
included with TableSmith; leave blank if you prefer the standard Windows background
(not using textures may increase speed slightly on some machines).
· Recall window position (if not maximized) - Check if you want TableSmith to
remember where you last positioned your window on the desktop the next time you
run the program. Otherwise, TableSmith will start up in the center of your screen
(regardless of your choice, if you exit TableSmith while it's maximized, it will start
back up maximied).
· Re-select/re-run current table on a "reload" - If you leave this unchecked, TableSmith
will reset itself to the state it is in at start-up when you click the "Reload" button or
menu option. If you check this, it will reset itself as described, but then immediately
select (and therefore run) the table you had selected before clicking Reload.

Folders
· Table Folder - Clicking the "..." button allows you to select the folder where your table
files/categories are located. By default, they are in the "Tables" folder where you
installed TableSmith (and will be set back to this if you click "Set to defaults"), but you
may have the program look elsewhere if you wish.

Miscellaneous
· Table Editor - By default, TableSmith uses Windows Notepad for editting table files. If
you have a different editor you'd like to use, you may select it here by clicking the
"..." button (note: the editor you select must be an EXE file, and must be able to load
a file given it as a parameter to function properly). Alternately, you may choose the
"TableSmith Graphical Editor". The editor is a new feature being added to TableSmith
and currently does not support all of TableSmith's table format features, but it can
easily handle the more basic tables. At the moment, it is undocumented but available
for anyone who wishes to give it a try.
· Display error message for non-existent group calls - Checking this option will tell
TableSmith to display an error message if a group is called that it cannot find.
Unchecking this will display, as text, whatever group call was made.
· Remove re-roll/notes links when exporting to HTML - Text that may be re-rolled, or
that was generated with the "Notes" function, will appear as blue or green links in a
Web browser when you open an exported HTML file. However, browsers outside of
TableSmith won't understand what these links mean when you click on them. If you
don't wish to have the links in your exported HTML files, check this option.
· Output Type - Select the type of output you want TableSmith to generate. By default
this is HTML, but you may change to XML or text. Generate files will be displayed with
the appropriate extension, and exported or archived in a like manner.

Page 6 of 36
TableSmith 4.5 Users' Manual

TableSmith Categories
TableSmith uses "categories" to help you organize your tables. A category is simply a folder
you create in your "Tables" folder. The Category List on the main interface will display the
folders in "Tables", and selecting one will display the table files in that folder.
Some things to keep in mind:
· Though you can have tables with the same names in different categories/folders, you
are encouraged to use unique names for all your tables. At present, TableSmith has
no way of distinguishing two tables with the same name (and thus can generate
unexpected results). This may change in the future.
· If a category/folder starts with a "~" character, it will not be displayed in the
interface's drop-down list. Tables in that folder will still be seen by TableSmith. Use
this feature if you have tables that you don't want to see in the interface but which
other tables may use (such as reference tables).

TableSmith Basic File Format


Table files are the heart of TableSmith. These are the tables that contain the rules and data
used to generate names, treasure hoards, village shops, encounters, and anything else you
can think of. The information below covers the basics of TableSmith tables, and is enough to
help you figure out how to edit existing tables or create new ones of your own. When you're
comfortable with the basic functionality described below, you can move on to the Advanced
Features and add even more power and flexibility to your tables. A simple example file is
shown below:
# This is a comment line

:Start
1,You see a [Creature] with a [Treasure.Coins], worth {Dice~1d6*1000}
experience.

:Creature
1-2,Orc
3,Skeleton
4-7,Archdaemon
8,[Goblins.Start]
9,[Color] Spirit

# Colors for the various spirits


:Color
1,Red
2-3,White
4,Blue
The example above illustrates the following basic TableSmith concepts: Comments, Groups,
Group Calls, and Dice-Rolling.

Comments
The first line, with the '#' character, is a comment. Comments may be placed anywhere
within your table, generally to explain why something was done in a table in a particular
way, to describe the table's purpose, to show who authored the table or where it's original
source was, etc. Comments are intended for use by a person looking at a table; if a line has
a '#' as its first character, the entire line is ignored by TableSmith.

Page 7 of 36
TableSmith 4.5 Users' Manual

Groups
The parts of the table above starting with "Start", "Creature", and "Color" are groups. A
group consists of a name, followed by Entries. A group may have any name you wish,
though you should stick to only alphanumerics (i.e.; letters and numbers) and underscores
("_"). Group and table names cannot contain the characters "+", "-", or "=" as these have
special meaning when used in a call. Other characters that may work now might not work in
the future, so stick to "A-Z", "a-z", "0-9", and "_". Groups are preceded in a table by a colon
(":"). Groups can be considered "subtables" within the larger table files. Note: There is one
"special" group, known as "Start". Whenever a table is selected from TableSmith, the first
group that is rolled on is "Start" (it has to start somewhere).

Group Entries
The entries under each group follow a specific format, which is:
number,text
Note that the comma is very important. When an entry is read into TableSmith, everything
up to the first comma it reads is used for probability, and everything after is a line of text.
Note that if you put a space after the comma, that space is part of your line of text. Also
note that when it comes to commas, TableSmith only cares about the first one it finds. You
may put commas in anywhere in your text line that you care to.
The number before the comma in an entry line is a probability. This is the chance that if
that line's group is selected, that particular line will be used. For instance, in the "Color"
group in the example, the entry "Red" has a number of 1. Since the range of numbers for
that group is 1-4, if the Color group is selected for something, a random number from 1 to
4 will be generated, and if it comes up a '1', "Red" will be the text used from the Color
group. This number may be either a single value, or a range, in the format of "X-Y", where
'X' is the lower limit of the range and 'Y' the upper. The range for a group is determined by
the lower limit (or value if a single number) of the first entry beneath it and the upper limit
of its last entry. In the example above, when rolling on the "Creature" group, the range is
1-9, and for the "Color" group, it is 1-4. Note: This number cannot be negative, and if a '0'
is used, that entry will not be used (though '0' won't generate an error).

Alternate Group Format


Groups may also follow an additional format. It is similar to the above, but looks like this:
;Weapons
3,Sword
2,Axe
5,Dagger
2,Pole arm
This type of group works in a similar manner, but rather than the numbers describing
ranges, they describe relative probabilities. In the example above, for instance, the 3
represents '1-3', the 2 is '4-5', the dagger has a range of '6-10', and the pole arm's 2 is the
equivalent of '11-12'. Note that groups following this format should start with a semi-colon
(";"), rather than a colon (":").

Page 8 of 36
TableSmith 4.5 Users' Manual

Groups that Don't Repeat


If you include an exclamation point ("!") after a group designator (":" or ";"), this will signal
TableSmith that the group should not allow duplicate results. In other words, if an item is
selected in the group, and the group is called later, previously selected items will not be
selected again. For example, take a group that looks like this:
;!Weapons
3,Sword
2,Axe
5,Dagger
2,Pole arm
A roll on the group indicates that, say, "Dagger" is selected and returned to the caller. Later
in the table, this "Weapons" group is called again. On this roll, the result will be anything
but "Dagger", since that has already been used. Say the result of the second roll is "Axe".
Now, if this table is called a third time, the only results to be returned will either be "Sword"
or "Pole arm".
Note: Take care when using this feature. TableSmith will give you an error (appearing in
your table output) if a group is called that is already "maxed-out" (i.e.; it is a non-
duplicating group that has had all its members used, and another call is made).

Group Calls
Whenever an entry line contains something in double square brackets ('[' and ']'), rather
than using that text as part of the selected line, the program will jump to the group with the
name that is between the brackets, and insert the generated result from that group into the
current line. For instance, in the example, the "Creature" group has an entry that says
"9,[Color] Spirit". This means that if that entry is selected, TableSmith will jump to the
"Color" group, make a selection, and replace "[Color]" with that selection. Thus, the result
would be "Red Spirit", "White Spirit", or "Blue Spirit", depending on the value generated for
the "Color" group.

Calling Groups in Other Tables


Besides calling groups in the same table, you may also call group in other tables. If the text
between the two brackets contains a period, TableSmith treats the text before the period as
a table, and the text after it as a group. So while [Treasure] means the program would look
in the current table for a group called "Treasure", [Treasure.Coins] means the program
would load the "Treasure" table and generate a result from that table's "Coins" group.
If you wish to generate a result from the entire table, reference the "Start" group (for
instance, to generate a result from a table called "Weapons" as if you were selecting it
directly through the TableSmith interface, the syntax would be [Weapons.Start]).
Note: Referenced tables must exist in the Tables subdirectory, and must be spelled the
same as the table files (without the ".tab" extension).
Also note that with both types of Group Calls, it is possible to create endless loops that will
freeze up the program (example: Having a table called "Freeze", with one entry in the
"Start" group, being "1,[Start]"). Due to the complexities involved, TableSmith does not
check for this. You will have to be careful about this sort of thing.

Page 9 of 36
TableSmith 4.5 Users' Manual

Roll Modifiers
Normally, when a group is called, TableSmith generates a random number within the range
of the groups limits, and then looks up the corresponding entry for that number. For
example: In the sample table at the top of this page, when TableSmith rolls on the
"Creature" table, it generates a random number from 1 to 9, and selects the corresponding
entry. However, you may modify this roll if you wish. When a group call is made, a "roll
modifier" may be applied: If a group call contains a "+", "-", or "=", the value of whatever
follows is either added, subtracted, or "forced" from the roll made on the referenced group.
For example:
· [Potions+3] - This would add 3 to whatever roll was made on the group 'Potions'
· [Castles-5] - This would subtract 5 from whatever roll was made on the group
'Castles'.
· [Undead=4] - Rather than roll on the group 'Undead', the result generated will be for
whatever line the value 4 is located.
The modifier is never required, and is simply used if you wish to modify a group roll.

Die Rolls
TableSmith allows for random die rolling in the middle of tables (useful for any number of
things, from the value of treasure to character generation to monster hits). To generate a
die roll, a special syntax is required:
{Dice~XdY?Z}
· X - Any non-decimal number (1, 5, 100, etc.). May be omitted, in which case it is
considered to be '1'.
· d - The letter 'd' must be in the declaration (think of it as the 'd' in "2d8" or the like)
· Y - The number of "sides" of the die you are rolling.
· ? - This, and 'Z' can be left out. The ? symbol means you can place a '+', '-', '*', or '/'
in the formula (so you can generate results such as "3d6+2" or "4d8-5")
· Z - This is the amount you wish to add, subtract, multiply by, or divide by.
When TableSmith sees curly brackets ('{' and '}') containing the text "Dice~", rather than
printing these characters directly, it "rolls dice", and substitutes the result in place of the
brackets and their contents. So, for instance, if you have "{Dice~3d6}" in a group entry,
the program will "roll" 3d6, take the result, and put it in place of the bracketed text.

Page 10 of 36
TableSmith 4.5 Users' Manual

How does all this work?


When TableSmith generates results for a table, it first goes to that table's "Start" group.
Taking the total range of numbers based on the entries, it generates a random number, and
matches it up with the appropriate entry. It then builds a string of text, calling various
groups, tables, and die rolls as needed. This text is then displayed as the results of the table
generation.
Here's an example using the table shown at the top of this page:
· The program looks at the "Start" group and determines a range of numbers. Since
there is one entry with a value of '1', this range is 1-1 (pretty simple). A random
number is generated in the range of 1 to 1, and strangely enough, '1' is the result.
· Looking at the selected entry in "Start", the program sees that a call is made to the
group "Creature". A range is again determined, this time being 1 to 9. A random
number is generated in this range, and the result, say, is '9'.
· If the result was '2', "Orc" would have been the result of the call to "Creature", and
that would have been passed back to the Start entry. However, with '9', there is a call
to another group, "Color".
· TableSmith goes to the "Color" group, determines a range of 1 to 4, and generates a
random value. '4' is the result, so "Blue" is passed back up.
· "Blue" has been generated as a result for the call to the "Color" group, so this is
substituted for "[Color]", meaning the call to the "Creature" group has come up with
"Blue Spirit".
· "Blue Spirit" is passed up to the "Start" entry, which uses it to replace "[Creature]".
· So far we have "You see a Blue Spirit". To this we continue to add text, resulting in
"You see a Blue Spirit with a " - but now we have another link, this time to another
table called "Treasure" and one of its groups, "Coins".
· In summary, TableSmith loads the "Treasure" table and generates a result from its
"Coins" group. Let's say we got back "pouch of 20 gold"; we continue, so until we hit
that first curly bracket, we have "You see a Blue Spirit with a pouch of 20 gold, worth
".
· TableSmith looks at the formula "1d6*1000", and generates a number from 1 to 6,
multiplying it by 1000. Let's say the result is "4000".
· The final outcome of this generation is: "You see a Blue Spirit with a pouch of 20 gold,
worth 4000 experience."
This is just an example of what TableSmith does. The best way to learn the potential of this
program is to look at the sample tables provided.
A few other notes:
· Tables are all in standard ASCII text format.
· Table names, like group names, should not contain the following characters: "+", "-",
and "=".
· TableSmith is case-sensitive when it comes to group names/calls as well as variables
and functions (which are covered in the "Advanced" section of Help). Thus, the calls
[Creature] and [creature] are not the same.
· Any new tables must be added/copied/whatever into the 'Tables' subdirectory, which
is found in the directory that TableSmith was installed into.

Page 11 of 36
TableSmith 4.5 Users' Manual
· TableSmith uses an HTML control for display, so you may place HTML tags into your
entry lines for special formatting. For an example of how HTML is used in a table, look
at the "Book Description" table.

TableSmith Advanced Format Features


This section details the more advanced features of TableSmith. Included are details on
variables (which allow you to preserve values or results within a table), parameters (allow
you to solicit input from the user), functions (tools to accomplish things not possible with
the basic TableSmith format), and other miscellaneous features.

Variables
TableSmith supports variables, which can be thought of as storage areas for numbers, text,
or other information. Variables must be named, and can be called anything you want
(though you are advised to just use alphanumeric characters - that is, letters and numbers).
A variable name can contain spaces, though not at the beginning or end of the name.
Variables must be "declared" in a TableSmith file before anything else (including
parameters, which are detailed elsewhere). A variable declaration is a single line formatted
as follows:
%VariableName%,x
"varname" is whatever name you choose for the variable, and "x" is the default value that
the variable will have (i.e.; whatever value it possesses until reassigned or modified).
Variables can store text or numbers.
Whenever an entry has something between two percent signs ("%"), TableSmith reads this
as a variable reference. If you have a variable with a name matching whatever is between
the % characters, the value that is currently in that variable replaces the reference. For
instance, say the variable "amount" currently holds the value "12". The following line in a
TableSmith file:
"There are %amount% orcs here."
will display as:
"There are 12 orcs here."

Page 12 of 36
TableSmith 4.5 Users' Manual

Variable Assignments
Whenever a group entry has something in two sets of pipes ("|"), it is recognized by
TableSmith as a variable assignment. The format of an assignment is as shown:
|xxxxx?Y|
where
· xxxxx is a variable name (without the "%")
· ? is +, -, *, /, \, >, <, &, or =
· Y is a numeric value
Use one of the nine symbols shown by "?" above to change a variable. Using "=" will assign
the following text or number to the specified variable, while the other symbols will perform
that action on the variable (usually only practical if the variable holds a number). Examples
are shown below:
· |A+5| - Adds 5 to "A" (Ex: If "A" was 3, it is now 8)
· |hp-3| - Subtracts 3 from "hp" (Ex: If "hp" was 4, it is now 1)
· |gp*2| - Multiplies "gp" by 2 (Ex: If "gp" was 50, it is now 100)
· |dmg/2| - Divides "dmg" by 2 (Ex: If "dmg" was 10, it is now 5)
· |attr\2| - Divides "attr" by 2, rounds fractions (Ex: If "attr" was 5, it is now 2)
· |A>35| - Assigns 35 to "A", if 35 is greater than A's value
· |A<14| - Assigns 14 to "A", if 14 is less than A's value
· |A& III| - Concatenates the text " III" to A's value (Ex: If "A" was "Smith", it is now
"Smith III")
· |A=orc| - Sets "A" equal to the word "orc"
Note that variables are local to the table they are used in. In other words, if you have a
reference to "A" in one table and a reference to "A" in another that is called by the first, the
value of "A" in one table will not be affected by changes in the other.
Also note that unlike the other TableSmith formats, a variable assignment does not get
replaced by anything visible. The entire assignment is simply removed from the line - "This
is |B=5| a test" would be viewed as "This is a test".

Group Re-roll Tag


There is a special "tag" that you can use with a Group Call (detailed in the "Basic Format"
section of Help) to re-roll the results of that call. To use this, simply precede the group call
with "LN~", like so: "[LN~Treasure.Weapons]".
This tag allows the user to "re-roll" the results generated from the group call. Whatever text
is returned by the call is displayed in the TableSmith Results window is treated similar to an
HTML hyperlink. The text will be in a dark-blue color (not underlined, though), and will
change to light-blue when the cursor is placed over it. Clicking the text will "re-roll" it, while
preserving the rest of the results. Note that this feature will not regenerate or recalculate
other parts of a display. Variable changes that occur in the "re-roll" will not be reflected
elsewhere in the results window (the primary purpose of this feature is to "tweak" results).

Page 13 of 36
TableSmith 4.5 Users' Manual

Functions
Functions are a feature of TableSmith that allow you to perform some sort of action that you
couldn't otherwise do with the standard table format or which could be done with great
difficulty. The "Dice" function has already been detailed in the Basic Format area of Help;
TableSmith supports many more. Functions follow the format below:
{FunctionName~nnnn,nnnn,nnnn,...}
"FunctionName" is the name of the function. It is followed by a "~", and one or more values
(the number and the type depend on the particular function). Some functions return text
(replacing the {, }, and everything in-between), some manipulate variables. Each function
is detailed below (note that variables who's values are referenced by functions are not
surrounded by the "%" character as they are normally; these functions are SortAsc,
SortDesc, Min, Max, and Split). Examples are shown in italics.

Abs (Absolute Value)


{Abs~SomeValue}
Returns the absolute value of "SomeValue".
· {Abs~-3} returns "3"

And (Logical AND)


{And~expression1,expression2}
Compares expression1 with expression2; if both are true, "And" returns 1. If one or both
are false, returns 0. If there is an error in either, And returns -1.
· {And~%var1%>3,%var2%=2} returns "1" if var1 is greater than 3 and var2 equals 2

AorAn (A or An)
{AorAn~String}
If "String" starts with a vowel, this function appends "an " to the front of it; otherwise, it
appends "a " to the front.
· {AorAn~ostrich} returns "an ostrich"

Bold (Boldface Text)


{Bold~Text}
"Text" will be displayed in boldface in the results window (HTML-output only).
· The {Bold~dragon} is red will be displayed as: The dragon is red.

Calc (Calculate)
{Calc~Expression}
This function will return the results of the mathematical expression given to it. The function
will recognize addition, subtraction, division, division with truncation, and multiplication (+,-
,/,\,*). Parentheses can be used as well. Note that if you use variables in the expression,
make sure a space divides the "%" of any variable from the division sign ("/").
· {Calc~(3*(5+2))} returns "21"

Page 14 of 36
TableSmith 4.5 Users' Manual

Cap (Capitalize)
{Cap~String}
This function will return the string fed to it, with the first character capitalized. Spaces are
counted, so while "arrow" will be capitalized to "Arrow", " arrow" would stay the same, since
the function looks at the space that precedes the word.
· {Cap~dragons} returns "Dragons"

CapEachWord (Capitalize Each Word)


{CapEachWord~String}
This function will return the string fed to it, with each word in the string capitalized. A
"word" is designated by having a space in front of it.
· {CapEachWord~druids and dragons} returns "Druids And Dragons"

CarRet (Carriage Return)


{CarRet~} or {CR~}
Inserts a carriage return (i.e.; terminates the current of text and starts a new line).

Ceil (Ceiling Integer)


{Ceil~Number}
Returns the smallest integer higher than or equal to "Number".
· {Ceil~2} returns 2, {Ceil~1.3} returns 2, {Ceil~-2.3} returns -2

Count (Count Entries)


{Count~GroupName}
Count will return the number of entries in "GroupName". A group with three entries would
return "3", a group with ten entries would return "10", etc.

Debug (Debug)
{Debug~Caption}
Displays various information for debugging purposes (intended for more advanced users).
Displays a dialog box with "caption" as its caption, along with a list showing all the variables
and their values for the current table, system resource/memory information, and the
number of times the main TableSmith routine has been looped through.

Dice (Roll Dice)


{Dice~XdY?Z}
The Dice function (see the Basic Format section for detailed information on how this function
works).
· {Dice~1d4+1} will return some number from 2 to 5

DSAdd (Add item to dataset)


{DSAdd~VarName}
Adds a new item to the end of the dataset "VarName". Each field in this item will be equal to
whatever is defined as the dataset's defaults. DSAdd will return the index of the new item
(which will also be equal to the number of items in the dataset).

Page 15 of 36
TableSmith 4.5 Users' Manual
DSCount (Get the number of items)
{DSCount~VarName}
Returns the number of items in dataset "VarName".

DSCreate (Create dataset)


{DSCreate~VarName,Field1,Default1,Field2,Default2,...Fieldx,Defaultx}
Creates a dataset and assigns it to the variable "VarName". "Fieldx" defines the name of a
field in the dataset, and "Defaultx" is what the default value for each field is. You can have
as many fields as you want, but you must list a field name and a default for each one.
Datasets created with this function do not have any items in them.

DSFind (Find an item)


{DSFind~VarName,StartingIndex,SearchExpression1,SearchExpression2,...Search
ExpressionX}
Starting at the item with index "StartingIndex", searches through each item until it finds
one where the given "SearchExpressions" are true and returns the index of that item (if not
match is found, "-1" is returned). "SearchExpression" follows the format
"fieldnameXXXvalue". "XXX" is a comparison operator, similar to what you use for "If/IIf".
The following operators are recognized: =, !=, <=, >=, >, <, ~, and !~. All but the last two
work both with numbers and text. The last two work only with text. "~" means "like" and
"!~" means "not like". If you want to use wildcards with your text search, use "~" and "!~".

DSGet (Get a value in a dataset)


{DSGet~VarName,Index,Field}
Returns the value of "Field" in the item at "Index" in the dataset "VarName".

DSRandomize (Randomize dataset)


{DSRandomize~VarName}
Puts the items in dataset "VarName" in a random order.

DSRead (Read in a dataset file)


{DSRead~VarName,Filename}
Reads the file "Data\Filename.tsd" into "VarName".

DSRemove (Remove an item)


{DSRemove~VarName,Index}
Removes the item at "Index" in dataset "VarName".

DSSet (Set a value)


{DSSet~VarName,Index,Field1,Value1,Field2,Value2,...Fieldx,Valuex}
For the item at "Index" in dataset "VarName", sets the values of "Fieldx" to "Valuex".

Page 16 of 36
TableSmith 4.5 Users' Manual

DSSort (Sort a dataset)


{DSSort~VarName,Field1,Direction1,Field2,Direction2,...Fieldx,Directionx}
Sorts the items in dataset "VarName". You can sort on as many fields as you want, but each
field also needs a direction listed with it (0 is ascending - in alphabetic/numeric order; 1 is
descending - reverse alphabetic/numeric order). If you have multiple fields defined, the
dataset will sort based on the first field, then sort on the second field for items where the
first field is the same, then sort on the next field for items where the previous field was the
same, etc.

DSWrite (Write dataset to file)


{DSWrite~VarName,Filename}
Writes the dataset in "VarName" to a data file. The data file will be named "Filename.tsd"
and will reside in TableSmith's "Data" folder.

Extern (External Call)


{Extern~Library.Object,StringToPass}
Calls the "main" function of "Library.Object", feeding it "StringToPass". Intended to be used
with add-ons for TableSmith; the use of Extern is something that is covered by individual
add-on authors.

Find (Locate a string in another string)


{Find~x,String1,String2}
Starting at character "x", find the location of "String1" within "String2" and return the result
(if "String1" cannot be found in "String2", 0 will be returned).
· {Find~1,able,TableSmith} will return "2" ("able" is found in "TableSmith" starting at
the 2nd character)

Floor (Floor Integer)


{Floor~Number}
Returns the largest integer smaller than or equal to "Number".
· {Floor~2} returns 2, {Floor~1.3} returns 1, {Floor~-2.3} returns -3

Generate (Generation Link)


{Generate~0,Text,Table/Group Call}
The "Generate" function allows you to embed a link into your results that will additional
generation in the future. The first parameter must be "0" (other values may be added in the
future). The "Table/Group Call" is a call to a table or group, similar in syntax to a standard
group call, but without the square brackets ("[", "]"); it may include parameters and/or
modifiers as well. "Text" is the linkable text to display in the results window. When this text
is clicked, the "Table/Group Call" that's been specified will be made and the results
substituted for "Text".

Page 17 of 36
TableSmith 4.5 Users' Manual

If (Conditional function)
{If~conditional ? Result1/Result2}
The "If" function works by comparing two items to see if they meet a specified criteria. If
the "conditional" statement is true, "Result1" is returned. If it is false, "Result2" is returned
("Result2" is optional; if it is not shown and the conditional is false, nothing will be
returned). The options for the conditional are "=" (equals), "!=" (does not equal), "<" (less
than), ">" (greater than), "<=" (less than or equal), and ">=" (greater than or equal).
· If the variable "Class" is 1, {If~%Class% = 1 ? warrior / wizard} will return
"warrior"; otherwise, it will return "wizard"

IIf (Conditional function)


{IIf~conditional ? Result1:Result2}
"IIf" works identically to "If", above. The only difference is that "IIf" separates its results
with a colon (":") rather than a slash ("/"). Use "IIf" if you need a result that uses a slash
(perhaps for HTML), but not a colon (you can still print a colon with the HTML code ":").

Input (Input a value)


{Input~VarName,Prompt,Default}
The "Input" function allows a table to solicit input from the user as the table is running.
When this function is encountered, an input box appears on the screen, with the prompt as
defined by "Prompt", with a default value as defined by "Default". Whatever value the user
enters is assigned to the variable "VarName" (if the user clicks "Cancel" on the input box,
no action is taken, and the current value of "VarName" is unchanged). Note that the
variable name should be used without percent signs ("%").
· {Input~Weapon,Which weapon is favored?,longsword} prompts the user "Which
weapon is favored?", with the default "longsword", and takes whatever they reply and
puts it into the variable "Weapon"

Italic (Italicize Text)


{Italic~Text}
"Text" will be displayed in italics in the results window (HTML-output only).
· The {Italic~dragon} is red will be displayed as: The dragon is red.

LastRoll (LastRoll)
{LastRoll~}
Returns the group name and the roll made on the most recently called group, in the format
"TableName.GroupName:X".

LCase (Lower Case)


{LCase~String}
Returns "String" in all lower case.
· {LCase~TableSmith} will return "tablesmith"

Page 18 of 36
TableSmith 4.5 Users' Manual

Left (Leftmost Characters)


{Left~x,String}
Returns the leftmost x characters from "String".
· {Left~3,TableSmith} will return "Tab"

Length (String Length)


{Length~String}
Returns the length of "String".
· {Length~TableSmith} will return "10"

Line (Line)
{Line~align, width}
Inserts a line across the page. Width is a percentage; if omitted, it will be be assumed to be
100%. "align" can be left, center, or right.

Lockout (Lockout Entry)


{Lockout~Group,Values}
In a non-repeating table, Lockout flags the entries with the probability values listed as
already selected. "Values" can be a single number, a range of numbers, or a combination.
· {Lockout~Animals,3,7-9} will flag whatever entries encompass 3, 7, 8, and 9 as
already being used.

Log (Write to Log)


{Log~FileName,text}
Adds "text" to the end of a text file called "FileName"
· {Log~C:\log.txt,Generated line 14} will write "Generated line 14" at the end of
the file "C:\log.txt"

Loop (Loop)
{Loop~n,Value}
Displays the results of "Value" "n" number of times.
· {Loop~3,Hello!} will return "Hello!Hello!Hello!"

Max (Maximum Value)


{Max~Var1,Var2,Var3,...}
The Max function looks at the values following it, and returns the largest value from the list.
· {Max~5,7,14} returns "14"

Page 19 of 36
TableSmith 4.5 Users' Manual

MaxVal (Maximum Value of Entry)


{MaxVal~GroupName,X}
MaxVal looks at the entry on line "X" of group "GroupName", and returns the maximum
number that could be rolled on GroupName for it to be a result.
· Given group "Weapons", with the first line being "4,dagger" and the second line being
"3,scimitar", {MaxVal~Weapons,1} would return "4" (since 1-4 would yield "dagger"
and 5-7 would yield "scimitar")

Mid (Middle Characters)


{Mid~x,y,String}
Starting with the "y"th character, returns x characters from "String".
· If the variable "Name" contains "Reginald", then {Mid~5,2,%Name%} returns "egina"

Min (Minimum Value)


{Min~Var1,Var2,Var3,...}
The Min function looks at the values of all the variables following it, and returns the smallest
value from the list.
· {Min~5,7,14} returns "5"

MinVal (Minimum Value of Entry)


{MinVal~GroupName,X}
MinVal looks at the entry on line "X" of group "GroupName", and returns the minimum
number that would need to be rolled on GroupName for it to be a result.
· Given group "Weapons", with the first line being "4,dagger" and the second line being
"3,scimitar", {MinVal~Weapons,2} would return "5" (since 1-4 would yield "dagger"
and 5-7 would yield "scimitar")

Mod (Remainder)
{Mod~Dividend,divisor}
Divides "dividend" by "divisor" and returns the remainder
· {Mod~5,2} would return "1" (5 divided by 2 is 2, remainder 1)

Msg (Message Box)


{Msg~Message}
Displays "Message" in a message box; table execution is halted until the user clicks "OK".
· {Msg~Generating village} displays a message box which says "Generating village"

Note (Notation)
{Note~Text}
Displays "Text" in the results window in green; the text can be clicked on, and the user can
change what the text says. This editted information replaces what was originally in the
results window.

Page 20 of 36
TableSmith 4.5 Users' Manual

Or (Logical OR)
{Or~expression1,expression2}
Compares expression1 with expression2; if either or both are true, returns 1. If both are
false, returns 0. If there is an error in either, And returns -1.
· {Or~%var1%>3,%var2%=2} returns "1" if var1 is greater than 3 and/or if var2 equals 2

OrderAsc (Order Ascending)


{OrderAsc~"x",String}
OrderAsc takes the String given, divides it up using "x" (must be in quotes) as a delimiter,
and returns a string with its elements sorted in ascending order (divided by "x").
· {OrderAsc~",",skeleton,orc,troll} returns "orc,skeleton,troll"

OrderDesc (Order Descending)


{OrderDesc~"x",String}
OrderDesc works as "OrderAsc" above, but sorts in descending order.
· {OrderDesc~",",skeleton,orc,troll} returns "troll,skeleton,orc"

Ordinal (Ordinal Number)


{Ordinal~Number}
Ordinal returns "Number" with the appropriate suffix attached (i.e.; "1st" for 1, "22nd" for
22, "458th" for 458, etc.).

Param (Parameter Item)


{Param~Variable,Index}
If "Variable" is used as a list-type parameter, the list item with the given "Index" will be
returned.
· If "Class" is a parameter variable with entries "Warrior,Priest,Wizard,Rogue", then
{Param~Class,3} will return "Wizard"

Picture (Display Picture)


{Picture~Filename}
The graphic file "Filename" will be displayed in the results window. This file must be found in
the "Graphics" folder, found in the TableSmith folder, and the extension must be part of
"Filename". Any format that Microsoft Internet Explorer supports can be use, such as JPEG
(.jpg), GIF (.gif), and PNG (.png).

Page 21 of 36
TableSmith 4.5 Users' Manual

Plural (Make String Plural)


{Plural~String}
This function will return the string fed to it in its plural form. The following rules are used:
· Words ending in "ch", "o", "s", "sh", "x", or "z", are returned with "es" added to the
end.
· Words ending in "f" or "fe" are returned with "f" or "fe" replaced by "ves".
· Words ending in a consonant and "y" are returned with "y" replaced by "ies".
· All other words are returned with "s" added to the end.
· {Plural~wolf} returns "wolves"

Power (Raise to a Power)


{Power~x,y}
Returns the result of "x" raised to the power of "y".
· {Power~2,3} returns 8

Replace (Replace Text)


{Replace~SearchText,ReplaceText,SearchString}
Replaces each instance of "SearchText" in "SearchString" with "ReplaceText".
· {Replace~e,@,skeleton} returns "sk@l@ton"

Reset (Reset Group)


{Reset~GroupName}
Resets the specified group (if the group is a "non-repeating" group, it clears the "used" flags
for that group's entries). Similar to the "RS~" group call tag, but does not make a call to the
group.
· {Reset~Gems} resets the group "Gems"

Right (Rightmost Characters)


{Right~x,String}
Returns the rightmost x characters from "String".
· {Right~5,TableSmith} returns "Smith"

Round (Rounding)
{Round~SomeValue,x}
Rounds the passed-in value to "x" decimal places and returns it.
· If the variable "Coinage" equals 5.32, {Round~%Coinage%,1} returns "5.3"

Shell (Shell Command)


{Shell~Command}
Shell runs the "Command" text outside of TableSmith. This can be used to call external
programs.
· {Shell~c:\gameprogs\addtonames.exe Zalagor} calls the program
"c:\gameprogs\addtonames.exe" and feeds it the command-line parameter "Zalagor"

Page 22 of 36
TableSmith 4.5 Users' Manual
SortAsc (Sort Ascending)
{SortAsc~Var1,Var2,Var3,...}
SortAsc will look at the values in the list of variables following the "~", sort them in an
ascending manner, and re-assign them to the variables in the sorted order. SortAsc will
determine whether the list is numeric or alphabetic. Nothing is returned by this function.
· Given the variables Gem1, Gem2, and Gem3, equal to "Emerald", "Sapphire", and
"Diamond" respectively, {SortAsc~Gem1,Gem2,Gem3} assigns "Diamond" to Gem1,
"Emerald" to Gem2, and "Sapphire" to Gem3

SortDesc (Sort Descending)


{SortDesc~Var1,Var2,Var3,...}
SortDesc works exactly like SortAsc (above), but sorts in a descending manner.
· Given the variables Gem1, Gem2, and Gem3, equal to "Emerald", "Sapphire", and
"Diamond" respectively, {SortDesc~Gem1,Gem2,Gem3} assigns "Sapphire" to Gem1,
"Emerald" to Gem2, and "Diamond" to Gem3

Split (Split)
{Split~VarToSplit,"x",Var1,Var2,Var3,...}
The Split function is somewhat complex. Following the "~", is the name of a variable
(without "%"'s), then a delimiter (in quotes), and then a list of variables. What Split does is
to take the first variable ("VarToSplit" shown above), divide it up, and copy the results into
the variable list ("Var1", "Var2", etc.). The delimiter character is used to divide the first
variable. The example below illustrates:
· Given the variable AbilityScores, equal to "78,56,60",
{Split~AbilityScores,",",Strength,Intellect,Agility} would assign "78" to the
variable Strength, "56" to Intellect, and "60" to Agility

Sqrt (Square Root)


{Sqrt~SomeValue}
Returns the square root of the value given.
· {Sqrt~9} returns "3"

Status (Display Status)


{Status~Message}
Displays the text in "Message" in the right panel of the TableSmith status bar. This text
remains until changed by another call to Status; {Status~} will clear the panel.
· {Status~Generating village} displays "Generating village" in the status bar's right
panel

Stop (Stop Table Generation)


{Stop~Message}
Displays "Message" in a message box; table execution is halted once the user clicks "OK".
· {Stop~Generating village} displays a message box which says "Generating village",
then stops when user clicks "OK"

Page 23 of 36
TableSmith 4.5 Users' Manual
TableExists (Check if Table Exists)
{TableExists~TableName}
Checks to see if a table called "TableName" can be found in TableSmith's "Tables" folder (or,
rather, in the folders inside of "Tables"). If no such table can be found, returns a "0";
otherwise, returns a "1".

Trim (Trim Spaces)


{Trim~String}
Trims the spaces from the beginning and end of "String" (spaces in the middle, surrounded
by other characters, are unaffected).
· {Trim~ a castle } returns "a castle"

Trunc (Truncate)
{Trunc~SomeValue}
Returns the result of truncating the given value (drops the fractional portion, if any).
· {Trunc~3.5738472} returns "3"

UCase (Upper Case)


{UCase~String}
Returns "String" in all upper case.
· {UCase~TableSmith} will return "TABLESMITH"

Unlock (Unlock Entry)


{Unlock~Group,Values}
In a non-repeating table, Unlock clears the "already selected" flags of the entries with the
probability values listed. "Values" can be a single number, a range of numbers, or a
combination.
· {Unlock~Gems,3,7-9} will clear the flags for whatever entries encompass 3, 7, 8, and
9 so they can be used.

Used (Used Already)


{Used~Group,Entry#}
The Used function is used to determine if an entry in a non-duplicating group has already
been called. Following the "~" is the name of a group in the current table (or in a different
table, in the standard "table.group" syntax), and then a number. If the entry that that
number corresponds to has already been selected in the specified group, the function
returns a 1. If the entry hasn't been selected, the function returns a 0. If that entry cannot
be found (ex: the group goes from 1-10 and the number given to the Used function is 12),
then a -1 is returned. Passing in a "0" as the entry number checks all items in the group,
returning a 1 if the group is "used up".
· {Used~Weapons,5} returns "1" if entry 5 has been used previously, 0 if not, and -1 if
entry 5 does not exist in "Weapons"

Version (Version)
{Version~}
Returns the version of the TableSmith engine.

Page 24 of 36
TableSmith 4.5 Users' Manual
VowelStart (Vowel Starts)
{VowelStart~Text}
If "Text" starts with a vowel (A, E, I, O, or U), this function returns a 1; otherwise, it returns
a 0.
· {VowelStart~%var1%} returns "1" if var1 starts with a, e, i, o, or u; if var1 starts with
a consonant, it returns a "0"

Xor (Logical Exlcusive OR)


{Xor~expression1,expression2}
Compares expression1 with expression2; if either is true, returns 1. If both are false or both
are true, returns 0. If there is an error in either, And returns -1.
· {Xor~%var1%>3,%var2%=2} returns "1" if var1 is greater than 3 or if var2 equals 2,
but not if both are true

While (While Loop)


{While~n,Text}
Displays the results of "Text" as long as "n" is not equal to 0
· {While~%ctr%,Hello!} will return "Hello!" as long as the variable "ctr" is not 0

Parameters
TableSmith supports "parameters." Parameters allow you to pass values from one table to
another, or query a user for input before rolling on a table.
Parameters take up a single line and follow the format below:
@x,n,prompt,option1,option2,option3,...
the "@" symbol tells TableSmith that the line is a parameter. "x" is one of TableSmith's
variables - this is the variable that will receive a value, either from another table or from the
user. "n" is the default value to use if no input is given. Prompt is the text to display to the
user if the table is called directly from TableSmith (as opposed to being called by another
table). If nothing else is listed, the parameter is considered "text". If other items are listed
(as in "optionx", above), then the parameter is considered to be a "list". If the table is called
directly from TableSmith, "text" parameters are entered directly by the user, while "list"
parameters present the user with a list (the items shown as "optionx") from which they
select a single item. The text entered (for "text") or the number of the option selected (for
"list") is what is assigned to the variable.
Here's an example:
@name,1,Enter a name
@gender,1,Select a gender,Male,Female
When the table containing these lines is run, the first item will be displayed in the
Parameter dialog box as a text box, with the user prompted to type a name. This name will
be assigned to the variable "name". The second item will be displayed as a list, where the
user can select either "Male" or "Female". If they choose "Male", the variable "gender" will
be assigned the value "1". If "Female" is chosen, the value assigned to "gender" will be "2".
You can also pass parameters to a table in a table call. You don't have to, nor do you have
to pass a value for each parameter. To pass parameters, you use parentheses after the
table call, like so:
1,[CharGen.Start(3,4)]

Page 25 of 36
TableSmith 4.5 Users' Manual
In this example, the CharGen table is called, with 3 and 4 being passed in. Before the
"Start" group of CharGen is called, the value 3 will be assigned to its first parameter (call it
"G") and the value 4 will be assigned to its second parameter (dubbed "C"). Since the table
is being called from another table rather than TableSmith itself, the prompts are not used.
All the parameters don't need to have a value passed in. The following all work in
TableSmith (using the previous example):

· 1,[CharGen.Start(3,)] (G=3, C=default)


· 1,[CharGen.Start(,4)] (G=default, C=4)
· 1,[CharGen.Start(,)] (G and C default)
· 1,[CharGen.Start] (G and C default)

Pregeneration Directives
You can put "pregeneration directives" in your table to override interface settings. A
directive follows the following format:
/DirectiveCommand parameter(s)
Directives only are applied from tables that are called from the interface (i.e.; tables called
from within other tables will have their directives ignored). Supported directives are listed
below.

Background Color
/BackColor nnnnn
If the output is for HTML, the background color will be set to "nnnnn". This color can be any
color or format that the HTML Body attribute "bgcolor" recognizes.
· /BackColor green will display a green background in an HTML results display

Background Image
/Background nnnnn
If the output is for HTML, the background image will be set to "nnnnn". Remember that this
is relative to where the HTML results file is, so you may want to use an absolute path.

Override Number of Rolls


/OverrideRolls x
Generates results from the table "x" number of times, rather than what is shown on the
interface.
· /OverrideRolls 3 will always roll on the selected table three times

Force Output Type


/OutputType HTML | XML | Text
Outputs the generation results in the specified format (HTML, XML, or Text), regardless of
what the user has specified in "Preferences".
· /OutputType XML will output a table in XML at all times

Page 26 of 36
TableSmith 4.5 Users' Manual

Miscellaneous
A few other things to note:
· Group entries can be split into multiple lines. Whenever TableSmith reads in a line
starting with an underscore ("_"), it appends that line to the previously read-in entry.
Example:
:Start
1,You find [Weapon] and
_ [MagicItem]
in a table file becomes:
:Start
1,You find [Weapon] and [MagicItem]
internally.
· TableSmith will accept command-line parameters. The syntax is [Table
Name.Group]:x. "x" is the number of rolls to make, while "Table Name.Group" is a
standard group call (tags and modifiers work as normal).
· If you want to print an actual percent sign ("%") or square bracket ("[","]"), precede
the character with the slash character ("/").
· Parameters can be passed to a table regardless of which group you call in that table.
· If you want tabs or carriage returns in your output, use the characters "^T" and "^M",
respectively. This isn't as useful if you are using HTML output, but may be helpful for
text or XML results.
· If you want to clear out a variable, simply assign nothing to it, like so: "|A=|".

Page 27 of 36
TableSmith 4.5 Users' Manual

TableSmith Quick Reference


Groups

Group and table names cannot include the characters "+", "-", or "="

:GroupName ':' - group lists entries in ranges


1,Entry 1
2-3,Entry 2

;GroupName ';' - group lists entries in probabilities


1,Entry 1
2,Entry 2

;!GroupName '!' - group entries cannot be repeated in multiple calls


1,Entry 1
2,Entry 2

Group Calls
[xx~Group@mod] xx - group call "re-roll tag" (optional)
[xx~Table.Group@mod] @ - "+", "-", or "=" (optional)
mod - modifier to add, subtract, or set equal to

LN~ Returned result may be re-rolled

Variables
· Must be declared at start of table, with a default value:
o %VarName%,5
· May contain numbers or text
· May be any name; may include spaces
· When used, name must be surrounded by percent signs ("%"); value in the variable is
substituted for percent signs and variable name
· When assigning a value to a variable, the percent signs are not used, and the
assignment is encapsulated by pipes ("|"); the assignment does not display anything in
the results window

Variable Assignments
|VarName?x| VarName - variable name
? - "+", "-", "*", "/", "\", ">", "<", "&", or "="
x - value to assign to or modify variable
+, -, *, / Add to, subtract from, multiply by, divide by
\ Divide and round
> Assign the larger of the two values to the variable
< Assign the smaller of the two values to the variable
& Concatenate text
= Set variable equal to value given

Page 28 of 36
TableSmith 4.5 Users' Manual

Parameters
· Must be declared at start of table, but after variables
· Either prompts user to enter text or select an items from a list
· Text format: @x,n,prompt
· List format: @x,n,prompt, option1,option2,option3...
· 'x' in each example above is the variable to assign the parameter value to; for text, the
user-entered text is assigned to the variable; for lists, the number of the selected
choice is assigned ('1' for the first, '2' for the second, etc.)
· Can be passed into table calls, as in [CharGen.Start(3,4)]; passing parameters in is
optional, and not all parameters need to be accounted for

Pregeneration Directives
OverrideRolls x Rolls "x" times on the table rather than what the interface
shows

OutputType HTML | Outputs results in specified format


XML | Text

Functions
Abs~Number Absolute value of Number

And~expr1,expr2 Returns "1" if expr1 and expr2 are both


true, otherwise "0"

AorAn~Text Appends "an " or "a " to "Text", depending


on whether "Text" starts with a vowel

Bold~Text "Text" will be displayed in boldface

Calc~Expression Calculates the result of the given expression

Cap~Text Capitalizes first character of Text

CapEachWord~Text Capitalize each word of Text

CarRet~, CR~ Inserts a carriage return

Ceil~Number Returns the smallest integer higher than or


equal to "Number"

Count~Group Returns the number of entries in 'Group'

Debug~Caption Displays various information for debugging


purposes

Dice~XdY?Z Dice roller

DSAdd~VarName Adds a new (empty) item to the end of the


dataset "VarName"

DSCount~VarName Returns the number of items in the dataset


"VarName"

Page 29 of 36
TableSmith 4.5 Users' Manual

DSCreate~VarName,Field1,Default1, Creates a dataset, assigns it to the variable


Field2,Default2, ...Fieldx,Defaultx "VarName", and defines the names and
defaults of each field

DSFind~VarName,StartingIndex, Starting at item at "StartingIndex", using


SearchExpression1, "SearchExpressionX", searches dataset
SearchExpression2, etc. "VarName" and returns index of first
matching item

DSGet~VarName,Index,Field Returns the value of "Field" in the item at


"Index"

DSRandomize~VarName Randomly orders the items in the dataset


"VarName"

DSRead~VarName,Filename Reads the file "Data\Filename.tsd" into


"VarName"

DSRemove~VarName,Index Removes the item at "Index"

DSSet~VarName,Index,Field1,Value1, In the dataset "VarName", for the item at


Field2,Value2, ...Fieldx,Valuex "Index", sets Field1 to Value1, Field2 to
Value2, etc.

DSSort~VarName,Field1,Direction1, Sorts the items in "VarName"


Field2,Direction2,
...Fieldx,Directionx

DSWrite~VarName,Filename Writes the dataset "VarName" to a data file.

Extern~Library.Object,StringToPass Calls an Add-On tool, passing it


"StringToPass"

Find~x,String1,String2 Returns point where String1 is found in


String2, starting at point "x"

Floor~Number Returns the largest integer smaller than or


equal to "Number"

Generate~0,Text,Group Call Imbeds linkable "Text"; when clicked,


"Text" is replaced by the results of "Group
Call"

If~conditional ? Result1/Result2 Returns "Result1" if conditional is true,


otherwise nothing or "Result2" (if present)

IIf~conditional ? Result1:Result2 Returns "Result1" if conditional is true,


otherwise nothing or "Result2" (if present)

Input~Variable,Prompt,Default Prompts user for input during execution,


which is placed in "Variable"

Italic~Text "Text" will be displayed in italics

LastRoll~ Returns the last group called and the


number rolled on that group

Page 30 of 36
TableSmith 4.5 Users' Manual

LCase~Text Returns "Text" in all lower-case

Left~x,Text Returns leftmost x characters of Text

Length~Text Returns the length (number of characters)


in "Text"

Line~alignment, width Inserts a line into the results at "alignment"


(left, center, right) of a "width" percentage

Lockout~Group,Values Locks out (i.e.; flags as used) the entries in


"Group" that match the listed "Values"

Log~FileName,Text Adds "Text" to the end of a file named


"FileName"

Loop~n,Text Evaluates and returns 'n' interations of


"Text"

Max~Var1,Var2,...Varx Returns the largest value from the listed


variables

MaxVal~Group,x Returns the maximum roll that will still


select entry (line) 'x' from group 'Group'

Mid~x,y,Text Returns middle X characters from Text


starting at y

Min~Var1,Var2,...Varx Returns the smallest value from the listed


variables

MinVal~Group,x Returns the minimum value needed to roll


entry (line) 'x' from group 'Group'

Mod~Dividend,divisor Divides "dividend" by "divisor" and returns


the remainder

Msg~Message Displays Message in a message box

Note~Text Displays "Text" as clickable result; user may


click and change the text

Or~expr1,expr2 Returns "1" if expr1 and/or expr2 are true,


otherwise "0"

OrderAsc~"x",Text Returns an ordered string (ascending)

OrderDesc~"x",Text Returns an ordered string (descending)

Ordinal~Value Returns a number with an ordinal suffix


attached

Param~Variable,n If "Variable" is used as a list parameter,


returns the list item with the index 'n'

Picture~Filename Displays "Filename" from the "Graphics"


directory

Page 31 of 36
TableSmith 4.5 Users' Manual

Plural~Text Makes Text plural

Power~x,y Raise "x" to the power of "y"

Replace~SearchText, Goes through "SearchString" and replaces


ReplaceText,SearchString "SearchText" with "ReplaceText"

Reset~GroupName Resets non-repeating group

Right~x,Text Returns rightmost x characters of Text

Round~Number,x Rounds Number to x decimal places

Shell~Text Shells out, calling "Text"

SortAsc~Var1,Var2,...Varx Sorts (ascending) and replaces the values in


the variables

SortDesc~Var1,Var2,...Varx Sorts (descending) and replaces the values


in the variables

Split~VarToSplit,"x",Var1,Var2, Splits VarToSplit into Var1, Var2, etc. using


...Varx x as delimiter

Sqrt~Number Square root of Number

Status~Message Display Message in right panel of status bar

Stop~Message Displays Message, then halts table


execution when user clicks 'OK'

TableExists~TableName Returns "1" if a table exists with name


"TableName"; otherwise, "0"

Trim~Text Trim spaces from Text

Trunc~Number Truncate Number

UCase~Text Returns "Text" in all upper-case

Unlock~Group,Values Unlocks (i.e.; flags as available) the entries


in "Group" that match the listed "Values"

Used~Group,Entry# See if an entry in a non-repeating group has


been used already; use "0" for "Entry#" to
check the entire group rather than a single
entry

Version~ Returns the current version of the TS


engine

VowelStart~Text Return "1" if "Text" starts with a vowel,


otherwise "0"

Xor~expr1,expr2 Returns "1" if expr1 or expr2 are true (both


not both), otherwise "0"

Page 32 of 36
TableSmith 4.5 Users' Manual

While~TextToCheck,Text Calls "Text" for as long as "TextToCheck"


does not equal 0

TableSmith Support
TableSmith is shipped fully functional. If you have problems or questions, contact the author
via e-mail at akira@mythosa.net.
Technical support for unregistered users will only be provided for problems dealing with
download or installation. Registered users will receive technical support for the program
itself. Please see the Legal Information page for information on registering TableSmith.
There is also a TableSmith mailing list hosted through Yahoo! Groups:
(http://games.groups.yahoo.com/group/TableSmith/).
This is a users-helping-users forum and is comprised of other TableSmith users whose
experience may assist in answering your questions. In addition to community support, the
TableSmith group also provides access to a large number of user-submitted tables, all freely
available for download, and links to related websites.

Other Utilities
TableSmith is just one of the Campaign Master RPG Utilities. The utilities are tools intended
to assist Gamemasters by automating some of their tasks, as well as making certain things
easier (mapping, name generation, etc.).
For more information on other tools, contact Bruce Gulke at akira@mythosa.net or visit the
Mythosa Web site at www.mythosa.net.

Page 33 of 36
TableSmith 4.5 Users' Manual

TableSmith History
4.5
· Added function: "TableExists"
· DSWrite function now embeds carriage returns for human-readability
· Fixed "Dice" function so dice with more than 32767 sides may be used
· Fixed bug that would crash program if a value in scientific notation was entered for the
number of rolls
4.4
· Fixed bug with "Cap" function (didn't work properly if fed an empty string)
· Added functions: "DSCreate", "DSAdd", "DSCount", "DSWrite", "DSRead", "DSSet",
"DSGet", "DSRemove", "DSFind", "DSSort", "DSRandomize"
· Following functions deprecated: "ArrNew", "ArrItem", "ArrGet", "ArrRemove",
"ArrExists", "ArrClear", "ArrCount", "Data"
4.3
· Converted internal data types to support numbers larger than 32767
· Added functions: "CR", "LastRoll", "Log", "Mod"
· Functionality added to allow for accessing variables in other tables
· "Create New Table" menu option added
· "Display Hidden Categories" menu option added
· Added pre-generation directives "BackColor" and "Background"
4.2
· Added functions: "Bold", "CarRet", "Generate", "IIf", "Italics", "Line", "Picture",
"Power", "Version", and "VowelStart"
· Added preliminary graphical editor
4.1
· Added logical functions "And", "Or", and "Xor"
· Added pre-generation directives to allow tables to override UI settings
· Added pre-generation directives "OverrideRolls" and "OutputType"
· Changed the format of the "Left", "Mid", and "Right" functions to fix potential
problems if "text" included a comma
· Fixed a bug where parameters with dashes would not function properly
4.03
· A loaded XML file will refresh with click of "Reload" button, as tables do
· Added "Break" feature
· Added toggle to menu for switching between generator and archives
· Modified "Used" function to check if an entire group has been "used up"
· Made more functions keyboard-accessible

Page 34 of 36
TableSmith 4.5 Users' Manual
· Added option to immediately re-roll the table you have currently selected when you
click "Reload"
· Fixed a bug with the "While" function that prevented it from working if not at the
beginning of an entry
4.0
· Added the following functions: "Ordinal", "Shell", "Extern", "While"
· Allowed display and export to XML and text as well as HTML
3.96
· Enchanced "Plural" function
· Added functions for associative arrays (ArrNew, ArrItem, ArrGet, ArrRemove,
ArrExists, ArrClear, ArrCount)
3.95
· Added many new functions (Count, MinVal, MaxVal, Ceil, Floor, UCase, LCase, Loop,
Unlock, Param)
· Enchanced "If" function
· Removed obsolete group call functionality for conditional calls and looping
· Truncation division ('\') added to Calc function
· Miscellaneous bug fixes
· Allowed for the display of square brackets ('[',']')
3.9
· Added new functions (Calc, Input, Debug, Cap, and AorAn)
· Allowed for the display of percent signs ('%')
· Parameters may now be passed to groups in tables other than 'Start'
· Printing and copying now available from the menu
· Errors messages display table line numbers
· Added option to turn off 'links' and 'notes' in HTML export
3.8
· Added "If" and "Find" functions
· Replaced category file with folders in Tables directory
· Allowed user to specify location of Tables directory
· Allowed user to specify editor for editting table files
· Added title/splash screen
· Program now remembers desktop position from previous session
3.7
· Added "Notes" function to allow user to annotate notes to results files
· Added "Archives" feature to allow easy storage and retrieval of TableSmith results
· Error dialogs now allow the user to cancel out of them
· More new functions

Page 35 of 36
TableSmith 4.5 Users' Manual
· Fixed bug where parameters didn't work when TableSmith was called from the
command-line
· Clicking on a "re-roll" link returns user to point of clicking
3.6
· Merged dice roll functionality into functions feature (function 'Dice')
· Added XML-reading capability via Data function
· Conditional checks now allow checking with strings
· Nesting of functions and group calls now permitted
· Added many new functions
· Improved error-handling
3.5
· Fixed problem that limited table results to 32768 characters
· Added Functions to TableSmith format
· Re-did parameter entry interface
· Re-arranged main user interface
· Added "re-roll" tag for table/group calls
3.0
· Unlimited variable support
· Added/modified conditional tags
· New operators added ("<", ">")
2.0
· UI re-design
· Parameter support
· Additional group format
· Added/modified conditional tags
· Added non-duplication feature
1.6
· Added new tags for user-readability
1.5
· Changed Web browser control
· Minor enhancements
1.4
· Minor enchancements
1.1
· Addition of variables and table modifiers
1.0
· First implementation of the TableSmith

Page 36 of 36

Вам также может понравиться