#!/bin/csh
# CAVE QUAKE II 5.0 by Paul Rajlich
# uses CAVERNsoft 2.3 (sproc version) for networking (deathmatch)

setenv QUAKE_HOME /vs2/projects/prajlich/caveQuake-5.0

# optional flags (disable deathmatch, theme music, strafing, or visual pain)
#setenv CAVE_QUAKE_DM off
#setenv CAVE_QUAKE_THEME off
#setenv CAVE_QUAKE_STRAFE off
#setenv CAVE_QUAKE_VPAIN off

# uncomment if your wand (or similar device) does not have a joystick
#setenv CAVE_QUAKE_JOYSTICK off

cd ${QUAKE_HOME}/src

# pfQuake2 loader DSOs
setenv LD_LIBRARY_PATH ${QUAKE_HOME}/libpfbsp/OPT.O32.OPENGL:${QUAKE_HOME}/libpfmd2/OPT.O32.OPENGL

# only print fatal pf messages
setenv PFNFYLEVEL PFNFY_FATAL

# just in case you are running two instances off of the same machine.
# this happens rarely, like if you are running two Idesks off of one Onyx
if ($1 == "") then
  # default port is 10000
else
  setenv CAVERN_PORT 9000
endif

# commandline args:
# -----------------
# first is location of AUD file (audio)
# second is rotation factor (i.e. 0.5 means rotate at half speed)
# third is starting map (1, 2, 3, 4, 5, or 6)
#   first 3 are base maps from the game and are connected
#   4 and 5 are 3rd party deathmatch maps
#   6 is custom map. Put any map in src/maps and call it custom.bsp
#   NOTE: for deathmatch, make sure you and your opponent are on the same map!
# fourth is gamma correction
# fifth is machine to connect to for deathmatch 
#   For instance, if you have two machines foo and slop, you can
#   type "run" on foo and then type "run foo" on slop.
caveQuakeStatic ${QUAKE_HOME}/src/AUD/quake.aud 1.0 1 1.4 $1
