Player Acceleration and Deceleration
Moderator: InsideQC Admins
5 posts
• Page 1 of 1
Player Acceleration and Deceleration
Hello.
I am trying to make an accelerating/decelerating thing for vehicles.
I have this in PlayerPostThink in Client.qc
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.
I am trying to make an accelerating/decelerating thing for vehicles.
I have this in PlayerPostThink in Client.qc
- Code: Select all
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.
- Team Xlink
- Posts: 368
- Joined: Thu Jun 25, 2009 4:45 am
- Location: Michigan
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: Select all
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?
- c0burn
- Posts: 208
- Joined: Fri Nov 05, 2004 12:48 pm
- Location: Liverpool, England
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.
- Team Xlink
- Posts: 368
- Joined: Thu Jun 25, 2009 4:45 am
- Location: Michigan
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.
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.
- c0burn
- Posts: 208
- Joined: Fri Nov 05, 2004 12:48 pm
- Location: Liverpool, England
Re: Player Acceleration and Deceleration
self.testtimer = self.velocity + 1;
is this adding a float to a vector ? looks wrong, but maybe is me
- Teiman
- Posts: 309
- Joined: Sun Jun 03, 2007 9:39 am
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest