View previous topic :: View next topic |
Author |
Message |
shadowtails
Joined: 30 Jul 2006 Posts: 11
|
Posted: Wed Aug 02, 2006 7:42 am Post subject: Problems witch crouching tutorial |
|
|
hello evyrybody i have problem witch DP crouch tutorial.When i crouch in decreesing wall wich is smaller then player and i release the courch button i stand through wall.How can i repair this bug?
This is the CHRIS crouch code:
//===================
//Chris
//Crouch for player '06
//===================
.float crouch, attemptcrouch;
float (entity targ) crouchcheck =
{
makevectors (self.v_angle);
tracebox (self.origin, VEC_HULL_MIN, VEC_HULL_MAX, self.origin + '0 0 16', FALSE, self);
/*
vector VEC_HULL_MIN = '-16 -16 -24';
vector VEC_HULL_MAX = '16 16 32';
*/
if (trace_fraction == 1) //hits nothing go ahead
return TRUE;
if (!trace_ent.takedamage) //hits world or nondamagable object
return FALSE;
return FALSE;
};
void() crouch_on =
{
if ((!self.crouch) && (!self.velocity_z)) //crouch down
{
setsize (self, '-16 -16 -8', '16 16 8');
self.crouch = 1;
self.view_ofs = '0 0 14';
self.attemptcrouch = 1;
return;
}
self.attemptcrouch = 0;
};
void() crouch_off =
{
if (self.crouch && (!self.velocity_z) && (crouchcheck(self))) //get up
{
setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
self.crouch = 0;
self.origin_z = self.origin_z + 16;
self.view_ofs = '0 0 22';
self.attemptcrouch = 0;
return;
}
self.attemptcrouch = 1;
};
Many thanks for help |
|
Back to top |
|
 |
SkinnedAlive
Joined: 25 Feb 2005 Posts: 65
|
Posted: Thu Aug 03, 2006 9:17 am Post subject: |
|
|
When I tested it I noticed that monsters also completely ignore you when you're crouched. |
|
Back to top |
|
 |
FrikaC Site Admin

Joined: 08 Oct 2004 Posts: 947
|
Posted: Thu Aug 03, 2006 1:15 pm Post subject: |
|
|
SkinnedAlive wrote: | When I tested it I noticed that monsters also completely ignore you when you're crouched. |
Because it changes the view_ofs to '0 0 0', which usually signals you've entered intermission. You could change that line to 0 0 1 and it would look pretty much the same, but monsters would no longer ignore you. _________________
 |
|
Back to top |
|
 |
Chris
Joined: 05 Aug 2006 Posts: 78
|
Posted: Sat Aug 05, 2006 5:35 am Post subject: |
|
|
No it lowers it to 0 0 14 view_ofs.
Quick fix:
open fight.qc
go to: float() CheckAttack
find:
spot2 = targ.origin + targ.view_ofs;
replace with:
if (!targ.crouch)
spot2 = targ.origin + targ.view_ofs;
if (targ.crouch)
spot2 = targ.origin;
Also due to Hull issues in different versions of bsp's that darkplaces supports (example: hl1 / q1 maps) it can't change the hull size effectively and causes sometimes to 'walk thru walls'. I wish I could edit this tutorial a bit more, it was just a snippet of code I had laying around from the hunted 3 that I never used. Sorry for the confusion. Hopefully that work around at least solved the issue of monsters seeing you, and good luck on your mod endeavors. |
|
Back to top |
|
 |
FrikaC Site Admin

Joined: 08 Oct 2004 Posts: 947
|
Posted: Sat Aug 05, 2006 4:40 pm Post subject: |
|
|
Send me any edits you want to make, or submit an alternate version of the tutorial and I swap out the old one with a new one. |
|
Back to top |
|
 |
shadowtails
Joined: 30 Jul 2006 Posts: 11
|
Posted: Sat Aug 05, 2006 5:50 pm Post subject: |
|
|
FrikaC wrote: | Send me any edits you want to make, or submit an alternate version of the tutorial and I swap out the old one with a new one. |
i want to make Quake2 style crouching with increasing wall(do not stay through wall,staz crouch). |
|
Back to top |
|
 |
|