Announcement

Collapse
No announcement yet.

Qaukec help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Qaukec help

    I'm trying to change the player speed, via the quakec source code. I cant seem to find where the variables are sorted or how to change them so the player walks slower. Is this do-able or is the player speed hard coded to the game engine its self? Any help will be much appreciated, thanks in advance.

  • #2
    in console you can change the values


    cl_forwardspeed
    cl_backspeed
    cl_sidespeed


    you can use an autoexec.xfg with your configuration speed
    the invasion has begun! hide your children, grab the guns, and pack sandwiches.

    syluxman2803

    Comment


    • #3
      Nahuel's suggestions actually will help a little bit, but ultimately the server controls speed.

      To increase speed, set sv_maxspeed. It defaults to 320. Set it to say, 640 which would double the top speed.

      Then change cl_forwardspeed to 9999 and the other variable's nahuel pointed out.
      Quakeone.com - Being exactly one-half good and one-half evil has advantages. When a portal opens to the antimatter universe, my opposite is just me with a goatee.

      So while you guys all have to fight your anti-matter counterparts, me and my evil twin will be drinking a beer laughing at you guys ...

      Comment


      • #4
        If you want to do it in Quakec and not some stuffcmd, which can be hacked, look at the water code. the quakeC slows the player down. I used this technique when making SpeedBall, the ball carrier runs slower than other players. So, it's been tested and works rather well.

        .velocity though is what you want to change.
        playerprethink

        Code:
        		
        	if (self.style & CA_BALL_CARRIER)
        	{
        		if (self.flags & FL_ONGROUND)
        		{
        			self.velocity_x = (1 - (2.7 * frametime)) * (self.velocity_x);// slow down ball carrier
        			self.velocity_y = (1 - (2.7 * frametime)) * (self.velocity_y);// slow down ball carrier
        		}
        	}
        Last edited by R00k; 06-23-2016, 09:23 PM.
        www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

        Comment


        • #5
          So in which .qc file should I place these lines of code to slow the player down?

          Comment


          • #6
            Originally posted by R00k View Post
            If you want to do it in Quakec and not some stuffcmd, which can be hacked, look at the water code. the quakeC slows the player down. I used this technique when making SpeedBall, the ball carrier runs slower than other players. So, it's been tested and works rather well.

            .velocity though is what you want to change.
            playerprethink

            Code:
            		
            	if (self.style & CA_BALL_CARRIER)
            	{
            		if (self.flags & FL_ONGROUND)
            		{
            			self.velocity_x = (1 - (2.7 * frametime)) * (self.velocity_x);// slow down ball carrier
            			self.velocity_y = (1 - (2.7 * frametime)) * (self.velocity_y);// slow down ball carrier
            		}
            	}
            Okay I found what you meant by playerprethink, its in client.qc. Wow thanks for the help guys, I got It working!

            Comment


            • #7
              I've modified player velocity via QC like your code, R00k, but I didn't include the frametime part...what does that do?
              'Replacement Player Models' Project

              Comment


              • #8
                I believe if you leave out frametime and your frame rate drops. It could affect the player movement in an advise way. I'm not sure if that's how quake engine works but that's my guess. So you probably should leave the frametime in there.

                Comment


                • #9
                  Player speed control

                  In the original rune server, the haste rune speeds up shooting and possibly projectiles.

                  When I re-implemented it I wanted haste to speed up the player running.

                  But how to do that without boosting every players run speed?
                  (This is what happens if you increase sv_maxspeed and they max out cl_forwardspeed.)

                  I put this code in player_run()

                  Code:
                  // haste run faster
                  	local float f, ms, v, k;
                  	k = 0;
                  
                  	if (self.rune_flag & RUNE_FLG_HS) k = 1;    // has the haste rune
                  	if (self.rune_flag & TECH_TEIM) k = k + 1;  // has the haste tech
                  
                  	if (k)
                  	{
                  		if (k > 1) k = 1.2;
                  		ms = cvar("sv_maxspeed");
                  		f =  ms * 1.6 * k; // at 320 max, this is 576, for both runes 691
                  		if (self.movetype == MOVETYPE_FLY) f = ms * 1.4;
                  		v = vlen(self.velocity); 
                  		if (!self.movement_x && !self.movement_y)
                  		{
                  			if (v > ms)
                  				self.velocity = self.velocity * 0.95;// (ms / v); // cap it
                  		}
                  		else
                  		if (v < f)
                  		{
                  			if (self.movement_x > 20)
                  				self.velocity = self.velocity * (f / v);
                  			else
                  			{
                  				f = ms * 1.25 * k;
                  				if (self.movetype == MOVETYPE_FLY) f = ms * 0.9; // flight speed side & back normally .8 * ms
                  				if ( (fabs(self.movement_y) > 20) ||  (self.movement_x < 20) )
                  					self.velocity = self.velocity * (f / v);
                  			}
                  		}
                  	}
                  This does not require changes to sv_maxspeed or any cl_ speeds.
                  It also covers things like bunny hopping and strafe running.

                  I did not test it vs. the frametime issue noted below - but I'd bet it handles that as well.

                  One consequence I dont have a good answer for does exist. The player run is a lot harder to control - especially with both haste runes.

                  ______________________________
                  numbersix - Mod DB [_] Six Gaming

                  Join + watch the Quake-C group for more qc goodies - click "group watch follow" and "membership join group"
                  Support my code on patreon - I suggest the "Pledge 12" - you get a snapshot of my current project!
                  numbersix - Mod DB [_] Six Gaming

                  Support free code and get credit! - Hint "Pledge 24" comes with extra releases.

                  Comment

                  Working...
                  X