DP MOVETYPE_FOLLOW

Discuss programming in the QuakeC language.
Post Reply
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

DP MOVETYPE_FOLLOW

Post by Cobalt »

Need some input here on how to resolve a problem that only happens when the ent being followed starts moving fast backwards. The FOLLOW_ENT , being noclip, will collide with the ent, and occupies the same origin as the ent its following. This is the code:

Code: Select all

      

        self.movetype = MOVETYPE_FOLLOW;
        makevectors (e.v_angle);
	 self.aiment = e;
	 self.punchangle = e.angles;

	  self.view_ofs = ((v_forward * -13));
	  if (!infront (e))  // tried this, not working
	 self.view_ofs = ((v_forward * 13));
	
       self.nextthink = time + sys_ticrate;

Basicly v_forward reverses direction when the ent (e) starts moving backwards. At low velocity, its ok, but once you hit near sv_maxspeed, it starts to wander into (e) eventually. Network play makes it worse. I suppose I could do constant tracelines or traceboxes to detect collision, as a .touch is not wise here....but how to code so it smoothly sets origin, and not is jerky?
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: DP MOVETYPE_FOLLOW

Post by r00k »

move_type follow is handled engineside possibly client side test if the following ent is in a find radius and limit that dist to 50 units
Post Reply