So I've been trying to get the player model to look in the direction I'm moving and not the direction I'm looking. So far it works (though kinda ugly), but I cannot figure out how to get the player to "stay" looking in the same direction once I've stopped.
I put this into playermovement.qc at the end.........yes using DarkPlaces.
// //begin exact nsew
if (self.velocity_y <= -45)
self.angles = self.v_angle = '0 -90 0';//n
else if (self.velocity_y >= 45)
self.angles = self.v_angle = '0 90 0';//s
if (self.velocity_x <= -45)
self.angles = self.v_angle = '0 -180 0';
else if (self.velocity_x >= 45)
self.angles = self.v_angle = '0 0 0';
//end exact udlr
//begin exact diagnals
if ((self.velocity_x <= -45 )&&(self.velocity_y <= -45))
self.angles = self.v_angle = '0 -135 0';
else if ((self.velocity_x >= 45)&&(self.velocity_y <= -45))
self.angles = self.v_angle = '0 -45 0';
if ((self.velocity_x <= -45)&&(self.velocity_y >= 45))
self.angles = self.v_angle = '0 135 0';
else if ((self.velocity_x >= 45)&&(self.velocity_y >= 45))
self.angles = self.v_angle = '0 45 0';
}
While running, the player shoots in the same direction. When the player stops you start shooting/looking where the mouse is.
I know some of the problem is:
using velocity, and not some arsome math equation that balances angle from mouse angle. (or something simpler)
I know it has to do with playerpostthink, since I have no call. (what would the call be?)
I have tried 2DCAM, but I am too many.qc fies deep into other modifications, and would be lost without the original qc code.
any ideas?
I put this into playermovement.qc at the end.........yes using DarkPlaces.
// //begin exact nsew
if (self.velocity_y <= -45)
self.angles = self.v_angle = '0 -90 0';//n
else if (self.velocity_y >= 45)
self.angles = self.v_angle = '0 90 0';//s
if (self.velocity_x <= -45)
self.angles = self.v_angle = '0 -180 0';
else if (self.velocity_x >= 45)
self.angles = self.v_angle = '0 0 0';
//end exact udlr
//begin exact diagnals
if ((self.velocity_x <= -45 )&&(self.velocity_y <= -45))
self.angles = self.v_angle = '0 -135 0';
else if ((self.velocity_x >= 45)&&(self.velocity_y <= -45))
self.angles = self.v_angle = '0 -45 0';
if ((self.velocity_x <= -45)&&(self.velocity_y >= 45))
self.angles = self.v_angle = '0 135 0';
else if ((self.velocity_x >= 45)&&(self.velocity_y >= 45))
self.angles = self.v_angle = '0 45 0';
}
While running, the player shoots in the same direction. When the player stops you start shooting/looking where the mouse is.
I know some of the problem is:
using velocity, and not some arsome math equation that balances angle from mouse angle. (or something simpler)
I know it has to do with playerpostthink, since I have no call. (what would the call be?)
I have tried 2DCAM, but I am too many.qc fies deep into other modifications, and would be lost without the original qc code.
any ideas?
Comment