Inside3D!
     

quakeworld start delay between maps (thunderwalker ctf mod)

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Batman!]ZFA[



Joined: 20 Nov 2008
Posts: 32
Location: Pennsylvania

PostPosted: Wed Mar 18, 2009 12:30 am    Post subject: quakeworld start delay between maps (thunderwalker ctf mod) Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
scar3crow
Inside3D Staff


Joined: 18 Jan 2005
Posts: 837
Location: Las Vegas, NV

PostPosted: Wed Mar 18, 2009 12:47 am    Post subject: Reply with quote

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.
_________________
...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.
Back to top
View user's profile Send private message AIM Address
Batman!]ZFA[



Joined: 20 Nov 2008
Posts: 32
Location: Pennsylvania

PostPosted: Wed Mar 18, 2009 1:48 am    Post subject: Reply with quote

"a quick prewar mode" tested on MVDSV 0.28

First in world.qc
in the startframe function I changed:
Code:
 if (time > prematch_time)//R00k       
        StartTimer(); // Doc start the game timer


o k now in
defs.qc

Code:
float gametime; // countdown timer
float prematch_time = 120;//Number of seconds for prewar!    :R00k


client.qc
Code:
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");
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }


Then in items.qc all touch functions add this to the top

Code:
if (time < prematch_time)
        return;


also in teamplay.qc add

Code:
void() TeamCaptureFlagTouch =
{
    local entity p, escort;
    local float timmy;

    if (time < prematch_time)
        return;


Quote:
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.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Supa



Joined: 26 Oct 2004
Posts: 122

PostPosted: Wed Mar 18, 2009 9:26 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
Batman!]ZFA[



Joined: 20 Nov 2008
Posts: 32
Location: Pennsylvania

PostPosted: Thu Mar 19, 2009 11:59 pm    Post subject: Reply with quote

Quote:

Doc
I tried this same result server crashes when repsawn(); is called and it still spams the console with a ton of bprint messages.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Supa



Joined: 26 Oct 2004
Posts: 122

PostPosted: Sat Mar 21, 2009 1:33 am    Post subject: Reply with quote

Okay, here's a revised version in the format of the original version.

Add to the bottom of defs.qc:

Code:

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


Replace StartFrame in world.qc with:

Code:

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");
   }
};


Add to the top of all touch functions in items.qc and to the top of T_Damage in combat.qc:

Code:

if (time < prematch_time)
        return;


And to the top of TeamCaptureFlagTouch in teamplay.qc like so:
Code:

void() TeamCaptureFlagTouch =
{
   local entity p, escort;
   local float timmy;

   if (time < prematch_time)
        return;
      
   ...


And that's it. Let us know if everything works. :)
Back to top
View user's profile Send private message Send e-mail
r00k



Joined: 13 Nov 2004
Posts: 483

PostPosted: Sat Mar 21, 2009 4:28 am    Post subject: Reply with quote

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.


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's tight optimizations should work exactly.
Back to top
View user's profile Send private message
Batman!]ZFA[



Joined: 20 Nov 2008
Posts: 32
Location: Pennsylvania

PostPosted: Sun Mar 22, 2009 1:09 am    Post subject: Reply with quote

Yes its working now!

Thanks.

Not crashing now.

now we just have to make it so people don't die during that time.

right now lava and slime will kill players.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
scar3crow
Inside3D Staff


Joined: 18 Jan 2005
Posts: 837
Location: Las Vegas, NV

PostPosted: Sun Mar 22, 2009 2:54 am    Post subject: Reply with quote

Well, you could adjust the functions that have lava and slime do damage do the same check of time < prematchtime and returning, else do their damage.
_________________
...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.
Back to top
View user's profile Send private message AIM Address
Batman!]ZFA[



Joined: 20 Nov 2008
Posts: 32
Location: Pennsylvania

PostPosted: Mon Mar 23, 2009 10:36 am    Post subject: Reply with quote

thanks we got that part figured out.

only thing is its a leaving body.

when the prematch period is over at the location where you were before you respawn.

Back to top
View user's profile Send private message Send e-mail Visit poster's website
MeTcHsteekle



Joined: 15 May 2008
Posts: 397
Location: its a secret

PostPosted: Mon Mar 23, 2009 7:42 pm    Post subject: Reply with quote

why is that quakeman a sickly pale?

anyways, i think that would be pretty cool to have deadguys on the map before the match even starts, gives it a factory slaughter kind of idea
_________________
bah
Back to top
View user's profile Send private message AIM Address
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Mon Mar 23, 2009 8:17 pm    Post subject: Reply with quote

in world.qc there's a function called CopyToBodyQueue
Just make it return without doing anything in prewar.
Or stop it from being called in client.qc/player.qc wherever it is.


How are you handling doors/plats? :)
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group