mirror of
https://git.code.sf.net/p/quake/prozac-qfcc
synced 2024-11-10 07:11:51 +00:00
- added some items to BUGS and TODO
- reworked map cycler so that it saves the map number to cf/nextmapnum, and restores it in case of a crash - add a cyclenow infokey, which causes the timelimit to be hit instantly. needed because the map cycling doesn't kick in until the timelimit is reached - add cf/mapcycle which contains the names of maps to be cycled (seperated by nuls). it overwrites the normal "exec qwmcycle/map1.cfg" behavior. - change the MOTD time to 15 seconds (from 24.2) - make mapcfg.cfg exec'd if mapcfg is enabled (so you can reset the config vars - add a thing to enable sv_gc if it's disabled. (I'm using string appending now)
This commit is contained in:
parent
315d84dfa0
commit
1100082217
5 changed files with 150 additions and 37 deletions
1
BUGS
1
BUGS
|
@ -2,3 +2,4 @@
|
||||||
- duplicate connects
|
- duplicate connects
|
||||||
- the curse color is rejected by the color changing code
|
- the curse color is rejected by the color changing code
|
||||||
- the map cycler (including if you set nmap) just sit there if it doesn't change map. instead, it should have failsafe behavior
|
- the map cycler (including if you set nmap) just sit there if it doesn't change map. instead, it should have failsafe behavior
|
||||||
|
- "has_sentry" should be a counter, not a flag (allows a second build if you hack and it gets roasted)
|
||||||
|
|
2
TODO
2
TODO
|
@ -10,3 +10,5 @@ I make sure team/color is cleared when a client connects
|
||||||
o allow lay mode if purchased
|
o allow lay mode if purchased
|
||||||
o various drop items
|
o various drop items
|
||||||
o move from *preqcc to cpp
|
o move from *preqcc to cpp
|
||||||
|
o add more variety to tinkering
|
||||||
|
o add a way to edit the respawn ammo entities
|
||||||
|
|
168
client.qc
168
client.qc
|
@ -966,12 +966,122 @@ void() SetCycleTimer =
|
||||||
newmis.think = cycle_timer_think;
|
newmis.think = cycle_timer_think;
|
||||||
};
|
};
|
||||||
|
|
||||||
void() GotoNextMap =
|
float() GetNextMapNum =
|
||||||
|
{
|
||||||
|
local float desc;
|
||||||
|
local string st;
|
||||||
|
local string infostring;
|
||||||
|
local float infonum;
|
||||||
|
|
||||||
|
infostring = infokey (world, "n");
|
||||||
|
infonum = stof(infostring);
|
||||||
|
|
||||||
|
if (infostring != "") // always use info when available
|
||||||
|
return infonum;
|
||||||
|
|
||||||
|
if (cvar("crudefile_quota") < 0)
|
||||||
|
return infonum;
|
||||||
|
|
||||||
|
desc = cfopen("nextmapnum", "r");
|
||||||
|
if (desc < 0)
|
||||||
|
return infonum;
|
||||||
|
|
||||||
|
st = cfread(desc);
|
||||||
|
if (st == "")
|
||||||
|
{
|
||||||
|
cfclose(desc);
|
||||||
|
return infonum;
|
||||||
|
}
|
||||||
|
|
||||||
|
cfclose(desc);
|
||||||
|
return stof(st);
|
||||||
|
};
|
||||||
|
|
||||||
|
void(float mapnum) SetNextMapNum =
|
||||||
|
{
|
||||||
|
local float desc;
|
||||||
|
local string mapstring;
|
||||||
|
|
||||||
|
mapstring = ftos (mapnum);
|
||||||
|
|
||||||
|
if (cvar("crudefile_quota") >= 0)
|
||||||
|
{
|
||||||
|
desc = cfopen ("nextmapnum", "w");
|
||||||
|
// if nextmapnum has a num in it, but we can't modify it.. stuck in a loop
|
||||||
|
if (desc >= 0)
|
||||||
|
{
|
||||||
|
cfwrite (desc, mapstring);
|
||||||
|
cfclose (desc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
localcmd("serverinfo n \"\"\n"); // use localinfo instead
|
||||||
|
localcmd("localinfo n ");
|
||||||
|
localcmd(mapstring);
|
||||||
|
localcmd("\n");
|
||||||
|
};
|
||||||
|
|
||||||
|
void() LoadNextMap =
|
||||||
{
|
{
|
||||||
local float nextlevel;
|
local float nextlevel;
|
||||||
local string sl;
|
|
||||||
local entity te;
|
|
||||||
local string cyc;
|
local string cyc;
|
||||||
|
local float desc;
|
||||||
|
local float mapcount;
|
||||||
|
local string map;
|
||||||
|
|
||||||
|
nextlevel = GetNextMapNum();
|
||||||
|
nextlevel = nextlevel + 1; // next level
|
||||||
|
SetNextMapNum(nextlevel);
|
||||||
|
|
||||||
|
// get count of maps
|
||||||
|
mapcount = 0;
|
||||||
|
desc = cfopen ("mapcycle", "r");
|
||||||
|
while (cfread(desc) != "")
|
||||||
|
mapcount = mapcount + 1;
|
||||||
|
cfclose ("mapcycle");
|
||||||
|
|
||||||
|
if (mapcount > 0)
|
||||||
|
{
|
||||||
|
if (nextlevel > mapcount)
|
||||||
|
{
|
||||||
|
while (nextlevel > mapcount)
|
||||||
|
nextlevel = nextlevel - mapcount;
|
||||||
|
SetNextMapNum (nextlevel);
|
||||||
|
}
|
||||||
|
|
||||||
|
desc = cfopen ("mapcycle", "r");
|
||||||
|
local float i;
|
||||||
|
i = 0;
|
||||||
|
while (i < nextlevel)
|
||||||
|
{
|
||||||
|
i = i + 1;
|
||||||
|
map = cfread(desc);
|
||||||
|
}
|
||||||
|
if (map == "")
|
||||||
|
mapcount = 0; // fall back to old mapcycle method
|
||||||
|
else
|
||||||
|
localcmd ("map " + map + "\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mapcount == 0)
|
||||||
|
{
|
||||||
|
cyc = infokey(world, "cycledir");
|
||||||
|
if ( cyc == string_null )
|
||||||
|
cyc = "qwmcycle";
|
||||||
|
|
||||||
|
localcmd("exec ");
|
||||||
|
localcmd(cyc);
|
||||||
|
localcmd("/map");
|
||||||
|
|
||||||
|
localcmd(ftos(nextlevel));
|
||||||
|
localcmd(".cfg\n");
|
||||||
|
|
||||||
|
already_chosen_map = #CYCLED;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void() GotoNextMap =
|
||||||
|
{
|
||||||
|
|
||||||
if (nextmap != mapname)
|
if (nextmap != mapname)
|
||||||
{
|
{
|
||||||
|
@ -989,37 +1099,9 @@ void() GotoNextMap =
|
||||||
|
|
||||||
//- OfN - super new map cycling code :)
|
//- OfN - super new map cycling code :)
|
||||||
if (already_chosen_map == #FALSE)
|
if (already_chosen_map == #FALSE)
|
||||||
{
|
LoadNextMap();
|
||||||
// ------- - ------- //
|
|
||||||
sl = infokey(world, "n");
|
|
||||||
nextlevel = stof(sl);
|
|
||||||
|
|
||||||
nextlevel = nextlevel + 1; // next level
|
if (GetNextMapNum() == 0)
|
||||||
sl = ftos(nextlevel);
|
|
||||||
localcmd("serverinfo n \"\"\n"); // use localinfo instead
|
|
||||||
localcmd("localinfo n ");
|
|
||||||
localcmd(sl);
|
|
||||||
localcmd("\n");
|
|
||||||
|
|
||||||
|
|
||||||
// change map
|
|
||||||
cyc = infokey(world, "cycledir");
|
|
||||||
if ( cyc == string_null )
|
|
||||||
localcmd("exec qwmcycle/map");
|
|
||||||
else
|
|
||||||
{
|
|
||||||
localcmd("exec ");
|
|
||||||
localcmd(cyc);
|
|
||||||
localcmd("/map");
|
|
||||||
} //.................//
|
|
||||||
|
|
||||||
localcmd(sl);
|
|
||||||
localcmd(".cfg\n");
|
|
||||||
|
|
||||||
already_chosen_map = #CYCLED;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (infokey(world, "n") == "0")
|
|
||||||
already_chosen_map = #FALSE;
|
already_chosen_map = #FALSE;
|
||||||
|
|
||||||
if (already_chosen_map == #FALSE) // nothing was done yet, so set the damn timer..
|
if (already_chosen_map == #FALSE) // nothing was done yet, so set the damn timer..
|
||||||
|
@ -2225,6 +2307,8 @@ void() NextLevel =
|
||||||
o.nextthink = time + 0.1;
|
o.nextthink = time + 0.1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
float cyclenow;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
============
|
============
|
||||||
CheckRules
|
CheckRules
|
||||||
|
@ -2234,9 +2318,23 @@ Exit deathmatch games upon conditions
|
||||||
*/
|
*/
|
||||||
void() CheckRules =
|
void() CheckRules =
|
||||||
{
|
{
|
||||||
if (timelimit && time >= timelimit)
|
local string st;
|
||||||
|
st = infokey (world, "cyclenow");
|
||||||
|
|
||||||
|
if (!cyclenow && (st == "1" || st == "on"))
|
||||||
|
{
|
||||||
|
cyclenow = 1;
|
||||||
|
|
||||||
|
localcmd ("serverinfo cyclenow \"\"\n");
|
||||||
|
localcmd ("localinfo cyclenow \"\"\n");
|
||||||
|
|
||||||
|
dprint ("Cycling Map.\n");
|
||||||
|
|
||||||
NextLevel ();
|
NextLevel ();
|
||||||
else if (fraglimit && self.frags >= fraglimit)
|
}
|
||||||
|
else if (cyclenow
|
||||||
|
|| (timelimit && time >= timelimit)
|
||||||
|
|| (fraglimit && self.frags >= fraglimit))
|
||||||
NextLevel ();
|
NextLevel ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
9
defs.qc
9
defs.qc
|
@ -842,6 +842,12 @@ void(vector where, float set) multicast = #82; // sends the temp message to a
|
||||||
// of clients, possibly in PVS or PHS
|
// of clients, possibly in PVS or PHS
|
||||||
#endif
|
#endif
|
||||||
void (entity ent, string key, string value) setinfokey = #102;
|
void (entity ent, string key, string value) setinfokey = #102;
|
||||||
|
float (string path, string mode) cfopen = #103;
|
||||||
|
void (float desc) cfclose = #104;
|
||||||
|
string (float desc) cfread = #105;
|
||||||
|
float (float desc, string buf) cfwrite = #106;
|
||||||
|
float (float desc) cfeof = #107;
|
||||||
|
float () cfquota = #108;
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
|
@ -1013,7 +1019,8 @@ float(entity targ, entity inflictor) CanDamage;
|
||||||
.float weaponmode; // Used for multiple mode weapons
|
.float weaponmode; // Used for multiple mode weapons
|
||||||
|
|
||||||
//WK 152 Default, must be > 6.
|
//WK 152 Default, must be > 6.
|
||||||
#define MOTD_FINISHED 242 //Delay in 1/10th seconds for motd to show
|
//#define MOTD_FINISHED 242 //Delay in 1/10th seconds for motd to show
|
||||||
|
#define MOTD_FINISHED 150
|
||||||
.float motd; // Used to display MOTD
|
.float motd; // Used to display MOTD
|
||||||
.float current_menu; // is set to the number of the current menu, is 0 if they are not in a menu
|
.float current_menu; // is set to the number of the current menu, is 0 if they are not in a menu
|
||||||
.float menu_count; // keeps track of display times for menus
|
.float menu_count; // keeps track of display times for menus
|
||||||
|
|
7
world.qc
7
world.qc
|
@ -193,13 +193,18 @@ void() worldspawn =
|
||||||
if (st == "1" || st == "on")
|
if (st == "1" || st == "on")
|
||||||
st = "mapcfg";
|
st = "mapcfg";
|
||||||
|
|
||||||
|
localcmd("exec mapcfg.cfg\n"); // generic stuff
|
||||||
|
|
||||||
localcmd("exec \"");
|
localcmd("exec \"");
|
||||||
localcmd(st);
|
localcmd(st);
|
||||||
localcmd("/");
|
localcmd("/");
|
||||||
localcmd(infokey(world, "map")); // FIXME: this is safe chaining, right?
|
localcmd(infokey(world, "map"));
|
||||||
localcmd(".cfg\"\n");
|
localcmd(".cfg\"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!cvar("sv_gc"))
|
||||||
|
cvar_set ("sv_gc", "10");
|
||||||
|
|
||||||
// custom map attributes
|
// custom map attributes
|
||||||
#ifndef QUAKE_WORLD
|
#ifndef QUAKE_WORLD
|
||||||
if (self.model == "maps/e1m8.bsp")
|
if (self.model == "maps/e1m8.bsp")
|
||||||
|
|
Loading…
Reference in a new issue