• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.

TableSmith Scripting Environment: Easy Software for Gamers

RainOfSteel

SOC-14 1K
There doesn’t seem to be a whole lot of awareness on CotI (or the TML, for that matter) about a great gaming scripting environment called TableSmith, so, without further interruption . . .

What is TableSmith? It's this great little scripting program for gamers that makes it easy to automate . . . tables (surprise!).

Example:
</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">:Start
1,Red
2,Yellow
3,Blue</pre>[/QUOTE]When TableSmith executes the above, it returns the text of one of the three colors.

By being just a little more complicated (and adding in some dice function support):
</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">:Start
1,{Dice~2d6} [EncounterBeings] [EncounterAction]
.
:EncounterBeings
1,Vargr Raiders
2,Zhodani Nobles
3,Aslan Females
.
:EncounterAction
1,attack you!
2,are lost and looking for directions.
3,are holding a barbecue.</pre>[/QUOTE]When TableSmith executes that, the results can be:
</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">5 Zhondani Nobles are holding a barbecue.

12 Vargr Raiders are lost and looking for directions.

3 Aslan Females attack you!</pre>[/QUOTE]By being a little more complicated, you can, like I, create a script to automate the rolling of Bulk Cargos and Passengers (for T20, anyway, much like Morte did before me, though he used Visual Basic).

It's just like entering in charts and tables from all the game books of all time and having the program run the results for you. Except with TableSmith you make whatever tables you want.

By adding in utility functions, a great many things can be accomplished. There are hundreds of existing "tables", and since any table can call on any other table, well, there is a great deal of work available to draw on.

Some of the most useful are the name generators (many, many kinds of name generators), but there is much else besides: NPC Generators, treasure generators, GM Aids, etc.


Mythosa TableSmith Page

Yahoo TableSmith Support Group

The support provided by the author at this site is excellent, he visits almost every day and will answer virutally any question. He has incorporated a great many user requested features into TableSmith, and seems like an all-around great guy, since he does it all for free.

Why do I go over all this? Proselytization, of course, I wish to convert everyone to the cause . . . (what cause you ask, well, mostly just getting the word out about a great gaming tool). TableSmith can be used for a billion things to aid gaming pursuits. :D
 
I'll follow on with a couple of points I seem to have missed.

INSTALLATION

TableSmith is a single downloadable Install file.

Download it, double click to run, and pick your install directory.

USE

A variety of example "tables" (the basic scripting unit, each is a ".tab" suffixed file) are provided with the install.

Tablesmith itself, once started, is a simple application window. On the right hand side is a navigation system that lets you pick which directory/folder to look at to find a .tab file. On the left hand side is the output window, where the results of a Table's execution appear.


Double click on any table in the list, and away TableSmith goes, generating whatever the table has been set to create, from a list of cargos to a collection of NPCs, equipment lists, whatever you care to make.


TABLES

The example tables that come with the TableSmith install are fairly basic, but do manage to display a lot of the capabilities of the program.

On the Files section of the Yahoo group, there are scores of tables, some quite advanced and far-reaching (though, unfortunately, heavily fantasy based . . . because that's been the interest behind the average user so far . . . hmm, I wouldn't be trying to generate interest to change that, would I, no, I'd never do such a blantantly obvious thing, would I?).

Between the help files, all the example tables, and the more advanced user-created tables, and the user-help on the mailing list, you can find virutally any way to accomplish any task. Some people actually design plug-in/add-on programs (TableSmith is built to work with COM objects)! There is even a port of TableSmith to PalmOS (although that piece costs money, sorry)!

A favorite Table of mine generates an annual calendar, complete with moon phases, temperatures, and weather effects (for 365 days).


DESIGN

Lastly, all one has to do is write the scripting commands (tables, really, as shown in the examples above), start up TableSmith, and double-click a table name to create its output.

Even if you have no programming experience at all, it is very easy to convert any game system's random encounter (or random whatever) tables into TableSmith Tables.


More later . . .
 
That's pretty cool. Simple, yet useful.

I imagine there's a Perl module that can interpret TableSmith scripts. If not, then there ought to be...
 
Make it so!

file_22.gif
 
robject,

Well . . . you could be the one to make such a module. I'm sure the author, Bruce, would be happy to receive your efforts.

But don't forget, there are plenty of *easy* things to do with or design for TableSmith even before working on such major developer issues (says he, hoping to draw out the interest of people who otherwise might shy away from "programming").
 
Originally posted by BeRKA:
</font><blockquote>quote:</font><hr /> I imagine there's a Perl module that can interpret TableSmith scripts. If not, then there ought to be...
I was thinking the same thing... </font>[/QUOTE]Something like this untested and unfinished script:

</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">#!/usr/bin/perl
use strict;

#
# Split on the colon
#
$/ = ":";
my %tables = ();

#
# Read the file
#
open IN, $source_file;
while(<IN>)
{
my ($table_name, @options) = split( "\n" );
$tables{ $table_name } = \@options;
}
close IN;

#
# Now run the script...
#
my $current = 'Start';
while( 1 )
{
my $opt_ref = $tables{$current};
my @opts = @$opt_ref;
my $option = $opts[ rand(@opts) ];

#
# Well, now we have to interpret the option.
# I'll figure that out later...
#

# Split on commas & discard line index.
my ($line_number, @phrases) = split( ',', $option );

# Evaluate each phrase:
foreach (@phrases)
{
# If it's in [], set $current
if ( /\[(.*?)\]/ )
{
$current = $1;
}
# If it's in {}, execute built-in function
elsif ( /\{(.*?)\}/ )
{
execute_builtin_function( $1 );
}
else # Otherwise, just print it.

{
print $_;
}
}

}</pre>[/QUOTE]
 
robject,

I don't know Perl, and so only have an overview understanding of that code, but it looks like that goes in the right direction.

Go ahead, download TableSmith 4.4, and check it and it's documentation out. Bruce is very approachable, and he'll tell you what assistance he can provide.


There are plenty of other things it can do:

:Start is the traditional begininning of a TableSmith script, and it is called a "group".

[EncounterBeings] is a "group call" that calls on :EncounterBeings.

Groups with 1, 2, 3, 4, etc. in them work just like rolling dice. But groups can also be prefixed by ";" and writen 4, 1, 7, and in this case, the internal "roll" of 1-4 selects the first option, a 5 selects the second option, and 6-12 selects the last option.

Group Calls can be modified by literals or variables.

[EncounterBeings=3] always selects 3,Aslan Females.

[EncounterBeings-1] always subtracts 1 from the 1-3 "rolled" to determine which option is selected.

Groups that begin with ";!" are non-repeating groups.

There are a number of functions just to support non-repeating groups, including checking to see if an option on the group has been used up, and re-enabling the option if desired.

There are lots of functions. I was quite fond of Arrays and their functions, but they were deprecated in 4.3 in favor of the new more robust Dataset functions.

There are functions for causing the "output" to appear highlighted and underlined, and you can click on it as if it were a hyperlink, but intsead it causes whatever code that generated that particular individual output to re-execute without altering any of the other output.

I've barely scraped the surface.
 
Oh, I forgot to mention that TableSmith's "output" window is really a browser window that interprets HTML, and so HTML can be "generated" side by side with text to produce nice formatted output.
 
New Tablesmith Release Announcement

Tablesmith 4.5 Beta is now available.

See Message #3231 on the Yahoo! Group for a description of new features (it's very minor this time around, just one function added in).
 
Back
Top