View previous topic :: View next topic |
Author |
Message |
Team Xlink
Joined: 25 Jun 2009 Posts: 320
|
Posted: Fri Jan 08, 2010 11:35 pm Post subject: Player Acceleration and Deceleration |
|
|
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 |
|
 |
c0burn
Joined: 05 Nov 2004 Posts: 158 Location: Liverpool, England
|
Posted: Fri Jan 08, 2010 11:47 pm Post subject: Re: Player Acceleration and Deceleration |
|
|
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 |
|
 |
Team Xlink
Joined: 25 Jun 2009 Posts: 320
|
Posted: Fri Jan 08, 2010 11:49 pm Post subject: Re: Player Acceleration and Deceleration |
|
|
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 |
|
 |
c0burn
Joined: 05 Nov 2004 Posts: 158 Location: Liverpool, England
|
Posted: Fri Jan 08, 2010 11:59 pm Post subject: |
|
|
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 |
|
 |
Teiman
Joined: 03 Jun 2007 Posts: 309
|
Posted: Sat Jan 09, 2010 5:31 pm Post subject: Re: Player Acceleration and Deceleration |
|
|
Quote: |
self.testtimer = self.velocity + 1; |
is this adding a float to a vector ? looks wrong, but maybe is me |
|
Back to top |
|
 |
|