Uniform pull towards a point
**/
vector steerlib_pull(vector point)
-{
+{SELFPARAM();
return normalize(point - self.origin);
}
Pull toward a point, The further away, the stronger the pull.
**/
vector steerlib_arrive(vector point,float maximal_distance)
-{
+{SELFPARAM();
float distance;
vector direction;
Pull toward a point increasing the pull the closer we get
**/
vector steerlib_attract(vector point, float maximal_distance)
-{
+{SELFPARAM();
float distance;
vector direction;
}
vector steerlib_attract2(vector point, float min_influense,float max_distance,float max_influense)
-{
+{SELFPARAM();
float distance;
vector direction;
float influense;
Move away from a point.
**/
vector steerlib_repell(vector point,float maximal_distance)
-{
+{SELFPARAM();
float distance;
vector direction;
Try to keep at ideal_distance away from point
**/
vector steerlib_standoff(vector point,float ideal_distance)
-{
+{SELFPARAM();
float distance;
vector direction;
where range is the cicrle radius and tresh is how close we need to be to pick a new heading.
**/
vector steerlib_wander(float range,float tresh,vector oldpoint)
-{
+{SELFPARAM();
vector wander_point;
wander_point = v_forward - oldpoint;
Dodge a point. dont work to well.
**/
vector steerlib_dodge(vector point,vector dodge_dir,float min_distance)
-{
+{SELFPARAM();
float distance;
distance = max(vlen(self.origin - point),min_distance);
**/
.float flock_id;
vector steerlib_flock(float _radius, float standoff,float separation_force,float flock_force)
-{
+{SELFPARAM();
entity flock_member;
vector push = '0 0 0', pull = '0 0 0';
float ccount = 0;
xy only version (for ground movers).
**/
vector steerlib_flock2d(float _radius, float standoff,float separation_force,float flock_force)
-{
+{SELFPARAM();
entity flock_member;
vector push = '0 0 0', pull = '0 0 0';
float ccount = 0;
This results in a aligned movement (?!) much like flocking.
**/
vector steerlib_swarm(float _radius, float standoff,float separation_force,float swarm_force)
-{
+{SELFPARAM();
entity swarm_member;
vector force = '0 0 0', center = '0 0 0';
float ccount = 0;
You need to call makevectors() (or equivalent) before this function to set v_forward and v_right
**/
vector steerlib_traceavoid(float pitch,float length)
-{
+{SELFPARAM();
vector vup_left,vup_right,vdown_left,vdown_right;
float fup_left,fup_right,fdown_left,fdown_right;
vector upwish,downwish,leftwish,rightwish;
Run tracelines in a forward trident, bias each direction negative if something is found there.
**/
vector steerlib_traceavoid_flat(float pitch, float length, vector vofs)
-{
+{SELFPARAM();
vector vt_left, vt_right,vt_front;
float f_left, f_right,f_front;
vector leftwish, rightwish,frontwish, v_left;
//#define BEAMSTEER_VISUAL
float beamsweep(vector from, vector dir,float length, float step,float step_up, float step_down)
-{
+{SELFPARAM();
float i;
vector a,b,u,d;
}
vector steerlib_beamsteer(vector dir, float length, float step, float step_up, float step_down)
-{
+{SELFPARAM();
float bm_forward, bm_right, bm_left,p;
vector vr,vl;
//#define TLIBS_TETSLIBS
#ifdef TLIBS_TETSLIBS
void flocker_die()
-{
+{SELFPARAM();
Send_Effect(EFFECT_ROCKET_EXPLODE, self.origin, '0 0 0', 1);
self.owner.cnt += 1;
void flocker_think()
-{
+{SELFPARAM();
vector dodgemove,swarmmove;
vector reprellmove,wandermove,newmove;
void spawn_flocker()
-{
+{SELFPARAM();
entity flocker;
flocker = spawn ();
}
void flockerspawn_think()
-{
+{SELFPARAM();
if(self.cnt > 0)
}
void flocker_hunter_think()
-{
+{SELFPARAM();
vector dodgemove,attractmove,newmove;
entity e,ee;
float d,bd;
float globflockcnt;
void spawnfunc_flockerspawn()
-{
+{SELFPARAM();
precache_model ( "models/turrets/rocket.md3");
precache_model("models/turrets/c512.md3");
++globflockcnt;