
                              ZQuake v0.13dev
                              ~~~~~~~~~~~~~~~~


1. About the ZQuake Project
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Quake has been  played  for many years,  and  as perfect an online game  as
QuakeWorld is, nothing is completely perfect.  People often thought, "oh, how
nice it would be if I had 'this'"  or  "man,  too bad 'that' isn't  the way
I want it".  Some of them created proxies like cheapo, Qizmo, NFProxy, etc that
extended the QW client's abilities, to allow their wishes to become reality.
But proxies work only on the information sent to/from server and client, what
more do you want from a proxy?  In any case, ZQuake was thought up as the best
things a proxy could have, with some additional capabilities that a proxy could
never possess (such as ability to bind CAPS and NUM locks, numpad keys, etc).
The features of ZQuake expand continuously, and members of the Quake community
are encouraged to voice their opinion on what ZQuake should have
(that means YOU! :).

1.1. Contents
~~~~~~~~~~~~~

Project ZQuake is:
zqwcl.exe ---- QW-Client (qwcl modification)
zqwcl-gl.exe - QW-Client for OpenGL (glqwcl modif.)
zqwsv.exe ---- QW-Server (qwsv modif.)
zquake.exe --- This is something new, a client & server in one .exe, still
	under testing, so there might be bugs!
zquake-gl.exe - same, but for OpenGL

This readme covers zqwcl, zqwcl-gl, zquake, and zquake-gl.
Documentation for zqwsv is in the zqwsv archive :)


2. List of New Commands
~~~~~~~~~~~~~~~~~~~~~~~
- bindlist - lists all key bindings, just like bindlist in Quake 3

- cmdlist - list all commands :)

- cvarlist - list all console variables (also known as cvars)
	It also prints each cvar's flags:
	* - archived variable (for example, m_pitch, name)
	u - userinfo (name, bottomcolor)
	s - serverinfo (deathmatch, hostname)

- toggle - invert the value of a cvar (1 -> 0 and 0 -> 1)

- unalias - completely destroys an alias

- unaliasall - destroys all aliases

- if <expr1> <op> <expr2> [then] <command> [else <command>]

- loadloc - loads a loc-file (must be located in id1/locs, qw/locs,
	or <gamedir>/locs -- this means fortress/locs when you play TF).
	The ".loc" extention need not be specified, for example, "loadloc dm6";
	if the file itself has no extension, use its explicit name ("loadloc dm6.")

- set - set a value to/create a cvar

- enemycolor - overrides the color of enemies

- teamcolor - overrides the color of teammates

- enemyskin - overrides the skins of enemies (doesn't always work properly yet)

- teamskin - overrides the skins of teammates (same)

- tp_took - customizes the f_took trigger
	The syntax is pretty much like in Cheapo's .took command.
	Possible params are:
	"quad", "pent", "ring", "suit", "ra", "ya", "ga", "mh", "health", "lg",
	"rl", "gl", "sng", "ng", "ssg", "pack", "cells", "rockets", "nails",
	"shells", "flag" - no need to explain.
	Plus, there is a number of group names:
	"armor", "weapons", "powerups", "ammo", "all" and "default"
	Examples:
		tp_took	powerups ra ya lg rl mh flag   (same as "default")
		tp_took all -ammo   (report everything but ammo)
		tp_took +gl   (add grenade launcher to pickup list)

- tp_pickup - ...
- tp_point - ...

- easyrecord - record demos without worrying about the filename

- macrolist - lists all supported macro expressions, like $location, $health.

- msg_trigger - message catcher system, to be explained later below.

- screenshot <filename> - unlike with QW 2.30, you can specify a file name
	here!

- viewalias <aliasname> - prints body of the given alias.

- writeconfig <filename> - writes all your binds and cvars to a custom
	config file.


3. List of New/Modified CVars
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* crosshair 3 - a mini crosshair (color of crosshaircolor, of course)

* cl_bonusflash [1,0] - turn on/off the weapon/item pickup flash

* cl_c2spps - packet filtering (a la Qizmo's .c2spps command). Use this to
	reduce network traffic if you're playing on a 28800 (or worse)
	connection and can't set cl_maxfps 72 because it causes lags.
	The recommended settings are cl_maxfps 72 and cl_c2spps 30.
	Note that if you're playing on a buggy 2.30 server, the increase of fps
	may result in "failing" jumps when you bunny-hop. The best would be
	to get zqwsv or KT 2.20 installed on the server; if that's impossible,
	you'll have to cap your fps with cl_maxfps (try cl_maxfps 50 or 30).

* cl_chatmode [1,2] - console chat mode
	0 - a-la NetQuake, text in the console is always treated as a command
	and in order to chat you have to press T (messagemode) or use the say
	command
	1 - new Q3A-like command state, where everything you type in the console
	goes into chat, in order to issue a ocmmand, prefix it with a slash (/)
	2 - default qw2.30 state, if the first word in the line is a command, it
	is executed, otherwise the line is sent as chat

* cl_clock [0,1,2] - a clock (a la NFProxy)
	0 - off (default)
	1 - shows the time you spent on server (you'll also see it in the status
		bar when you press TAB)
	2 - shows the time of day
* cl_clock_x - horizontal coordinates of the clock
* cl_clock_y - vertical coordinates of the clock (if < 0, the coordinates are
	calculated from bottom up, e.g. -1 means the screen line just above the
	scoreboard.)

* cl_deadbodyfilter - if 1 (by default 0), corpses are not drawn.  This helps
	the FPS somewhat, not to mention your concentration.
	Unlike proxies, zquake also hides feigning spies making it impossible
	to cheat in TeamFortress.

* cl_explosion [0-3,6,7,8] - changes standard explosions to less fps-hogging ones
	0 - normal (default); 1 - no particles; 2 - no dynamic lighting;
	3 - no particles, no dynamic lighting;
	6 - teleport; 7 - blood; 8 - bigblood

* cl_filterdrawviewmodel - prevents r_drawviewmodel from being changed by
	Rocket Arena servers.

* cl_gibfilter - [0-1] - if 1, gibs are turned off.  Default is 0.

* cl_loadlocs - if 1 (by default 0), loc-files are loaded automatically upon
        change of map. 	The loc files should be located in /id1/locs
        or /qw/locs  (loc-files are files that assosiate spots on the map with
        a message, and they can be used to figure out which spot youre closest
        to on the map and use it's message to show your current location, etc.)
        No ability exists in zquake, as of yet, to create loc files..  best way
        is to make your own with a proxy, or download one from a friend.)

* cl_muzzleflash [0,1,2] - "Muzzleflash" (the flashes when a gun is shot)
	0 - all turned off; 1 - all turned on (default);
	2 - own's flash off, all other on

* cl_nofake - [0,1,2]: 1 disables "fake" messages sent by other players.
	It replaces all line feed (0x0A) and carriage return (0x0D) characters
	with a space symbol.
	A value of 2 disables fake messages from enemies only, so I suggest
	always using 2; But I must note that ZQuake cannot always determine
	who exactly sent the message when there is, for a example, a guy named
	"unnamed" in your team and "(unnamed)" in the enemy team, because a
	messsage from (unnamed) and a team message from unnamed will look
	identically. In this case ZQuake will "unfake" messages from both
	players.

* cl_r2g - if 1, converts all rockets to grenades, just like proxies do

* cl_speedjumpfix - if 1, which is the default, jump prediction is turned on.
	result?  perfect jumps even at 200+ ping (Note: this won't help if
	you're playing on a buggy 2.30 server! Ask the server admin to install
	either zqwsv or Kombat Teams 2.20 mod!)

* cl_staticsounds (1 by default) - set this to disable annoying static sounds.
	Note that that you must reconnect or restart the map for it to take
	effect.

* cl_string ("" by default) - when set displays a given string (can contain macroses).
	Example: cl_string "My stats: h:%[h] %[a] %w %p" will print your health, armor,
	current weapon and ammo, and all powerups you have.
* cl_string_x - horizontal coordinates of the string
* cl_string_y - vertical coordinates of the string (if < 0, the coordinates are
	calculated from bottom up, e.g. -1 means the screen line just above the
	scoreboard.)

* cl_triggers - if 1 (0 by default), then special aliases can be executed,
	or triggered, when something happens.

	aliases:
	~~~~~~~~
	f_respawn - triggered when you are (re)spawned.
	f_death - triggered when you die.
	f_flagdeath - when you die with a flag in Team Fortress.
	f_mapend - triggered when the intermission screen is brought up.
	f_newmap - triggered when a new map is entered.
	f_spawn - executed after the first frame on a new map is rendered.
	f_took - called when you pick up an item in teamplay (use the tp_took
		command to specify what items should trigger this alias).
	f_weapon_change - called when you change your weapon (except in cases
		when you die or respawn).

	examples:
	~~~~~~~~~
	alias f_respawn "say_team respawned at %l"
	alias f_death "say_team died at %d"
	alias f_flagdeath "say_team enemy flag lost at %d!"
	alias f_mapend "stop; screenshot"
	alias f_spawn "easyrecord"
	alias f_newmap "cl_warncmd 0; exec mapcfg/$mapname.cfg; cl_warncmd 1"
	alias f_took "say_team took %i at %l"
	alias f_weapon_change "echo I'm using %w"

* cl_trueLightning [0..1] -- smoothes out shaft movement, 0 (default) means
	no smoothing at all, 1 - 100% smoothing; a value of about 0.5 is
	recommended for modem players.

* contrast (defaults to 1) - controls screen brightness in software mode.
	Looks cool :-)

* default_fov - very useful in TF, and other mods that reset your fov when you
		spawn to 90. Basically, when the server sends you "fov 90",
		your fov is set to default_fov.

* demotimescale (0.1 - 10) - changes speed of demo playback.

* gl_conalpha - console transparency in GL. Default is 0.8; a value of 1
	makes it solid, like in software, and 0 makes it fully transparent,
	looks weird :-)

* gl_contrast - controls screen brightness in GL.

* gl_gamma - controls gamma in GL, only works in fullscreen mode and only if
	your vid card supports the SetDeviceGammaRamp function (Voodoo cards
	don't :)

* gl_fb_bmodels (1 by default) - enable "fullbright" colors on bsp models
	(World, health boxes, etc).
	Setting it to 0 might give you a couple more fps.

* gl_fb_models (1 by default) - enable "fullbright" colors on alias models
	(grenades, player models, etc).
	Setting it to 0 might also give you more fps.

* impulse imp1 [imp2 [imp3...]] - choice of the best weapon
	example:
	impulse 5 4 - chooses either nailgun or supernailgun, depending on which
	one you have. If you have both, chooses supernailgun.

* mapname - this is a read-only cvar that contains the short name (like "dm6")
	of the map being played.

* qizmo_dir - the path to qizmo.exe relative to main Quake dir. Set it to "" if
	you placed qizmo in one dir with zquake.exe, or "qizmo" if your qizmo
	path is something like c:\quake\qizmo\qizmo.exe.

* r_drawflame - if set to 0, torch models are not drawn.  On maps like
	dm6 this really helps the frame rate.

* r_drawflat (defaults to 0) - when enabled in software removes all textures from 
	the world and gives a good FPS boost. Doesn't work in GL and disabled in
	TF.

* r_drawviewmodel - [0,1,2] a value of 1 makes the weapon model always visible
	in both GL and software no matter what fov you have, and 2 makes it 
	only visible when fov is <= 90.
	Default is 1 for GL and 2 for software.

* r_fastsky - setting it to 1 makes the sky flat, helps fps a bit on maps with
	large sky areas, like dm2, dm3 or q1dm17. It looks a bit dark on dm3, so 
	you might want to change its color using the r_skycolor cvar (on dm3,
	try 7 or 44).
	r_fastsky doesn't work in GL yet.

* r_fullbrightSkins (defaults to 0) - when set to 1, makes all player models
	fully lit. Many TF players consider this a cheat, so it's disabled for
	Team Fortress.

* r_grenadetrail [0,1] - setting it to 0 hides grenade trails

* r_octfont [0,1] - turn off/on built-in ocrana font.

* r_powerupglow [0,1,2] - setting it to 0 turn off to disable powerup glow
	on players. This is not recommended though, because you won't be able
	to see if a player has Quad/Pent.
	2 - disable powerup glow from yourself only -- really helps fps when
	you have a powerup!

* r_rocketlight [0,1] - turn off/on dynamic lighting of rockets.

* r_rockettrail [0-2] - changes rocket trail (duh)
	0 - trail turned off
	1 - standard (default)
	2 - grenade

* r_skycolor - change the color of sky when r_fastsky is on. 4 is default;
	you might try 0, looks cool :-)

* scr_centerMenu - centers the menu vertically, 1 by default (has no effect
	if you're playing in 320x200 mode, same applies to scr_centerSbar and
	scr_centerScores).

* scr_centerSbar - centers the status bar horizontally so it looks like in
	NetQuake.

* scr_centerScores - centers the scoreboard, 1 by default.

* scr_consize - controls vertical size of console, 0.5 is half screen (default).
	Alternatively you can use ctrl+up and ctrl+down keys in the console
	to adjust its height.

* show_speed - shows your horizontal velocity component in upper right corner.
	Very useful for practising bunny hopping :-)
	show_speed 2 shows predicted speed (less "laggy" when you're on a modem).

* v_contentblend [0..1] - if 0, water becomes clear. Fractional value work too,
	for example, you might set it to 0.1 so that water is almost
	transparent, but you can still see instantly when you are in water
	(helps a lot on weird maps like e4m1 where it's not all that easy to
	say where you are).

* v_damagecshift [0..1] - coefficient of the flash (1-full flash, 0-no flash)
	when you are hit.  Some people are annoyd by the flash, others use it
	as the only indicator that they are hit, so toggle it as you wish.
	A good idea is to set it to about 0.3 so that you "feel" how much of
	your health was taken, but don't get blind when the enemy attacks you
	with shaft.

* v_pentcshift [0..1] - flash coefficient for when you take the pent
* v_quadcshift [0..1] - ...same thing, but for quad
* v_ringcshift [0..1] - ...for ring of shadows
* v_suitcshift [0..1] - ...and for bio-suit.


4. Teamplay messages
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* cl_parsesay - if 1 (default 0), you can use macros a-la Qizmo such as
	say_team "at %l %[a] %[h] %p"

List of macros
~~~~~~~~~~~~~~
Macros column - full macro name, to be used in console scripts.
Qizmo - proxy style, use it in say/say_team commands (remember you must set
cl_parsesay 1 for this to work)

Macro (*)       Qizmo   Description
~~~~~~~~~~~~~~  ~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$armor		%a	amount of armor
		%[a]	same as %A:%a, but adds glowing braces if armor is low
$armortype	%A	type of armor (ga, ya, ra)

		%b	best weapon and amount of ammo for it in RL:10 style

$health		%h	health (i think...)
		%[h]	same as %h, but adds glowing braces if health is low

$shells			amount of shells
$nails			...nails
$rockets	%r	...rockets/grenades
$cells		%c	...lg batteries

		%w	current weapon and amount of ammo for it, in "RL:5" style.

$powerups	%p	powerups which you have (quad/pent/ring)
		%[P]	same as %p, but adds glowing braces if you have a
			powerup

$tookatloc	%i	the name and location of the item you picked up last

$location	%l	current location according to the loc file (which
			should be loaded)

		%L	current location, or location of death if you
			died 5 or less seconds ago

$deathloc	%d	location of last death

		%x	what you see
		%y	location of the item you see
		%t	same as "%x at %y"

$weapon			current weapon (lg, rl, gl, sng, ng, ssg, sg, or axe)
$weaponnum		the number of current weapon (1 for axe, 7 for RL, etc)
$ammo			amount of ammo for current weapon

$bestweapon		best weapon
$bestammo		amount of ammo for the best weapon

$date			current date in dd.mm.yy format
$time			current time in hh:mm format
----------------------------------------------------------------------

4.1 Fun character conversion (FIXME...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* When cl_parseFunChars is turned on, you can use Ocrana LED's
	($R/$G/$B/$Y-lamps) by hand, right out of the console.
	as well as chat anonymously through "$\" without showing your name.
	(i.e., chat messages that are seen without your name at the beginning.)

	$R - Red lamp
	$G - Green lamp
	$B - Blue lamp
	$Y - Yellow lamp
	(In order to use the lamps, it's a good idea to install the Ocrana
	pak.)

	ZQuake also understands $[ and $] (glowing braces), and $: (line feed.)

	Example:
	say_team "$\$R$R NMY QUAD $R$R$:$R$R NMY QUAD $R$R$:$R$R NMY QUAD $R$R"

	Your teammates will see three lines containing @@ NMY QUAD @@ (@ here
	means red ocrana lamps). The reason for using $: instead of three
	identical say commands is to avoid triggering flood protection.

	...


5. Other features
~~~~~~~~~~~~~~~~~

5.1. Cvar expansion
~~~~~~~~~~~~~~~~~~~
This uses the cvars value (a-la QII)

Examples:
echo $sensitivity    // shows your current sens.

alias +zoom "set _fov $fov; fov 45"
alias -zoom "set fov $_fov"
	with the above two aliases you'll be able to restore the previous
	value of a cvar. Useful when you're writing scripts that regulate
	your rate, volume, sens, etc...

* inc [cvar] [value] -
	if value is left out, increments the specified cvar by one
	otherwise adds the value to the cvar.  For example, inc volume -0.1
	would subtract 0.1 from volume.

Example:
	bind F5 "if rate <= 3500 inc rate 500; echo $rate"
	bind F6 "if rate >= 1000 inc rate -500; echo $rate"

	This will let you adjust your rate without bringing down the console,
	by just typing F5 and F6 keys.


5.2. Message catcher system
~~~~~~~~~~~~~~~~~~~~~~~~~~~
* msg_trigger <alias> <string> [-l <level>]
	With the help of this command you can automatically execute some
	alias if a specific string is found in the console.  The alias is
	limited to the following commands:
	alias, echo, play, playvol, stopsound, say, say_team, set,
	msg_trigger, inc, record, easyrecord, stop, if.
	You can also set cvars, but you can't execute nested aliases!
	The length of the <string> parameter is limited to 64 chars.
	You can specify the <level> parameter if you want to catch pickup
	messages, death messages, or player chat. The meaning of <level>
	is as follows:
	0 - pickup messages (e.g. "You got armor")
	1 - death messages (e.g. "Unnamed becomes bored with life")
	2 - other messages (e.g. "Quad damage is wearing off")
	3 - chat messages
	4 - team chat messages

	Example (worth a thousand words hehe):
	alias no_ammo "play noammo.wav"
	msg_trigger no_ammo "Not enough ammo"
	With this, when you run out of ammo and quake says "Not enough ammo",
	alias no_ammo will be automatically executed (in this case it plays
	a wav file).

	For TF:
	alias play_count "play count.wav"
	msg_trigger play_count "renade primed"
	So if, for example, in the console you get something like
	"Grenade primed, 3 seconds..." or
	"Napalm grenade primed, 3 seconds...", then play_count will execute.

	!! Attention: Message catcher system is a feature still in development,
	so don't be suprised if we change the format of the msg_trigger command
	in future.

5.3. Keys
~~~~~~~~~
* cl_keypad - [0,1] if 1 (by default), you will be able to bind such
	keys as capslock, numlock, and all numpad keys.  The full listing is:

	Key name	Alternative name
	--------------------------------
	CAPSLOCK
	KP_NUMLOCK	NUMLOCK
	KP_SLASH
	KP_STAR
	KP_MINUS	
	KP_HOME		KP_1
	KP_UPARROW	KP_2
	KP_PGUP		KP_3
	KP_PLUS
	KP_LEFTARROW	KP_4
	KP_5
	KP_RIGHTARROW	KP_6
	KP_END		KP_7
	KP_DOWNARROW	KP_8
	KP_PGDN		KP_9
	KP_ENTER
	KP_INS		KP_0
	KP_DEL


5.4. Key Use in Console
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZQuake uses keys in the console more effectively now.  Keys such as <--
and -->, HOME and END work as expected in editing the current line.
(in order to use HOME and END as they were originally intended, i.e.
to scroll the console buffer all the way up or down, use ctrl+HOME/ctrl+END)
You can also use ctrl+leftarrow and ctrl+rightarrow to jump one word
left/right.  Pressing ctrl+PgUp or ctrl+PgDn will scroll the console one page
up or down.
ZQuake lets you create "fun characters" right in the console!
ctrl+[ or ]   - glowing braces, and ctrl+R|G|B|Y - ocrana LEDs.
alt+<letter>  - red letter
ctrl+<0..9>   - yellow number
ctrl+[]   - glowing braces
ctrl+RGBY  - ocrana LEDs
ctrl+shift+() - left and right sides of the regulator used in Quake options
ctrl+=        - middle part of the regulator
ctrl+shift+<> - left and right sides of an underline
ctrl+-        - the middle of an underline
ctrl+,        - a white dot (only in names)
ctrl+.        - a yellow dot
ctrl+a        - the controller of the regulator
ctrl+shift+B  - filled red block
ctrl+shift+C  - red triangle pointing right

Note that red chars are only useful for creating fun names, you can't use
them in chat because chat messages are red anyway.
And finally, you can press and hold any key to make it auto repeat!


5.5. Demos
~~~~~~~~~~
During playback of demos, pause now actually works, as does demotimescale:
* demotimescale 0.25 - slomo viewing (1/4th normal speed)
* demotimescale 5 - fast forward (5 times normal speed)
* demotimescale 1 - normal speed

* easyrecord [demoname] - with this command, you can record demos without
	specifying a name.  In other words, if demoname is not specified (and
	it shouldn't, as it defeats the whole purpose :), the name is generated
	in the following manner:

	duel: <player1>_vs_<player2>_map
	teamplay: <player1>_<team1>_vs_<team2>_map
	ffa: <player>_ffa_map
	one player: <player>_map
	(spectator mode): <player>_map

	If a demo with that name already exist, the demo will be postfixed with
	two numbers such as 00, and counting upwards from that, so if there is
	already a unnamed_dm6.qwd, unnamed_dm6_00.qwd will be created,
	then unnamed_dm6_01.qwd, and so forth.	

	Also, when demoname IS specified, it will work like record, except it
	will retain the aforementioned reinumeration of demos (it won't overwrite
	existing demos, instead it will append numbers to the filename).
	
	example:
		easyrecord tempdemo
		easyrecord $name_$team_$mapname

* playdemo command can be used for playing .qwz demos! You still need qizmo.exe
	and compress.dat, but ZQuake will do the job of unpacking the .qwz
	for you. Note that you must set qizmo_dir cvar properly so that ZQuake
	knows where your qizmo.exe is located.



5.6. Command-line parameter -port <portnum>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Works only in zquake.exe and zqwsv.exe.
It changes the port of the server (default is 27500).


5.7. "f_version", "z_version"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZQuake replies, like a proxy, to f_version or z_version with its current version
and build.  It doesn't reply, though, if you're in spectator mode, or if 20
seconds haven't passed since the last reply.


5.8. TF cheats protection
~~~~~~~~~~~~~~~~~~~~~~~~~
A lot of commands and cvars were changed not to let people cheat in TF.
- v_cshift, v_idlescale and other v_i* are disabled in TF, in order to
avoid cheating with old flash and concussion grenades.
- gl_polyblend cannot be used to reduce the effect of flash grenades
Note that it _only_ applies to TF, in normal DM all the cvars and commands
work just as expected.
- r_drawflat can not be set to 1 in TF games, since this originally was 
considered by Id as cheating (and it really is).

-----------------------
Project Author:
Anthony Gavriloff aka Tonik (temporary e-mail: tonik@vipmail.ru)

Coding:
Victor Luchits aka Vic (vic@captured.com)

Ideas and stuff:
Turba (turba@hrg.dhtp.kiae.ru)

Translator of this readme:
GuPH (guph@netzero.net || http://guph.net)

Official ZQuake site: http://zquake.sourceforge.net/ (or http://zquake.frag.ru)
