Page 1 of 2
Acceleration
Posted: August 8th, 2008, 7:03 pm
by Soviet
Is there any way to add a trigger that accelerates a player's velocity on contact?
Re: Acceleration
Posted: August 8th, 2008, 7:20 pm
by Pedsdude
Acceleration is a change in velocity. If you change direction then technically you are accelerating, as acceleration is a vector not a scalar.
Re: Acceleration
Posted: August 8th, 2008, 8:28 pm
by Nightmare
Guess what Soviet, I've got good news, bad news and maybe news.
Good news is, you can change a players velocity through scripting.
Bad news is, it's single player only.
The maybe news is, you could look in the SP files, see if you can find that bit of code, and just copy and paste it into mp and thus recreate the velocity editing function in your gsc.
Re: Acceleration
Posted: August 8th, 2008, 9:30 pm
by Soviet
where is that code used?
Re: Acceleration
Posted: August 8th, 2008, 10:21 pm
by Nightmare
No idea, I've never looked into the cod4 files. Just try searching around.
Re: Acceleration
Posted: August 8th, 2008, 10:39 pm
by Drofder2004
Pedsdude wrote:Acceleration is a change in velocity. If you change direction then technically you are accelerating, as acceleration is a vector not a scalar.
*POP*
Take cover, his head just imploded.
CoD4 scripts are in the RAW file you downloaded with the tools.
Try
self SetMoveSpeedScale( 1.5 );
Re: Acceleration
Posted: August 8th, 2008, 11:32 pm
by Nightmare
I just tried to look at the IW Script documentation to see what "setmovespeed" does. Those bastards took it down!

Re: Acceleration
Posted: August 9th, 2008, 12:15 am
by Soviet
it appears that that command is used to set the speed a player moves with a certain weapon. So, not sure it can be used with mapping scripting.
edit: after some research, I think that will increase a player's speed, however, I want it just to increase velocity, not speed permanently. So, I think the command SetVelocity would be more applicable, would you agree drof/nm?
Re: Acceleration
Posted: August 9th, 2008, 12:35 am
by Nightmare
Yes, that's what I said to use at the beginning...
Thing is, it's SP only, so you will have to find that function and paste the thing in your gsc.
Re: Acceleration
Posted: August 9th, 2008, 1:02 am
by Soviet
What do you mean by find the function? Where should I look for it?
Re: Acceleration
Posted: August 9th, 2008, 2:12 pm
by Drofder2004
if the above command works, why not just use a loop to make it seem like acceleration?
Code: Select all
i = 1;
while(i < maximumSpeed)
{
player SetMoveSpeedScale(i);
i=+0.1;
wait 0.1;
}
player SetMoveSpeedScale(1);
Re: Acceleration
Posted: August 9th, 2008, 2:13 pm
by Drofder2004
Nightmare wrote:I just tried to look at the IW Script documentation to see what "setmovespeed" does. Those bastards took it down!

http://www.zeroy.com/script/
Re: Acceleration
Posted: August 9th, 2008, 4:42 pm
by Drofder2004
KillerSam wrote:Drofder2004 wrote:Nightmare wrote:I just tried to look at the IW Script documentation to see what "setmovespeed" does. Those bastards took it down!

http://www.zeroy.com/script/
double post zomg! And he acknowledged that link in another topic somewhere

I noticed after my post, sue me >.>
Re: Acceleration
Posted: August 9th, 2008, 4:44 pm
by Soviet
I'm fine with instantaneous acceleration, I just want realistic deceleration. I want it to work kind of like a human cannonball. I'm going to mess around with the movegravity command when I get a chance, but if you can think of a way to use movespeedscale to replicate realistic deceleration that would be great.
Re: Acceleration
Posted: August 9th, 2008, 4:52 pm
by Drofder2004
If the person is flying through the air, then just use attach the player to a script_model and use move gravity.
A deceleration script would be the same as the above script, except start at MAXSPEED and count downwards...
i = MAXSPEED;
Code: Select all
while(i > 1)
{
player SetMoveSpeedScale(i);
i=-0.1;
wait 0.1;
}
player SetMoveSpeedScale(1);