& char_data.tcl & char data system & char data This is the help file for Rhysem@M*U*S*H's char_data.tcl script. Copyright 1998-1999, Jonathan A. Booth (kamikaze@imsa.edu). The char_data.tcl script is a script I wrote to store data on characters. This script works in conjunction with my db.tcl script, and will not work without it. Available topics: (use 'help char data ' to access these) changes license Available commands: @data Defined functions in the MUSH: data_calculations() data_class() data_cleanup() data_get() data_set() data_split() If there are any errors in the help text, or you notice anything you think might be a bug in the char_data.tcl script, send mail to me describing the problem, and preferably with some debugging output (a log of @data/list, and the tcl error code displayed to #1 when the error occurs). See also: 'help db' & char data changes Version 1.0 - Initial public release Pre-char_data.tcl - Before char_data.tcl, there were MUSHcoded functions which did similar things to the functions in char_data.tcl, but they were slower, and not as flexible. That is where the idea for char_data.tcl came from, and it was spawned as an upgrade to those functions. See also: 'help char data' & char data license char_data.tcl non-profit license: * You may redistribute the char_data.tcl code, provided that the code is unmodified and that the help files (specifically the copyright and license notices) are distributed along with the code. * There is no warranty (express or implied) on the char_data.tcl code or help-files. If something breaks, you get to keep all the pieces. * You may use the code for free for an unlimited about of time and users provided that the license and copyright notice are retained and unmodified. * Any changes you make to the help-files or char_data.tcl code should be resubmitted to the author in a timely manner. char_data.tcl commercial license: * Please contact the author for commercial licensing information. See also: 'help char data' & @data @data[/ [args]] This commands performs wizard interaction with the data.tcl script. It allows a wizard to see the current list of entries in the lookup table, do some debugging, and to add entries to the table. Without any switches, it will print out the valid switches for the command. Valid switches are: /add /= - add a stat. must already be in the database via @dbase/set. /help - print a help message /list - print out the table of stats /load - reload the table of stats from disk /remove / - remove a stat /save - save the table of stats to disk /version - print version information The arguments to /set have the following meanings: name - The "full name" to be displayed for this stat. type - The type of the . This might be "ATTRIB" or "SKILL". calc - The calculations used to compute the value of the stat. (continued in help @data2) & @data2 The format for the calculations are as follows: KEY1 WEIGHT1 KEY2 WEIGHT2 KEY3 WEIGHT3 When the system tries to get the value for a player's stat, it takes the value the player has for each KEY and multiplies it by that KEY's WEIGHT. Obviously, each WEIGHT should be numeric, and each KEY should be a unique (from the other KEYs in the char_data system, even if the other KEYs are of a different type they still must have different names!) string without the & character in it. Modifiers are added into the calculation, but must have different KEY names. I tend to put an @ sign in front of any modifiers to the KEYs. Examples of commands to populate the char data: @data/add Agility/attrib=agi 1 @data/add Lang Human/special=lanh 5 lan 1 int .25 Note, this assumes that "Agility" and "Lang Human" already are defined in the DB.TCL system, with keys of AGI and LANH respectivally -- see 'help db' for more information on that. See also: 'help char data' & data_calculations() data_calculations() Returns the calculations used to calculate the value of the specified . Example: > think data_calculations(AGI) AGI 1 See also: 'help char data' & data_class() data_class() Returns the class that belongs to. This class is used as the attribute on players to store data in. Example: > think data_class(AGI) ATTRIB See also: 'help char data' & data_cleanup() data_cleanup() Preforms a cleanup operation on a player's character data. Any keys who's value is 0 are removed from the character's data to conserve space. See also: 'help char data' & data_get() data_get(, ) This function will return the value that has for . This is calculated by the method explained in 'help @data', see that for more information. This functions is restricted to those with the see_all power. Example: > ex me/CHAR_DATA* CHAR_DATA [#4]: AGI 1 LANH 2 > think I've got [data_get(num(me),AGI)] Agility score. I've got 4 Agility score. See also: 'help char data' & data_set() data_set(, , ) This function sets the value for on . It adds to the current value, and may be a negative number. This function is restricted to wizards. Example: > ex me/CHAR_DATA* CHAR_DATA [#4]: AGI 1 LANH 2 > think [data_set(num(me),AGI,10)]You feel more dextrous. You feel more dextrous. > ex me/CHAR_DATA* CHAR_DATA [#4]: AGI 11 LANH 2 See also: 'help char data' & data_split() data_split() This function splits up all the data of their char_data and returns it in a form that's prenamed, precalculated and ready to be fed into a '+sheet' command. This function is restricted to those with the see_all power. Example: > ex me/CHAR_DATA* CHAR_DATA [#4]: AGI 1 LANH 2 CHAR_DATA_MODS [#4]: AGI 3 > think data_split(num(me)) SPECIAL&Lang_Human:10|ATTRIB&Agility:4 See also: 'help char data'