Probably not too many are going to be interested in this, but I'm curious
why this teleporter doesn't put you where you were when you first dropped
it. Let's say on agdm01 at the end of one of the long hallways you drop one
of these things, then wander around the map for a little bit and then
teleport back. it puts you in the middle part of the map, nowhere near where
you dropped the teleporter object. My question is why self.origin is not
really where you end up? I'm only using this because I still don't
understand how to keep people from getting stuck in walls after they use my
teleporter fire weapon. The weapon code is a bit longer than this stuff
here. These are just quick and dirty functions and there's not much to
them.
void(entity ent) DropTeleport = //Will drop location for The
destination
{
if(!ent.tele_dropped) {
ent.teledrop_dest = spawn(); //create a temp entity for location of
Teleporter
}
setorigin(ent.teledrop_dest, ent.origin);
ent.teledrop_dest.origin = ent.origin; //records the location
ent.teledrop_dest.mangle = ent.angles;
ent.teledrop_dest.nextthink = 10;
ent.teledrop_dest.think = SUB_Remove;
ent.tele_dropped = 1;
//dprint("Teleport destination dropped.");
};
void() Teleport_to_drop =
{ //This will Teleport you to the Teleport Location temp entity that was
recorded above
local vector org;
if(!self.tele_dropped) {
//dprint("No destination dropped.");
return;
}
if(self.health <= 0) {
return;
}
spawn_tfog (self.teledrop_dest.origin);
makevectors (self.teledrop_dest.mangle);
org = self.teledrop_dest.origin;
spawn_tfog (org);
//spawn_tdeath (org,self);
play_teleport (self);
setorigin (self,self.teledrop_dest.origin);
self.angles = self.teledrop_dest.mangle;
self.fixangle = 1;
//self.velocity = v_forward * 100;
self.teleport_time = time + 0.5; // Shorter teleport recovery time
self.flags = self.flags - self.flags & FL_ONGROUND;
//cleanup
self.teledrop_dest.nextthink = 0.1;
self.teledrop_dest.think = SUB_Remove;
self.tele_dropped = 0;
};
_______________________________________________
AGRIP-discuss mailing list
[email protected]
http://lists.agrip.org.uk/cgi-bin/mailman/listinfo/agrip-discuss