Forum

Solid_BBOX "skating"

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Solid_BBOX "skating"

Postby Ghost_Fang » Wed May 11, 2011 3:22 am

I've asked this before and didnt get much feedback on it, so let me try and rephrase the question and what im looking for. I have weapon pickups, and i need them to be able to get hit by a traceline, thats what allows the player to pick them up, in order for them to be hit by a traceline, i know they have to be solid. so i have them as solid_BBOX and setsize (self, '-15 -15 0', '15 15 8'); so its small collision, and it works out fine and dandy, except when the player walks on it, they kinda "skate" and cant jump. I was wondering where i would change this. I thought i saw a tutorial on this once before that allowed player to jump on misc_explobox and walk freely and jump off etc. Could someone tell me what i would need to do? or point me to that tutorial? Thanks.
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby r00k » Wed May 11, 2011 4:27 am

Above void () PutClientInServer =

add..

Code: Select all
/*
================
by: Philip Martin aka: Kryten
When on top of monsters or players you slide. This is a QuakeC problem.
The function below fixes that problem.
based on code given to Kryten by: Michael Turitzin (MaNiAc)
================
*/
void() player_touch =
{
   //can cause problems for monsters on top of a player,  so only players
   if (other.classname != "player")
      return;
   
   if (other.health <= 0)
   {
      return;
   }

   if ((!other.flags & FL_ONGROUND) && (other.absmin_z >= self.absmax_z - 2))
      other.flags = other.flags | FL_ONGROUND;
   
   //you can add other stuff like pushable players/monsters here
};
// 1998-09-16 Sliding/not-jumping on monsters/boxes/players fix


The other is the PLAYER, the self is the entity you are on top of...

Then within the PutClientInServer somewhere like after self.solid add.
Code: Select all
self.touch   = player_touch;



(1998?! jeez time flies!!)...
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Postby Ghost_Fang » Wed May 11, 2011 5:36 am

thanks a lot! will try it out here in a bit! :D
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest