ServObit 1.3 - Configurable Server Obituaries for Quake 2 v3.10 on Linux
============================================================================
Name: ServObit
Version: 1.3 (1/10/98) INTERIM RELEASE FOR QUAKE 2 v3.09 and v3.10
Operating System: Linux
Quake 2 version: v3.10 (3.07-3.09 may work too)
Author: SteQve, a mediocre Quake player (full name: Steve Christey)
Email: Steqve@shore.net
Web page: http://www.shore.net/~steqve/quakemods.html
Description: This mod allows you to enter new Death Messages (Obituaries) 
	for your server, without having to create a new DLL.  
	Obituaries can be selected based on weapon, quad/normal damage,
	the type of killer (Self, Enemy, or World), gender of the
	killer and/or victim, and whether a gib or "mega-gib" occurred.
	You can have multiple messages per obituary selector; they
	will be generated randomly.  You can substitute killer and
	victim names into the message, insert pronouns specific to 
	killer/victim gender, and some other things.  ServObit 1.2 also
	has a Message of the Day capability, plus you can specify
	different messages to be generated when somebody connects to
	or disconnects from the game.
Credits: See "Credits" section below, but idsoftware and druid are the most
         notable, extension ideas from newtonD's package, plus technical ideas
         from James Abbatiello and Christian Wilson, and some great problem
         solving from Derek Westcott.
============================================================================

********************************************
Mod Information
********************************************

* Play Information *
Single Player           : No
Deathmatch (2-16)       : Yes
New Sounds              : No
New Graphics            : No
New Music               : No 

* Construction *
Base                    : gamei86.so
Editor(s) used          : pico (ick, I want Emacs!), and gcc compiler
Known Bugs              : See below.
Build Time              : approximately 10 minutes on an "average" CPU

Modification Details	: see TechNote.txt
Files modified          : p_client.c, g_save.c; see TechNote.txt
Source included         : not yet, for Linux; see Win95 1.3 source

********************************************
Changes since last version
********************************************

The changes are extremely limited:

1) The major change is that this is the first version of ServObit that can
run on Linux.

2) The server operator can now specify how long to display the welcome message
   (message of the day).  See "Editing Obits.txt."  You do not need a 
   new Obits.txt; however, if you want your welcome messages to print 
   longer or shorter than 5 seconds, you will have to make one minor
   change.

3) A minor bug was slightly adjusted into a feature.  In older versions, water
   deaths would occasionally be reported where there was no water.  They are now
   (somewhat accurately) recorded as falling deaths, or like "mysterious"
   environmental deaths.  See the "Known Bugs" section for details.

4) There are no other changes, except a co-release of ServObit 1.3 for
   linux (still planned on or near 1/10/98)

********************************************
Installation
********************************************

1) Again, this is FOR LINUX ONLY.

2) Create the ServObit directory under your quake2 directory.
   YOUR DIRECTORY MUST BE NAMED ServObit!!!!

3) Are you sure your directory is named ServObit?  Cool.  (Or,
   shame on you for not reading the Installation directions.)

4) Unzip the zip file into the ServObit directory.  You should
   have gamei86.so and Obits.txt and some other files.

5) Edit the Obits.txt file if you want to change ServObit's default
   obituaries and message of the day.  See "Editing Obits.txt" below.
   NOTE: You can use your ServObit 1.1 or 1.2 Obits.txt if you wish, but
   see the "Editing Obitst.txt" section for details on how to extend the
   message of the day.  If you have a ServObit 1.0 Obits.txt, you must do
   some reformatting if you want to use it.

6) Run Quake2 with the command line "quake2 +set game ServObit"

7) Whenever you add new messages to Obits.txt, they will be reloaded
   when the next level changes.

************************************************************
An Important Note on ServObit 1.3 Game Play on Quake 2 v3.10
************************************************************

While this release runs on Quake 2 v3.10, it does NOT have any of the
game play changes that were made since v3.05 (e.g. weaker hyperblaster
and faster rockets).  This is because idsoftware hasn't released the
latest source code yet, so ServObit is using v3.05 source code.
This is an INTERIM release until idsoftware releases the latest source
code.

********************************************
How The Thing Works
********************************************

You edit the file Obits.txt to configure your Obituaries.  You start your 
server.  ServObit reads the Obits.txt file and sets things up internally.
It also prints out "debugging" information to debug.txt, and it will complain
if you don't enter an Obituary or other data in a way that it needs you to.
People log on to your server; they get your Message of the Day, then their 
presence is announced to the other gib-hungry clients.  Somebody dies, 
hopefully in a particularly gruesome fashion for which you have composed
the perfect Obituary.  The server goes through the Obituaries in the order
they appear in Obits.txt, until it finds one that matches based on who did
the killing, what powerups they may have had, what weapon was used, the gender
of the killer and the victim, and whether a gib (or mega-gib) occurred or not.
ServObit then substitutes killer (and victim) name into your Obituary, as well
as some gender-specific pronouns and other stuff.  The mayhem ensues as
people die and Obituaries are strewn across the screen.  Eventually somebody
gets sick or tired or bothered by the boss and they leave.  The remaining 
players receive a random message which sadly informs them that they have one
less person to frag.  The server continues in this fashion until you stop it
or some unknown bug causes it to die a horrible death.  This latter part is
unplanned, but hey, this is software and it runs on PCs.

********************************************
Editing Obits.txt
********************************************

Obits.txt is where all the action happens.  ServObit reads this file when it
starts.  It also reads the file each time a level changes, just in case you
changed it in the meantime.  (If you get into a Bug vs. Feature vs. Lazy
Programmer argument about this, you should argue the Lazy Programmer
perspective for why it has to read the file every level change.)

Comments and Blank Lines
------------------------
Any line that begins with a # is a comment.  You can write whatever you 
want after that #.  This tells the computer that it's too stupid to 
understand what you're trying to say and it should just ignore you,
kind of like pretending not to hear a conversation in Mandarin Chinese.

Blank lines are nice ways to space things out.  ServObit also ignores them.

Message of the Day (Welcome Message)
------------------------------------

The Welcome message is displayed to the client when they first sign on.

NEW for ServObit 1.3: you can specify how long to display your message,
from 2 to 999 seconds.

- To start entering your welcome message, put a line that says   :WELCOME <NUMBER>
  where <NUMBER> is a number (the default is 5; the number given in Obits.txt
  is 8).  For example, :WELCOME 10  would print the message for 10 seconds.
- enter multiple lines of text for your message, if you wish.
- to insert a blank line, you *must* put a space in that line.
- to insert the client's name into the message, use $N
- mark the end of the message with   :END

Connect Messages
----------------

You can set up to 20 different messages that get displayed when the client
first joins the game.

- To start your list of Connect messages, put a line that says   :CONNECT
- each line you enter will become a randomly selected Connect message
- use $N to insert the client's name
- use $HIS for his/her, $HIM for him/her, and $SHE for he/she
- mark the end of the message list with  :END

Disconnect Messages
-------------------

Just like Connect messages, you can set up 20 different messages
- Start the list with    :DISCONNECT
- enter the messages the same way you do the Connect messages
- mark the end of the message list with  :END


Obituary Selectors
------------------

Obituary selectors are used to decide which set of Obituary messages matches
the given death situation.  You describe death situations with the 
following characteristics:
	- whether the person killed him/herself, whether another player killed 
	  them, or whether the world killed them
	- what type of weapon was used
	- whether Quad damage was active or not
	- the gender of the killer
	- the gender of the victim
	- how badly damaged the victim's body is (gib, mega-gib, or "normal")

Each Obituary selector line of the file is of the form:

: KillerType WeaponType PowerType KillerGender VictimGender BodyState

You can use wildcards (*) to match anything of a particular type.  For example,
if you don't care about gender in a situation where a blaster is being used,
you can put a * in the KillerGender and VictimGender spaces.

When ServObit looks through the Obituary selectors, it will use the first
selector that matches the situation.  For this reason, you should be
very careful about the order in which you list the Obituaries, since
the server will pick the first one that matches.

KillerType can be: ENEMY [E], SELF [S], WORLD [W], * (anything)

WeaponType can be specified using a full name or at least its given 
abbreviation: 
  * (anything), BLASTER [B], SHOTGUN [SH], SUPERSHOTGUN [SU],
  MACHINEGUN [M], CHAINGUN [C], GRENADE_LAUNCHER [G], HAND_GRENADE [HA],
  ROCKET_LAUNCHER [RO], RAILGUN [RA], HYPERBLASTER [HY], BFG [BF]

The world has its own WeaponTypes: LAVA [L], SLIME [SL], WATER [WA], 
  SQUISH [SQ], FALL [F], and TOUCH [TO].  SQUISH happens with doors
  and platforms.  TOUCH happens when you touch map-specific triggers
  that can hurt you.

You can specify any non-environmental weapon with WEAPON [WE].
You can specify environmental weapons with ENVIRONMENT [E]

PowerType can be: N (normal), Q (quad), * (anything)

KillerGender and Victim Gender can be: MALE [M], FEMALE [F], * (anything)

BodyState can be: GIB [G], MEGAGIB[M], and NORMAL [N].  MegaGib is a new term
  I made up that describes when a player's health goes below -80.  It has no
  meaning in the Quake engine, but it can be used to identify just how badly a
  player was burned by that Quad BFG ;-)  ServObit handles matching of gibs
  differently than other characteristics.  The BodyState specifier can be 
  interpreted as saying "make sure the body state is at least THIS bad."
  Thus, a MegaGib situation will match a Gib specifier, and a Gib will
  match a Normal specifier, but a Normal situation will not match a MegaGib.
  You will see examples of how this is used in Obits.txt.

For example,

: E ROCKET QUAD * MALE GIB

specifies a situation where a male player is gibbed by another player's
quad rocket.

Obituary messages
-----------------
 
Once you have entered a selector, you can list up to 20 messages which will
be randomly generated when that selector matches the death situation.
Each message must be on a single line.

You can insert information about the situation into the random message.  
You specify where this information is to be placed by using a $ followed
by a special command.

For each message, you can use any combination of the following:

$V = Victim's name
$K = Killer's name
$HISK = his/her for Killer's gender
$HISV = his/her for Victim's gender
$SHEK = she/he for Killer's gender
$SHEV = she/he for Victim's gender
$HIMK = him/her for Killer's gender
$HIMV = him/her for Victim's gender
$G says "destroyed", "gibbed", or "mega-gibbed" depending on body state
$Q says "Quad " if Quad, or nothing if there is no Quad

$G and $Q are useful if you want to have basically the same messages for gib
and megagib situations, or for Quad or normal situations.  It helps reduce
having to put duplicate entries under multiple selectors.

You can have bugs, too
----------------------
[This is not a personal hygiene commercial.]

WARNING: Just because this isn't programming, you can still have "bugs."
Be careful with the order in which you list selectors - you might match
an obituary earlier than you intend to.  This applies to any use of 
wildcards.  The file ServObit/debug.txt is created each time you start 
the server.  This can help you find mistakes you may have made.  A test
program is included with the source code so you can make sure the selectors
behave like you expect.

At the end of each main section, use wildcards to catch anything that might
accidentally slip through (or, perhaps, anything that ServObit doesn't 
recognize, which may be possible in extremely rare situations)

*******************************
Known Bugs
*******************************

Sometimes ServObit can't determine what weapon was used to kill someone.
That's one more good reason to include some entries in Obits.txt with lots
of wildcards.  At least it will prevent you from getting the dreaded "X
killed Y" message.

A minor bug was slightly adjusted into a feature, even though it's 
still technically a bug.  If you experienced weird water deaths where
there was no water, they will now treated somewhat accurately as falling deaths,
or as generic environmental deaths.  This bug is repeatable: just
point your BFG down to the ground, and shoot.  (You will fly, then
you will fall, and occasionally ServObit won't know what happened).
I am waiting until idsoftware's code release to fix this bug since
the fix would be fairly complicated.  (Quake code experts, feel
free to contact me for details - no, the inflictor isn't any help).

When X telefrags Y, it is treated as if X kills Y with the weapon that X
is currently holding.

If you're upset about these bugs, think of the weapons mod people who
may have a difficult time integrating with ServObit code.

Fixing these bugs would require too many modifications to different parts
of idsoftware's original source code.  I wanted to limit this as much as
possible.  These bugs will be fixed once the source code for idsoftware's point
release is distributed (assuming the point release doesn't render ServObit and
other death message mods obsolete).

*******************************
Credits
*******************************

Thanks to idsoftware for making Quake so fun and so extensible - natch.

Jet (jet@poboxes.com) went through the work of figuring out how to port
the code to Linux in the first place.  His code and "makefile" served
as the base for the port of ServObit to Linux.

Rohn, X, and Rocket Bait (no, not the "famous" one) all helped me test 
ServObit.  It didn't take much convincing once I told them that they were
required to gib me and use every single weapon and Quad combination 
imaginable ;-)  Rocket Bait was especially helpful (accidentally)
when he was half of the mutual killing spree that caused the crash that
exposed the Big Freakin' Bug.  Rohn's simple one-room slime/lava/water
map helped make it easier to test.  He's also responsible for helping
promote ServObit; hopefully his efforts have proven to your benefit.

Initial work on identifying weapons was done independently by Druid [aka 
Scott Franke] of druid-'s GL Journal - http://www-scf.usc.edu/~sfranke/glj
His source code for determining the type of weapon was used as a basis for
this ServObit package, although I modified it beyond recognition in ServObit 1.0
and brought it back to life in this version.  Many of the Death Messages as
distributed are also his creation (though I'm particularly fond of my own
"Quad Rocket Express" addition and the female-specific drowning message 
"??? retains too much water.")

Also, thanks to James Abbatiello (abbeyj@wpi.edu) for his technical advice
which helped me come up with a more reliable way of determining which 
weapon was *really* responsible for killing another person.  (It's harder
than you'd think with the first release of Quake 2 source code.)  His feedback
on the Big Freakin' Bug was also most enlightening.  He also had some
cool death messages I included.

Derek Westcott (!Eradicator!) gave me some very detailed feedback that helped
me fix one bug, and he found and fixed a second one.  These are the only
major bug fixes in ServObit 1.2.

NewtonD (newton@moongates.com) was also helpful on the technical and creative
side.  His ideas for including Connect/Disconnect messages, MOTD's, and
flexible gender pronouns in his own Death Message mod influenced this
extension of ServObit.  His mod is purty cool - check it out.

Finally, acknowledgements to Jet (jet@poboxes.com) and anarchy 
(anarchy@telefragged.com) for also putting out Death Message mods
similar to this one, and yet different.  Though I didn't use their code I
found it useful for consultation.

*******************************
Distribution and Modification
*******************************

This software is Copyright 1998 by SteQven M. Christey and may not be modified
for commercial purposes without express written consent of the author.

By using this software you agree not to hold me responsible for any damage,
direct or indirect, which may arise from its use.

Permission for free distribution of this software is granted to Internet 
sites and their affiliates whose sole or primary focus is Quake.
Informally, this includes PlanetQuake.com, Telefragged.com, cdrom.com, etc.
It is the responsibility of any site to ensure that it qualifies for such
permission.

Distribution of this software by other sites and on media other than the 
Internet is only granted by express written consent of the author.  
(That's me, SteQve, in case you weren't paying attention.)

Unlimited modification for noncommercial purposes is granted provided
appropriate credit is given to the author.  

Honest, I didn't plan on this section being so long and bossy.  Just chill
and be good and you'll be fine ;-)

********************************
Obligatory Midnight's Edge Quote
********************************

"When you are frozen in fear of the future / Haunted by the past
 In quiet helpless acceptance / Desperation rising fast
 Waiting there in silence / For the end of the world
 There is no silver lining / Where darkened clouds unfurl
 Only rain"
    - No Silver Lining
