================================ ModMaster ====================================
==================== Brought to you by clan Vae Victus! =======================
Version : 1.0.1 
Date    : 2/14/96

Authors: 
    Mojapo (mcumings@ecst.csuchico.edu)
    Godel (dwied@cats.ucsc.edu)

URL: http://www.ecst.csuchico.edu/~mcumings/modmaster/

Purpose: 
  This Quake code was designed with one purpose in mind.  To make mods and 
weapons much easier to create, distribute, and maintain.  Each mod or weapon 
consists of one file, and is added by copying and pasting a couple lines in 
one central file. Read the delailed info below for a more in depth description.
This is server code, deathmatch code, single player code, or whatever you
can think of code for both Quake and Quakeworld. NOTE: This is not just a
compilation!

Note: 
  If you are going to use ModMaster, be sure to change the admin password
vector in modules.qh!  You may also need to download an extended capability
compiler due to the low limit of pr_global.  An extended version of ID's
compiler is available at the above URL.  You may also want to change the
server's message of the day and login centerprint in modules.qc 
PlayerConnect() function! Enjoy

Modules Included:
  - King of the Hill
  - Holo Quake's
  - Placeable Weapons
  - Powerups
  - Runes
  - Spawn Shield
  - Target Identification
  - Tossable Items
  - Timed Gibs

===============================================================================

  ModMaster, as stated above, was designed to make QuakeC more modular.  The
idea is rather simple... For every function in ID's QuakeC that was likely to
be used, I created 2 or 3 hooks for people to tie into.  One hook is called
at the start of the function, which has the ability to decide whether or not
it wants to run ID's code block.  The second hook is called to replace ID's
code block, and the third hook is called after either ID's code block or the
second code block is run.  Now since I have thoroughly confused most of the
people that are reading this file, I will explain in a more simple sense what
this accomplishes.  By creating these hooks as I (Mojapo) have, you can easily
set up modules of code, each knowing nothing about each other and completely
contained in one file.  This means that people wanting to run your mod will
just need to copy that one file into the right directory, recompile, an voila!
Actually, due to the way ID wrote Quake, it isn't quite that simple. Aside
from copying the file the person has to mindlessly copy and edit maybe around
4-5 lines of code where it says "ADD HERE" in a file I call modules.qc.  Okay,
so this QuakeC system is modular, great... what will I get out of it?  Well,
I will start by listing a bunch of features that people who have programmed
mods will appreciate:

   - Dynamically assigned impulses:  No more "reserving" impulses for certain
     controls! In fact, you wont even know what impulses you are using because
     they are assigned when the server starts running!  This means that
     impulses are used more efficiently than before and without collisions.
     This is accomplised by stuffing commands to the client as they connect.
     This not only allows for dynamic impulses, but makes your commands easier
     to remember.. ie instead of saying: bind h "impulse 190"   you can now
     say: bind h "holo".

   - Dynamic player flag assignment:  This is one of my favorite features, just
     because of what it lets people avoid.  ModMaster creates a single fielddef
     to be dynamically allocated by the modules themselves.  Instead of creating
     an entire new fielddef to keep track of things such as whether or not a
     player's grappling hook is out, you can just retrieve a flag from a
     centrally created fielddef.  This saves an incredible amount of fielddefs 
     in complex games, and will create the end result of better net play. Also,
     the ability to save these flags between levels is as easy as passing the
     flag you want to save back to ModMaster and telling it to save it! Isnt
     it great? :)

   - Game Mode/Toggle type modules: There are two kinds of modules supported
     by ModMaster, Game Mode, and Toggle-able.  Game Mode modules are modules
     that control the floaw of the game.  Sice you can't have two modules
     fighting each other for control, only one of these will be enabled at any
     given time.  Toggle-Able modules on the other hand can be enabled/disabled
     at will at any time.  Modules that fall into this category are things
     such as powerup runes, and Holo-Quake's
    
   - Built in remote administration:  A three impulse combination will control
     who is given admin status on your server.  The admin can be given access
     to more commands in the modules themselves, and are also given the power
     to enable and disable any or all weapons and modules.  If admin decides
     rocket launchers are too powerful for example, they may disable them.
     Each module has the ability to tap into this admin status and create their
     own admin commands. 

   - Portability:  Each module and/or weapon should be completely portable 
     between original Quake and QuakeWorld. This is extremely great for
     development of QuakeWorld server code, since you can test out most of
     your ideas, or even crash Quake, without disturbing those on your real
     server.  It also makes distribution easier, since you dont need 2 similar
     copies of your same great idea.

   - Standardized menu system: Enabling and disabling a module or weapon
     is done entirely by ModMaster and it's sibling WeaponMaster.  The modules
     themselves dont know of each others existence, they just merely respond
     to what ModMaster or WeaponMaster tells them.  This means that the menu
     system meshes together beautifully with minimal hassel.

   - Skeleton files: Both weapons and modules come with a complete skeleton
     file for ease of creation.  Just do a simple search and replace of 3
     words and then add your custom code.  It really is just that simple.

  Okay, I could say more but I better get on with this document... To show
the public just exactly what ModMaster and Weaponmaster are capable of (and
as examples of how to program for ModMaster), Godel and I have written the 
following modules for ModMaster:

   - King of the Hill: A ball is placed in the level, and all who enter it's
     light receive 0.1 frags every second.  The goal of this game mode is to
     draw people to a centralized fighting arena, so that you dont chase each
     other in circles around the level without fighting.

   - Holo Quake's: A hologram that looks just like your Quake-dude is placed
     where you are standing. This is very confusing to your opponents, and they
     will foolishly start shooting at it.  It is a fun idea to play with in 
     deathmatch.  The number of holos a player can have deployed at any one
     moment in time, and the duration of time these holo's stick around can
     be completely controlled by admin.

   - Placeable Weapons: This is an admin modules that allows for weapon removal
     and placement.  There are just too many good deathmatch levels in Quake
     that end up being boring or too centralized to do them justice.  This
     will allow admin to place more rocket launchers or whatever, wherever they
     like in the level. (btw, I'm not dogging on ID for this... I tried making
     a level and, well... I'll stick to QuakeC! :)

   - Powerups: This module allows for each of the three powerups (invisibility,
     Quad Damage, and the Pentagram of Protection) to be enabled or diabled
     by admin.  Campers suck, so lets discourage them! >:)

   - Runes: These are just copies of the runes in ThreeWave's CTF servers. An
     excellent idea, the runes give people special powerups, allowing them
     to specialize and make themselves more unique.  There are currently 4
     runes: Haste (1.5 times the fire rate), Strength (1.5 times the normal
     damage), Regeneration (regains 2 health points every second), and
     Resistance (Two thirds the normal damage).

   - Spawn Shield: this module is designed to keep lamers from killing people
     who respawn in front of them.  The shield comes on automatically and turns
     off when they player picks up a weapon, fires their shotgun, or pick
     up a powerup.  This seems to work out pretty good, but we only use it if
     people on our server make us use it.  Fight with honor people! :)

   - Target Identification: This is cool for multiplayer team games, although
     it looks like ID took out the tell command for some reason.  In normal
     Quake this would be great for sending a teammate a message when you can't
     identify them by sight.  It is just cool to see who someone is in
     QuakeWorld... just look at them for a short amount of time and your target
     will be identified as a message at the top of your screen.
 
   - Tossable Items: This is a great mod that allows a player to toss his/her
     weapon/ammo/armor onto the ground in front of them.  This enables people
     to work as a team more effectively. Plus, you can really insult someone
     by killing them with a shotgun after you toss them your rocket launcher!
     hehe.. :)
 
   - Timed Gibs: This is an rewrite of one aspect of Quake that I never really
     liked.  The BodyQueue.  It makes no sense that there should only be 5
     bodies in a world at any given time, so we made them hang around for about
     20-50 seconds and then gib.  This module also changes the way gibs act
     in that instead of hanging around for X seconds and then disappearing, we
     made them dissappear X seconds after they came to a complete stop. With
     this method, you can up the number of gibs initially thrown into the air,
     and then have them cleaned up faster for more efficient use of the ever-
     precious entities.  It looks great too, because you get the gore with no
     bad side effects.

We have also coded weapons for your (and our) enjoyment.  Just press a weapon
number twice to access the secondary weapons. Oh, by the way, WeaponMaster
supports an unlimited (well, a realistically unlimited) number of weapons on
any impulse. Just thought I's throw that in there... :)

   - Shoving Hands: Shove your opponents into lava and watch them burn!

   - Grappling Hook: Just like ThreeWaves, only ours decelerates the player as
     they get closer to the wall, making them more stable.

   - LR Shotgun and LR Super Shotgun: same as the normal shotguns, only the
     bullets do not spead that much at all.  We encourage those who can aim,
     and we needed to balance out the weapons a little more. :)

   - 50Cal Sniper Rifle: This is not as powerful as all you will hope it is.
     Dont get me wrong, the single shot that is fired can kill an enforcer in
     one hit, but it travels slow and takes a long time to reload.  It is a
     true Quake master's weapon! >:)

   - Pipe Bombs: Basically just grenades that you detonate with the alias
     "detonate".  That is a real hard one to remember! :)  Oh, and to keep
     people from getting trapped by someone else's pipebombs, the pipebombs
     will detonate if you shoot a rocket or grenade at them.

   - Bouncing Lightning Gun: Shoots slower than the normal lightning gun, but
     the shot bounces two times off walls.  It is really cool for shooting
     around corners.

  There is one set of functions that we are going to write probably before this
first release of ModMaster that will allow for a player's team to be changed
via two functions: MM_GetTeam() and MM_SetTeam().  This will create a standard
method of changing teams between Quake and QuakeWorld.  If you are going to
be coding for this QuakeC system, please view the accompanying document for
a tutorial on how to create your first module.  Also note that you may run
into problems if you compile our code with the standard quakec compiler.  ID
had the maxpr_globals set too low, causing "segfaults".  You may retrieve our
modified compiler with this limit raised a bit from the ModMaster home page.
If you have any questions about this document or about modmaster, feel free 
to email me at:

                        mcumings@ecst.csuchico.edu

CREDITS:

   ID Software: The awesome guys who code programs for people who code. Thanks
                for the great game guys..  We all love it.

   Everyone who paid for Quake and supported these guys.

   The QuakeWorld team.

   Those who creatively coded new ideas into QuakeC (The Grapling Hook,
                CTF, Runes etc). Sorry I dont know who all of you are... :(

   Linus Torvalds and crew for a great OS to save my sanity.


Well, what are you waiting for?  Go play Quake!
