Acceleration
Moderator: Core Staff
Re: Acceleration
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?
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Acceleration
Code: Select all
while(i > 1 && player !(isOnGround()))
{
player SetMoveSpeedScale(i);
i=-0.1;
wait 0.1;
}
player SetMoveSpeedScale(1);

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: Acceleration
sounds good, when I get to a testing point i'll try it out.
Re: Acceleration
I got it working for what I'm doing (with a lot of help from nm).
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.
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);
}
}
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Acceleration
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
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


Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Who is online
Users browsing this forum: No registered users and 3 guests