Table of Contents
After extracting GgrTF files into the appropriate directory folder, you will need to create (or change) configuration for TinyFugue to load GgrTF modules and possibly change some of your settings in BatMUD.
If you are upgrading GgrTF from a previous version, it is possible that you do not have to change your configuration. But it is neverthless recommended that you skim through this section, the ChangeLog and module-specific sections of this manual in case of any significant, backwards incompatible changes.
Typical way to use GgrTF is to load the script modules at startup. This is accomplished via TinyFugue's configuration file, commonly referred as "tfrc", location of which depends on your operating system and environment.
UNIX-like systems, like Linux: ~/.tfrc or $HOME/.tfrc (aka a file named ".tfrc" in your user home directory.)
DruWare Win32 port of TF: Windows XP/2k/NT - C:\Documents and Settings\username\tfrc, Windows 7/Vista - C:\Users\username\tfrc
As a basis for your TF configuration, you can use the example-tfrc.txt provided with GgrTF. You will need to edit it to suit your guilds and certain settings. However, the example-tfrc is only a suggested layout of configuration, mostly to show the order GgrTF requires modules and settings to be loaded. It does not contain everything you can possibly do with TF.
Take note of the order of how different parts of GgrTF are loaded and where certain variables are set. Important thing is to have the order right, certain modules depend on other modules, and while GgrTF will usually print warning message(s) if the depencies are not met, sometimes this is not possible and erratic behaviour will occur.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Personal settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Turn logging off, while we set things up
/log off
;; Add some worlds
/test addworld("bat", "lp.*", "bat.org", 23, "myname", "password")
;; Set player character name before loading scripts.
;; You need to set this to your character name, for example "Ggr"
/eval /set set_plrname=Mycharname
;; Savefiles should be stored under to this directory.
;; The example here uses $HOME/.ggrtf/ which works for *NIX style systems.
/eval /set set_datapath=%{HOME}/.ggrtf/
;; We want savefiles to use filename prefix "bat-"
/eval /set set_saveprefix=bat-
;; Define a helper macro to load modules from under user home directory
;; $HOME/ggrtf/ -- adjust this as necessary
/def -i gloadmod = /eval /load %{HOME}/tf/%{*}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Character set / locale
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; You MAY need to set your character set encoding/locale to have
;; non-ASCII characters work properly in BatMUD. This is outside of
;; the scope of GgrTF, but it is discussed in more depth in the
;; user manual.
;; This setting needs to match an installed locale for *NIX style systems.
;/setenv LANG=en_US.iso88591
;; You may also try following settings if ISO-8859-1 does not work:
; /setenv LANG=en_US.iso885915
; /setenv LANG=en_US.latin1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Load GgrTF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The preloader module MUST be loaded first
/gloadmod ggrtf-pre.tf
;; And the main module after that ...
/gloadmod ggrtf.tf
;; Some useful modules: mangler, placer, spellname translator
/gloadmod gm-pssmangle.tf
/gloadmod gm-magical.tf
/gloadmod gm-tgtcast.tf
/gloadmod gm-pplacer.tf
/gloadmod gm-spellnames.tf
/gloadmod gm-tf5.tf
;; Load additional modules now
/gloadmod gm-rais.tf
/gloadmod gm-tarma.tf
/gloadmod gm-nun.tf
;; Load previously saved settings after all modules are initialized
/gload
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Load keyboard support files
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Bind some keys
/gloadmod kbd-xterm.tf
/gloadmod kbd-tf5def.tf
;; Some personal keybinds here ...
;/def -i -b'^[Om' = @smode
;/def -i -b'^[Ok' = @cmode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (Re-)start logging
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Function that returns log filename without directory path
;; Example returns: "YYYY-MM-DD-worldname-charname.log"
/def -i prget_log_filename =\
/return strcat(ftime("%Y-%m-%d"), "-", fg_world, "-", tolower(set_plrname), ".log")
;; Start logging to a file
/def -i prlogfile_start =\
/set logfile_enabled=1%;\
/set logfile_prevtime=$[time()]%;\
/set set_logfile=$[strcat(set_logdir, prget_log_filename())]%;\
/eval /log %{set_logfile}
;; On world connection establish, begin logging
/def -i -F -p9999 -hCONNECT ghook_log_start =\
/log OFF%;\
/prlogfile_start
;; On world disconnect, stop logging
/def -i -F -p9999 -hDISCONNECT ghook_log_stop =\
/set logfile_enabled=0%;\
/log OFF
;; On date change, restart logging
/def -i glogfile_check_date =\
/if (logfile_enabled & ftime("%Y-%m-%d", logfile_prevtime) !~ ftime("%Y-%m-%d"))\
/msq Day changed, switching logfile ...%;\
/log OFF%;\
/prlogfile_start%;\
/endif%;\
/set logfile_prevtime=$[time()]
/eval /if (!logfile_timer) /repeat -1 i /glogfile_check_date%;/endif
/set logfile_timer=1
One thing that is out of scope of GgrTF itself, is the issue of character set translation and locales. This basically means the way different characters are encoded and interpreted, how different values map to characters and vice versa, for example a simple encoding might be A=1, B=2, C=3, etc.
One of the first and most widely used character encodings on computer systems is known as 7-bit ASCII. This encoding allows 128 symbols or characters, and was commonly used for decades. Unfortunately, 128 symbols is nearly not sufficient enough to represent all the different alphabets or symbols used around the world (scandinavian characters, cyrillic alphabet, etc.) Thus many other encoding systems were invented, many of them more or less incompatible with each other, until introduction of Unicode standard and especially Unicode UTF-8.
The de-facto character set used in BatMUD is called "ISO-8859-1" (also known as "Latin-1") which is a 8-bit encoding that allows 7-bit ASCII characters and 8-bit encoding of scandinavian characters (such as "", "", "" etc.). This is mostly due to BatMUD's origin in Finland, where ISO-8859-1 and compatible variants like ISO-8859-15 were deployed before the age of Unicode.
However, nowadays most systems use Unicode "UTF-8" encoding (or UTF-16 -like UCS-2 in Windows). Unicode is a good thing in itself, and UTF-8 allows compatible 7-bit ASCII characters, but 8-bit and over are not compatible with ISO-8859-*. This is why if your system uses UTF-8, other people in BatMUD may see your non-ASCII characters incorrectly.
Knowing the problem, what can be done about it? There are few solutions, of differing levels of complexity and may depend on your desired setup - e.g. where and how you run TF? Is it a shell or running locally, etc.
For Linux/UNIX, you need to have the ISO-8859-1 locale installed/configured. How this is done depends on your OS distribution. For example in Debian, you need to use dpkg-reconfigure locales and add some ISO-8859-1 locale, for example en_US.iso88591.
On Ubuntu, things get a bit more complicated:
Edit /var/lib/locales/supported.d/local with your favorite editor, and on the last line add: en_US.ISO-8859-1 ISO-8859-1. It should look something like this:
en_US.UTF-8 UTF-8 en_US.ISO-8859-1 ISO-8859-1
Then, run sudo dpkg-reconfigure locales
On other Linux distributions and UNIX-like platforms the methods for installing locales vary. Your best bet is to Use the Google.
If your system is using some locale other than ISO-8859-1 such as UTF-8, you will need to make the terminal use ISO-8859-1 despite the system-global setting, or alternatively use some software like GNU Screen to "translate" between your system's and BatMUD's ISO-8859-1. Some information about how to make GNU Screen do that, can be found from this website: http://aperiodic.net/screen/terminal.
However, if you choose not to use 'screen', you will have to either start your terminal program (inside which TinyFugue will run) with the locale set to ISO-8859-1, OR if your terminal supports the feature, use the following shell script wrapper which will use terminal control codes to change the effective character translation. This feature is not supported by all terminals, XTerm and Rxvt are known to support it, however. You will need to copy+paste the script, or download it from here.
#!/bin/sh SAVE_LANG="$LANG" export LANG="en_US.ISO-8859-1" printf '\33]701;%s\007' $LANG /usr/bin/tf5 $* export LANG="$SAVE_LANG" printf '\33]701;%s\007' $LANG
You should place the script in some directory in your $PATH. You will also need to modify it to point to the correct TinyFugye executable, (e.g. change "/usr/bin/tf5" if needed.) Name the script as something like "mytf" or rename the real TinyFugue executable as "tf5-bin" and the script as "tf5", changing the script to point to tf5-bin.
Remember to set the script executable by changing its permissions, 'chmod 0755 /some/where/scriptfile' should do it.
The idea is that you run the script instead of TF directly. The script changes your current locale and forces the terminal via special terminal control code to use it, and changes it back after TF exits.
You need to make sure that you have the correct keyboard module(s) loaded. For most Linux/UNIX terminals you want to load EITHER or BOTH kbd-xterm.tf and kbd-tf5def.tf. For TF on Windows and Mac OSX, you may wish to use kbd-tf5def.tf only. You may need to experiment.
Additionally, it may be necessary to enable the so-called "application mode" in your terminal.
In OSX terminal app, the setting can be found in Terminal / Preferences / Setting / Advanced and turn on "Allow VT100 application keypad mode".
In PuTTY, the application keypad mode should be enabled by default, but if it is not, see the Features panel of PuTTY's configuration, see PuTTY documentation here.