quakeworld start delay between maps (thunderwalker ctf mod)
-
- Posts: 32
- Joined: Thu Nov 20, 2008 12:51 am
- Location: Pennsylvania
- Contact:
quakeworld start delay between maps (thunderwalker ctf mod)
Anyone know about putting delay between maps?
So map changes, you have 1 minute and everyone respawns?
http://sourceforge.net/projects/thunderwalker/ source files.
we tried some code, but keeps crashing server when it goes to have people respawn
So map changes, you have 1 minute and everyone respawns?
http://sourceforge.net/projects/thunderwalker/ source files.
we tried some code, but keeps crashing server when it goes to have people respawn
Is this where the match ends, new map loads, 1 minute timer, timer elapses, and then players are spawned?
If so, take a look at how TF does it. TF waits for team and class selection, instead of waiting, just initiate a 60 second timer, when the timer is done, flip a switch that spawns all who have selected a team on to their proper team, and anyone connecting from then on sees the switch is flipped, and thus does not encounter the 60 second timer, but merely selects their team and spawns.
If so, take a look at how TF does it. TF waits for team and class selection, instead of waiting, just initiate a 60 second timer, when the timer is done, flip a switch that spawns all who have selected a team on to their proper team, and anyone connecting from then on sees the switch is flipped, and thus does not encounter the 60 second timer, but merely selects their team and spawns.
...and all around me was the chaos of battle and the reek of running blood.... and for the first time in my life I knew true happiness.
-
- Posts: 32
- Joined: Thu Nov 20, 2008 12:51 am
- Location: Pennsylvania
- Contact:
"a quick prewar mode" tested on MVDSV 0.28
First in world.qc
in the startframe function I changed:
o k now in
defs.qc
client.qc
Then in items.qc all touch functions add this to the top
also in teamplay.qc add
The problem is:
it prints the seconds left to match start a tone of times in the console then when it gets to zero the server crashes with a bad movetype error.
idea:
Doc:
Okay the call to respawn(); is whats crashing the server if I do
T_Damage (self, self, self, 1000);
It will kill the player but won't automatically respawn players, you need to hit fire or jump to respawn.
I think when respawn is called it's called several times in rapid succession just as the bprints are called more than once this may be why it's crashing the server but I could be wrong on this.
First in world.qc
in the startframe function I changed:
Code: Select all
if (time > prematch_time)//R00k
StartTimer(); // Doc start the game timer
defs.qc
Code: Select all
float gametime; // countdown timer
float prematch_time = 120;//Number of seconds for prewar! :R00k
Code: Select all
void() CheckRules =
{
local entity tent,e;
local string stemp;
if (gameover || pregameover) // someone else quit the game already
return;
if (time < prematch_time)//2 minutes
{
//Prewar no damage------
tent = find(world,classname, "player");
while (tent != world)
{
tent.takedamage == DAMAGE_NO;
tent = find(tent,classname, "player");
}
if ((time > (prematch_time - 10)) && (time < prematch_time))//Between 110 - 120 seconds start count down display...
{
if ((rint ((prematch_time - time)) == 10))
{
bprint (PRINT_HIGH, "Game starts in 10 seconds\n\n");
}
else
{
if ((rint ((prematch_time - time)) == 5))
{
bprint (PRINT_HIGH, "[5]\n");
}
else
{
if ((rint ((prematch_time - time)) == 4))
{
bprint (PRINT_HIGH, "[4]\n");
}
else
{
if ((rint ((prematch_time - time)) == 3))
{
bprint (PRINT_HIGH, "[3]\n");
}
else
{
if ((rint ((prematch_time - time)) == 2))
{
bprint (PRINT_HIGH, "[2]\n");
}
else
{
if ((rint ((prematch_time - time)) == 1))
{
bprint (PRINT_HIGH, "[1]\n");
tent = find(world,classname, "player");
while (tent != world)
{
e = self;
self = tent;
respawn();
self = e;
tent = find(tent,classname, "player");
}
}
}
}
}
}
}
}
}
Code: Select all
if (time < prematch_time)
return;
Code: Select all
void() TeamCaptureFlagTouch =
{
local entity p, escort;
local float timmy;
if (time < prematch_time)
return;
-----------------------------------This should allow a prewar of 120 seconds, you can lower it just change the value in defs2.qc. Players will spawn with shotguns and grapple but will not takedamage, and you cannot pick up items. So its just hook around.... Rook
The problem is:
it prints the seconds left to match start a tone of times in the console then when it gets to zero the server crashes with a bad movetype error.
idea:
Doc:
Okay the call to respawn(); is whats crashing the server if I do
T_Damage (self, self, self, 1000);
It will kill the player but won't automatically respawn players, you need to hit fire or jump to respawn.
I think when respawn is called it's called several times in rapid succession just as the bprints are called more than once this may be why it's crashing the server but I could be wrong on this.
-
- Posts: 32
- Joined: Thu Nov 20, 2008 12:51 am
- Location: Pennsylvania
- Contact:
Okay, here's a revised version in the format of the original version.
Add to the bottom of defs.qc:
Replace StartFrame in world.qc with:
Add to the top of all touch functions in items.qc and to the top of T_Damage in combat.qc:
And to the top of TeamCaptureFlagTouch in teamplay.qc like so:
And that's it. Let us know if everything works. :)
Add to the bottom of defs.qc:
Code: Select all
float game_started; // TRUE if out of warmup
float nextcountdown; // count once every second
float prematch_time = 120; //Number of seconds for prewar! :R00k
void() set_suicide_frame; // prototype
void() respawn; // ditto
Code: Select all
void() StartFrame =
{
local entity tent, oldself;
timelimit = cvar("timelimit") * 60;
fraglimit = cvar("fraglimit");
teamplay = cvar("teamplay");
deathmatch = cvar("deathmatch");
framecount = framecount + 1;
if (time > prematch_time)//R00k
{
StartTimer(); // Doc start the game timer
if (!game_started)
{
game_started = TRUE;
tent = find(world, classname, "player");
while (tent != world)
{
oldself = self;
self = tent;
set_suicide_frame();
respawn();
self = oldself;
tent = find(tent, classname, "player");
}
}
}
else if (prematch_time - time <= 10)
if (nextcountdown <= time)
{
nextcountdown = time + 1;
if (ceil(prematch_time - time) == 10)
bprint (PRINT_HIGH, "Game starts in 10 seconds\n");
else
bprint3 (PRINT_HIGH, "[", ftos(ceil(prematch_time - time)), "]\n");
}
};
Code: Select all
if (time < prematch_time)
return;
Code: Select all
void() TeamCaptureFlagTouch =
{
local entity p, escort;
local float timmy;
if (time < prematch_time)
return;
...
Makes sense, as in my netQuake mods i dont have check_rules per client anymore, but called from startframe, when porting to QW I forgot to change the bprint to sprints...Supa wrote:Try moving your prematch timer code from CheckRules to StartFrame? CheckRules is called by every client every frame in PlayerPreThink, so that would be why you're getting spammed with timer messages.
Supa's tight optimizations should work exactly.
-
- Posts: 32
- Joined: Thu Nov 20, 2008 12:51 am
- Location: Pennsylvania
- Contact:
-
- Posts: 32
- Joined: Thu Nov 20, 2008 12:51 am
- Location: Pennsylvania
- Contact:
-
- Posts: 399
- Joined: Thu May 15, 2008 10:46 pm
- Location: its a secret