Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

Tutorial: Quake World Style Jumping

| Inside3d Forums Forum Index -> QuakeC Programming

View previous topic :: View next topic
Author | Message
--- | ---
Team Xlink Joined: 25 Jun 2009 Posts: 320 |

Posted: Wed Aug 19, 2009 8:50 pm Post subject: Tutorial: Quake World Style Jumping |

Hello. Credit for this tutorial goes to Electro. Step One. Open up Client.qc Create a float client.qc at the top
Call it:

Code:
.float jump_remember;

This will be for when people are in the air and press jump.
While people are in the air, and press jump, we set it to TRUE. Then when they land, if they're on the ground and have this flag set to TRUE, then we make it execute the jump.
So next up is to make it set to TRUE if you press jump while in the air.
Find Player Jump in Client.qc and scroll down until you find this:

Code:
if (!(self.flags & FL_ONGROUND)) return;

Change it to be this:

Code:
if (!(self.flags & FL_ONGROUND)) { self.jump_remember = TRUE; return; }

Below, where it does:

Code:
self.button2 = 0;

Add this right after it:

Code:
self.jump_remember = FALSE;

Still in Player Jump.
Add this:

Code:
self.velocity = v_forward + (self.velocity * 1.05);//small push when jumping self.velocity = v_right + (self.velocity * 1.05);//small push when jumping

Now, we want to make it so it jumps if they have jump_remember TRUE, or button2 pressed.
In PlayerPreThink find this:

Code:
if (self.button2)

Change it to:

Code:
if ( (self.button2) || (self.jump_remember) )

That is all there is too it.
_________________

Anonymous wrote:
if it works, it works. if it doesn't, HAHAHA!

Last edited by Team Xlink on Thu Aug 27, 2009 4:27 am; edited 1 time in total

Back to top |

r00k Joined: 13 Nov 2004 Posts: 483 |

Posted: Thu Aug 20, 2009 4:23 am Post subject: |

in PlayerJump i've used this near the end..

Code:
self.velocity = v_forward + (self.velocity * 1.05);//small push when jumping self.velocity = v_right + (self.velocity * 1.05);//small push when jumping

seems to work well for me...
Oh wait, jump, press jump again in netquake and hold will make u jump when u land... i thought u meant mimicing QW strafe jumping for netQuake

Back to top |

Team Xlink Joined: 25 Jun 2009 Posts: 320 |

Posted: Thu Aug 27, 2009 4:25 am Post subject: |

Yeah, that is the goal of this tutorial, it seems that I forgot the part that increases your velocity, so I added that part now, thank you r00k. _________________

Anonymous wrote:
if it works, it works. if it doesn't, HAHAHA!

Back to top |

Display posts from previous:

| Inside3d Forums Forum Index -> QuakeC Programming | All times are GMT
Page 1 of 1

Jump to:

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2004 phpBB Group