Inside3D!
     

Player Acceleration and Deceleration

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Team Xlink



Joined: 25 Jun 2009
Posts: 320

PostPosted: Fri Jan 08, 2010 11:35 pm    Post subject: Player Acceleration and Deceleration Reply with quote

Hello.


I am trying to make an accelerating/decelerating thing for vehicles.


I have this in PlayerPostThink in Client.qc

Code:
   if (self.weapon == IT_TEST) //Team Xlink - The TEST Vehicle
   {   
      if (self.velocity < 200 || self.velocity >= 170)
      {
         self.velocity = self.velocity * 1.1;
         self.testtimer = self.velocity + 1;
         self.nextthink = time + 1;
      }
   }


It sort of works.

You see, when you pickup that weapon ( Get into the vehicle) You automatically accelerate, but you never decelerate or even slow down, and it is always active.
_________________
Anonymous wrote:
if it works, it works. if it doesn't, HAHAHA!
Back to top
View user's profile Send private message
c0burn



Joined: 05 Nov 2004
Posts: 158
Location: Liverpool, England

PostPosted: Fri Jan 08, 2010 11:47 pm    Post subject: Re: Player Acceleration and Deceleration Reply with quote

Team Xlink wrote:
Hello.


I am trying to make an accelerating/decelerating thing for vehicles.


I have this in PlayerPostThink in Client.qc

Code:
   if (self.weapon == IT_TEST) //Team Xlink - The TEST Vehicle
   {   
      if (self.velocity < 200 || self.velocity >= 170)
      {
         self.velocity = self.velocity * 1.1;
         self.testtimer = self.velocity + 1;
         self.nextthink = time + 1;
      }
   }


It sort of works.

You see, when you pickup that weapon ( Get into the vehicle) You automatically accelerate, but you never decelerate or even slow down, and it is always active.


It would probably help if you tell us what you want it to do. Also, is this for the PSP?
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Team Xlink



Joined: 25 Jun 2009
Posts: 320

PostPosted: Fri Jan 08, 2010 11:49 pm    Post subject: Re: Player Acceleration and Deceleration Reply with quote

Team Xlink wrote:


I am trying to make an accelerating/decelerating thing for vehicles.



You see, when you pickup that weapon ( Get into the vehicle) You automatically accelerate, but you never decelerate or even slow down, and it is always active.


The first part is what to want to do the second part is the problem.
_________________
Anonymous wrote:
if it works, it works. if it doesn't, HAHAHA!
Back to top
View user's profile Send private message
c0burn



Joined: 05 Nov 2004
Posts: 158
Location: Liverpool, England

PostPosted: Fri Jan 08, 2010 11:59 pm    Post subject: Reply with quote

Why are you setting nextthink in playerpostthink?

You're also going to need to consider things like sv_maxspeed, cl_forward/back/side speed.

Some of it may need to be done engine side, but you can always check out qrally.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Teiman



Joined: 03 Jun 2007
Posts: 309

PostPosted: Sat Jan 09, 2010 5:31 pm    Post subject: Re: Player Acceleration and Deceleration Reply with quote

Quote:


self.testtimer = self.velocity + 1;


is this adding a float to a vector ? looks wrong, but maybe is me
Back to top
View user's profile Send private message
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