Page 2 of 2

Re: Acceleration

Posted: August 9th, 2008, 5:09 pm
by Soviet
but the problem I have there, is if they land before speed is back to 1, they're running around faster than normal, which I don't want to happen. Is there any way to revert it to 1 upon standing on a brush?

Re: Acceleration

Posted: August 10th, 2008, 12:44 am
by Drofder2004

Code: Select all

while(i > 1 && player !(isOnGround()))
{
   player SetMoveSpeedScale(i);
   i=-0.1;
   wait 0.1;
}

player SetMoveSpeedScale(1);

Re: Acceleration

Posted: August 10th, 2008, 3:05 am
by Soviet
sounds good, when I get to a testing point i'll try it out.

Re: Acceleration

Posted: August 12th, 2008, 11:13 pm
by Soviet
I got it working for what I'm doing (with a lot of help from nm).

Code: Select all

accelerate_1() 
{ 
trigger = getent("svt_accelerate_1","targetname");  
while(1)
{
trigger waittill ("trigger",player);
i=12;
while(i > 1 && player isOnGround())
{
   player SetMoveSpeedScale(i);
   wait(.01);
}
player SetMoveSpeedScale(1);
wait(2);
}
}
Basically, there is a ramp. When the person gets on it for a second, they are on the ground, so they go 12 times normal speed for .01, then switch back to 1, however they naturally decelerate back to 1. It works great.

Re: Acceleration

Posted: August 12th, 2008, 11:44 pm
by Drofder2004
The only problem I see, is the fact there is no such thing as "0.01" seconds.
A normal server runs at 20 frames per second, 1 second = 0.05 seconds per frame.

So, the shortest amount of script time is 0.05

But the engine automatically adjusts ;)