Forum

DP MOVETYPE_FOLLOW

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

DP MOVETYPE_FOLLOW

Postby Cobalt » Thu Sep 12, 2013 6:30 pm

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?
User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA

Re: DP MOVETYPE_FOLLOW

Postby r00k » Thu Sep 12, 2013 11:42 pm

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
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest