Quake 2 Double Jump
Moderator: InsideQC Admins
3 posts
• Page 1 of 1
Quake 2 Double Jump
Ok I'm trying to code a double jump function in Quake 2 similar to what we see in Unreal Tournament (not just the physics exploit), however what I've got doesn't seem to work at all.
In pmove.c:
in pml_t -
Add -
In PM_CheckJump
Change
to
While the double jumping bit works fine, the check to see if we're already double jumping does nothing at all. I'm wondering if the pml struct is recreated per frame and so being wiped.
Any thoughts?
(Incidentally EGL has nothing to do with EGLQuake... them's just my initials)
In pmove.c:
in pml_t -
Add -
- Code: Select all
qboolean doublejump; //EGL Double Jump support
In PM_CheckJump
Change
- Code: Select all
if (pm->groundentity == NULL)
return;
to
- Code: Select all
if (pm->groundentity == NULL)
{
if(pml.doublejump == false) //EGL Double Jump
{
pml.doublejump = true;
if(pml.velocity[2] > 0) //Still rising?
{
if(pml.velocity[2] < 270)
pml.velocity[2] = 270;
}
}
return; // in air, so no effect
}
While the double jumping bit works fine, the check to see if we're already double jumping does nothing at all. I'm wondering if the pml struct is recreated per frame and so being wiped.
Any thoughts?
(Incidentally EGL has nothing to do with EGLQuake... them's just my initials)
- ArchAngel
- Posts: 37
- Joined: Fri Jun 03, 2011 7:33 pm
Fixed it
- Code: Select all
if (pm->groundentity == NULL)
{
if(pm->s.pm_flags & PMF_DOUBLE_JUMP) //EGL Double Jump
{
pm->s.pm_flags |= PMF_JUMP_HELD;
pm->s.pm_flags &= ~PMF_DOUBLE_JUMP;
if(pml.velocity[2] > 0) //Still rising?
{
if(pml.velocity[2] < 270)
pml.velocity[2] = 270;
}
}
return; // in air, so no effect
}
pm->s.pm_flags |= PMF_JUMP_HELD;
pm->groundentity = NULL;
pml.velocity[2] += 270;
if (pml.velocity[2] < 270)
pml.velocity[2] = 270;
pm->s.pm_flags |= PMF_DOUBLE_JUMP;
- ArchAngel
- Posts: 37
- Joined: Fri Jun 03, 2011 7:33 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
