TableSmith Tuesday Introduction (Part 5 – Useful Functions)

Posted on Updated on

What makes TableSmith so powerful is the scripting elements.  It lets you do more than Fill-in-the blanks Mad-Libs, or create straight Stat Tables.  It lets you make tables that contain an internal consistency, it let’s you correct unexpected grammar issues (usually).  In fact there are 80 some functions in TableSmith, and unless you use datasets, or are making a table with EXTREME mathematics, you’ll most likely only use the ones that I’ve detailed here.

GRAMMAR Functions:

These function will help make your table ‘sound’ right when it spits out your table.  A properly crafted table will use these often, and will build groups that expected to be manipulated by these functions. In any of the functions which manipulates only the first letter, make sure that you don’t have a space before your group entry.  Or TS, will think the space is the first letter.

  • AorAn – Based on the simplest of concepts, the AorAn function will simply check the first letter of the word, if it is a vowel, it outputs “An”, if it’s a consonant you’ll get “A”.  Be careful though,  because you don’t attend “An” University, you wouldn’t want “An” Unicorn.  In fact you probably don’t want “An” with any ‘ewe’ sounding words.
  • Cap – Again, based on the simplest of concepts, the Cap function will simply make the first letter of the word and make it a Capital!  When properly building a group you almost always want to write each item in lowercase so that when you want it to be capitalized you can use Cap~.
  • CapEachWord – This function capitalizes each letter that has a space before a letter.  The most common use of this function is when you are generating a Proper Noun.
  • Plural – There are some complicated grammatical rules for making a word plural.  Tablesmith follows some of the most common rules, but ignores the more complex rules.  Singular/Dual nouns are ignored (Deer, Moose, etc).  Irregular -en (Archaic forms) are ignored (Child/Children, Ox/Oxen), as are mutated plurals (Foot/Feet).  And well just forget it if you are using latin/greek words (-ex/-ix won’t become -ices, -on won’t become -a, -um will not become -a ).
  • PluralIf  – And here is a great conditional use of Plural.  It should be the only use of plural if you are following the previous rules set out by myself to create complex tables.  This will definitely be useful when you are building tables that are reusable.

CONDITIONAL Functions:

After Grammar Functions the most common functions that a table writer is going to use are going to be conditional functions which helps the tablemaker make decisions on output based upon a certain set of predetermined rules.  If you have any kind of programming background these are your bread and butter, if you don’t they can be a little confusing.

  • If – This is the basic conditional statement.  It really is less confusing than you would believe.  “{If~Expr ? Result1/Result2}” is the format of the statement.  “Expr” is made up of three parts; Variable, Evaluator, Case.  We talked about variables in Part 2.  So that part should be easy for you.  The Evaluator is what you use to evaluate the variable against the case.   This uses pretty standard mathmatic expressions: “=” equal too, “!=” not equal too, “<” less then, “>” greater then, “<=” less than or equal too, “>=” greater than or equal too.  The Case is a second variable, a static number, or static string.  Result1 is going to be what is called your True Statement, and Result2 is your False Statement.
  • Loop – An extremely useful function that will do whatever you are telling it to do for a certain amount of iterations.  For instance if you wanted to display 15 Gems you’d write the function {Loop~15,[Gems]}
  • While (While loop) – Much like PluralIf, this loop is a conditional function.  It has it’s uses but requires a little more planning then a normal loop.  But they are almost interchangeable in use.

GROUP Functions:

There are a couple of common group functions that you should get used too.  I personally haven’t had many times when I’ve needed them, but it does come up when you want to do re-rolls, or have a table that doesn’t spit out multiple same results.

  • !GroupName – By using the !-flag you make a group non-repeatable.  Which means when an option is selected one time it will not be available on a second roll.  This helps make sure you can’t have the same result multiple times.
  • Lockout – Much like !-flag, you can manually lock items out of group.  This is useful if you have one group that just doesn’t make a lot of sense when you need to use that result in conjecture with a different group.
  • Reset – Pretty self-explanatory.  It’ll reset any Locked out table when you need too.

DEBUGING Functions:

It sometimes becomes necessary to be a little more proactive in debugging a table beyond trying to brute force it.  And fortunately there is a plethora of functions available too you to do it.  We will focus on the two that I have found to be the easiest and best to use.

  • Debug – This function can almost overload you with information.  One of the most common errors that you will run into that causes quite a lot of confusion and face-palming is failing to properly assign variables, or simply leaving them blank.  When you put in the Debug Function in the group it will display all the variables and their values!  Incredibly useful if you are getting blank results.
  • TableExists – Ready for some Table compatibility?  Don’t you wish that more tables would let you know that it doesn’t have the right supporting tables?  Well, perhaps we should all start using this function a little more.  I could imagine a Group Call which uses this function to check that all of our dependencies are there, and if not let the user know which tables they need to get.

Well Folks, that’s it for this weeks TST!  I’d love to hear more about what your most commonly used functions are.  We all benefit from sharing our experiences.

Advertisements

3 thoughts on “TableSmith Tuesday Introduction (Part 5 – Useful Functions)

    Kheferen said:
    June 1, 2011 at 9:54 pm

    You have mad orgaization skills!

      Kheferen said:
      June 1, 2011 at 9:56 pm

      Spellcheck or proo-freading is a good thing too “organization”

    TheRandomDM responded:
    June 1, 2011 at 10:17 pm

    Kheferen, thanks for the words of encouragement.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s