{
}
+#if 0
+void turret_checkpoint_think()
+{
+ if(self.enemy)
+ te_lightning1(self,self.origin, self.enemy.origin);
+
+ self.nextthink = time + 0.25;
+}
+#endif
/*QUAKED turret_checkpoint (1 0 1) (-32 -32 -32) (32 32 32)
-----------KEYS------------
target: .targetname of next waypoint in chain.
If a loop is of targets are formed, any unit entering this loop will patrol it indefinitly.
If the checkpoint chain in not looped, the unit will go "Roaming" when the last point is reached.
*/
+//float tc_acum;
void turret_checkpoint_init()
{
- traceline(self.origin, self.origin - '0 0 1024', MOVE_WORLDONLY, self);
- setorigin(self,trace_endpos + '0 0 8');
+ traceline(self.origin + '0 0 16', self.origin - '0 0 1024', MOVE_WORLDONLY, self);
+ setorigin(self, trace_endpos + '0 0 32');
if(self.target != "")
{
- self.enemy = find(world,targetname,self.target);
+ self.enemy = find(world, targetname, self.target);
if(self.enemy == world)
dprint("A turret_checkpoint faild to find its target!\n");
}
+ //self.think = turret_checkpoint_think;
+ //self.nextthink = time + tc_acum + 0.25;
+ //tc_acum += 0.25;
}
void spawnfunc_turret_checkpoint()
{
setorigin(self,self.origin);
self.think = turret_checkpoint_init;
- self.nextthink = time + 0.1;
+ self.nextthink = time + 0.2;
}
// Compat.
}
}
+//#define WALKER_FANCYPATHING
+
void walker_move_path()
{
+#ifdef WALKER_FANCYPATHING
// Are we close enougth to a path node to switch to the next?
if (vlen(self.origin - self.pathcurrent.origin) < 64)
if (self.pathcurrent.path_next == world)
self.steerto = steerlib_attract2(self.moveto,0.5,500,0.95);
walker_move_to(self.moveto, 0);
+#else
+ if (vlen(self.origin - self.pathcurrent.origin) < 64)
+ self.pathcurrent = self.pathcurrent.enemy;
+
+ if(!self.pathcurrent)
+ return;
+
+ self.moveto = self.pathcurrent.origin;
+ self.steerto = steerlib_attract2(self.moveto, 0.5, 500, 0.95);
+ walker_move_to(self.moveto, 0);
+#endif
}
.float idletime;
void walker_diehook()
{
+#ifdef self.pathcurrent
if (self.pathcurrent)
pathlib_deletepath(self.pathcurrent.owner);
+#endif
self.pathcurrent = world;
}
if (self.target != "")
{
- e = find(world,targetname,self.target);
+ e = find(world, targetname, self.target);
if (!e)
{
dprint("Initital waypoint for walker does NOT exsist, fix your map!\n");
dprint("Warning: not a turrret path\n");
else
{
- self.pathcurrent = WALKER_PATH(self.origin,e.origin);
+#ifdef WALKER_FANCYPATHING
+ self.pathcurrent = WALKER_PATH(self.origin, e.origin);
self.pathgoal = e;
+#else
+ self.pathcurrent = e;
+#endif
}
}
}