Forum

Needs help about dodging qc

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Needs help about dodging qc

Postby shadowtails » Sun Jul 30, 2006 7:19 am

Hello evyrybody.
Can anybody help me how can i make dodging like UT for Q1 please?
I have this code

void() PlayerDodgingLeft =
{
local vector start, end;

if (self.flags & FL_WATERJUMP)
return;

if (self.waterlevel >= 2)
{
if (self.watertype == CONTENT_WATER)
self.velocity_z = 100;
else if (self.watertype == CONTENT_SLIME)
self.velocity_z = 80;
else
self.velocity_z = 50;

// play swiming sound
if (self.swim_flag < time)
{
self.swim_flag = time + 1;
if (random() < 0.5)
sound (self, CHAN_BODY, "misc/water1.wav", 1, ATTN_NORM);
else
sound (self, CHAN_BODY, "misc/water2.wav", 1, ATTN_NORM);
}

return;
}

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

if ( !(self.flags & FL_JUMPRELEASED) )
return; // don't pogo stick

self.flags = self.flags - (self.flags & FL_JUMPRELEASED);

self.flags = self.flags - FL_ONGROUND; // don't stairwalk

self.button2 + self.button2 = self.button2 + self.button2;
// player jumping sound
sound (self, CHAN_BODY, "player/plyrjmp8.wav", 1, ATTN_NORM);
self.velocity_z = self.velocity_z + 170;
self.velocity_y = self.velocity_y + 450;
};

and it works but i don not known how can i make twice button like in UT.
Can anybody help and post instruction how can i make it please?
shadowtails
 
Posts: 11
Joined: Sun Jul 30, 2006 7:16 am

Postby FrikaC » Sun Jul 30, 2006 3:45 pm

Define "twice button".
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Postby Quake Matt » Sun Jul 30, 2006 3:52 pm

Twice button = double-tap?

It's tricky, since standard Quake engines handle player movement independently of QuakeC, so you can't easily read cursor/WASD presses. Last time I needed something like this, I completely hi-jacked the player's velocity and derived the key presses from that, but that was for an overhead camera, not an FPS game.

Personally, I'd recommend adding a completely new dodge key, much like the existing jump key. You could then compare the player's velocity from the previous frame with the current frame to see which direction he wants to dodge in.

Although, really, I only say this because I never liked having to double-tap to dodge!
User avatar
Quake Matt
 
Posts: 129
Joined: Sun Jun 05, 2005 9:59 pm

Postby scar3crow » Sun Jul 30, 2006 9:43 pm

Its not a typical dodge, in the Unreal games double tapping a directional indicator causes you to lunge a short distance in that direction, more horizontal than vertical in its movement and very sudden. It is put to quite a bit of use in UT2k3 as you can use it in conjunction with wall jumps to move about in an interesting fashion.

Be kinda neat to see it in Quake perhaps.
User avatar
scar3crow
InsideQC Staff
 
Posts: 1054
Joined: Tue Jan 18, 2005 8:54 pm
Location: Alabama

Postby Sajt » Sun Jul 30, 2006 10:40 pm

I agree with QuakeMatt. I've never gotten used to dodging in the unreal games - it's always ended up killing me (e.g.when doing some keypresses to finely adjust my position on a ledge) rather than me actually using it when I need to dodge. Having new buttons for dodge (e.g. Q and E) sounds like a much better idea.

And scar3crow, I've never figured out walljumping in UT2k4. I think I've accidetnally done it once (out of a *lot* of playing), but I don't know how to do it deliberately.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby scar3crow » Sun Jul 30, 2006 11:26 pm

Oh yeah it can screw one up, just look at Peak Monastery in UT. Im fine with it being separate keys as well.

Walljumping in UT2k3 is easy once you get used to it. Im not an acrobat like some people are by any means, but you can get around a lot easier - especially in conjunction with jumping at the apex of a plat lift (Ive launched myself off of the tips of trees across maps before with it). Basically double jump at a wall and Dodge Jump away from it, if youre close enough the game will consider the wall a valid "floor" from which to dodge.
User avatar
scar3crow
InsideQC Staff
 
Posts: 1054
Joined: Tue Jan 18, 2005 8:54 pm
Location: Alabama

Postby Sajt » Mon Jul 31, 2006 5:31 am

Oh. I tried jumping away from walls, didn't know you had to dodge jump away.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby Quake Matt » Mon Jul 31, 2006 11:35 am

Oh yeah it can screw one up, just look at Peak Monastery in UT.

Yeah, that was a killer! Fortunately, it always reminded me to go into the options and turn dodge off if I hadn't already!

On the subject of wall-jumping, has anyone tried adding it to Quake? I did in a mod a few years ago, which basically just threw out some tracelines whenever you pressed jump while in the air. If one of them found a wall, it'd bounce you away at the appropriate angle.
User avatar
Quake Matt
 
Posts: 129
Joined: Sun Jun 05, 2005 9:59 pm

Postby Error » Tue Aug 01, 2006 7:52 am

dodging is useless... therefore I disabled it.

lava (acid whatever), never-ending pits, and far falls make me hate it.
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest