Acceleration

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Soviet
Core Staff
Core Staff
Posts: 7760
Joined: April 23rd, 2005, 9:12 pm
Location: Plano, Texas
Contact:

Acceleration

Post by Soviet » August 8th, 2008, 7:03 pm

Is there any way to add a trigger that accelerates a player's velocity on contact?
Image
ImageImageImage
Image
"Zaitsev is a cunt." - Pedsdude

Pedsdude
Site Admin
Site Admin
Posts: 15909
Joined: October 15th, 2004, 7:18 pm
Location: UK

Re: Acceleration

Post by Pedsdude » August 8th, 2008, 7:20 pm

Acceleration is a change in velocity. If you change direction then technically you are accelerating, as acceleration is a vector not a scalar.
Image
Image

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: Acceleration

Post by Nightmare » August 8th, 2008, 8:28 pm

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.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

Soviet
Core Staff
Core Staff
Posts: 7760
Joined: April 23rd, 2005, 9:12 pm
Location: Plano, Texas
Contact:

Re: Acceleration

Post by Soviet » August 8th, 2008, 9:30 pm

where is that code used?
Image
ImageImageImage
Image
"Zaitsev is a cunt." - Pedsdude

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: Acceleration

Post by Nightmare » August 8th, 2008, 10:21 pm

No idea, I've never looked into the cod4 files. Just try searching around.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Acceleration

Post by Drofder2004 » August 8th, 2008, 10:39 pm

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 );
Image
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

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: Acceleration

Post by Nightmare » August 8th, 2008, 11:32 pm

I just tried to look at the IW Script documentation to see what "setmovespeed" does. Those bastards took it down! :(
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

Soviet
Core Staff
Core Staff
Posts: 7760
Joined: April 23rd, 2005, 9:12 pm
Location: Plano, Texas
Contact:

Re: Acceleration

Post by Soviet » August 9th, 2008, 12:15 am

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?
Image
ImageImageImage
Image
"Zaitsev is a cunt." - Pedsdude

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: Acceleration

Post by Nightmare » August 9th, 2008, 12:35 am

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.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

Soviet
Core Staff
Core Staff
Posts: 7760
Joined: April 23rd, 2005, 9:12 pm
Location: Plano, Texas
Contact:

Re: Acceleration

Post by Soviet » August 9th, 2008, 1:02 am

What do you mean by find the function? Where should I look for it?
Image
ImageImageImage
Image
"Zaitsev is a cunt." - Pedsdude

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Acceleration

Post by Drofder2004 » August 9th, 2008, 2:12 pm

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);
Image
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

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Acceleration

Post by Drofder2004 » August 9th, 2008, 2:13 pm

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/
Image
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

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Acceleration

Post by Drofder2004 » August 9th, 2008, 4:42 pm

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 >.>
Image
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

Soviet
Core Staff
Core Staff
Posts: 7760
Joined: April 23rd, 2005, 9:12 pm
Location: Plano, Texas
Contact:

Re: Acceleration

Post by Soviet » August 9th, 2008, 4:44 pm

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.
Image
ImageImageImage
Image
"Zaitsev is a cunt." - Pedsdude

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Acceleration

Post by Drofder2004 » August 9th, 2008, 4:52 pm

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);
Image
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

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests