And it supports single player and maybe a bots version and if you are particularly creative maybe a 3rd version that supports who knows.
Do you want to distribute awkward zip files with 3 gamedirs ... because standard Quake would require 3 different progs.dat in 3 different gamedirs?
Adding sv_progs capability to GLQuake/WinQuake
DarkPlaces has had this for over 4 years, no doubt some others.
1. sv_main.c
2. progs.ha. Right after "server_static_t svs;" at the top, add:
We need to define the new cvar.Code: Select all
cvar_t sv_progs = {"sv_progs", "progs.dat" };
b. Right after "Cvar_RegisterVariable (&sv_maxspeed);", add:
This registers it.Code: Select all
Cvar_RegisterVariable (&sv_progs);
c. Find this and add the yellow
We aren't just calling PR_LoadProgs anymore, but telling it what the "progs.dat" name is.// load progs to get entity field count
PR_LoadProgs (sv_progs.string);
3. pr_edict.cFind this and insert the yellow text replacing the word "void":
void PR_LoadProgs (char *progsname);
Goto PR_LoadProgs and make yellow changes:
void PR_LoadProgs (char *progsname)
{
int i;
// flush the non-C variable lookup cache
for (i=0 ; i<GEFV_CACHESIZE ; i++)
gefvCache.field[0] = 0;
if (!progsname || !*progsname)
Host_Error("PR_LoadProgs: passed empty progsname");
CRC_Init (&pr_crc);
if (!(progs = (dprograms_t *)COM_LoadHunkFile (progsname)))
Sys_Error ("PR_LoadProgs: couldn't load %s", progsname);
Con_DPrintf ("Programs occupy %iK.\n", com_filesize/1024);
for (i=0 ; i<com_filesize ; i++)
CRC_ProcessByte (&pr_crc, ((byte *)progs));
// byte swap the header
for (i=0 ; i<sizeof(*progs)/4 ; i++)
((int *)progs) = LittleLong ( ((int *)progs) );
if (progs->version != PROG_VERSION)
Sys_Error ("%s has wrong version number (%i should be %i)", progsname, progs->version, PROG_VERSION);
if (progs->crc != PROGHEADER_CRC)
Sys_Error ("%s system vars have been modified, progdefs.h is out of date", progsname);
pr_functions = (dfunction_t *)((byte *)progs + progs->ofs_functions);
All we did was replace the instances of "progs.dat" with "%s" and sprintf the progsname in there.
Plus an empty progsname check.
In Closing
Now you could create a readme.txt with
=============
My Readme.txt
=============
glquake -game mycastle +map mycastle
...
( description of mod )
...
We also included a bots version and a dmsp version. Just type "bots" or "dmsp" in the console to run those.
Requires DarkPlaces or <insert name here>
[Those bots/dmsp aliases would be in the autoexec.cfg, i.e. alias bots "sv_progs bots.dat; disconnect; maxplayers 4; map dm6", etc.]