What I mean here ?
While I was working at some patch file tweaking/creating navigation in some map, I could see a sort of spot working like a bOneWay for some reason, perhaps BSP problem, to hell with it. I went to another solution by using a teleporter from said last spot in order to gain next objectives (MH in stage) because all Pawn hunter was stuck in the area with no way back - strange crap.
What is with teleporter then ?
Perhaps a new teleporter will have bSpecialCost being locked if is not enabled and having no handling from any way. If teleporter is enabled it should follow "RULEZ" for bPlayerOnly rather than teleporting everything touched... Engine has no deal here with it's own properties - LOL.
A Probing Code
Code: Select all
event int SpecialCost(Pawn Seeker)
{
if ( !bEnabled )
return 100000000;
else
{
if ( bPlayerOnly ) //I don't know if these aren't already natively handled, but... it would be nice to make sure about.
{
if ( Seeker.bIsPlayer )
return 0;
else
return 100000000;
}
else
return 0;
}
return 100000000; //for any sudden exception above - should not happen
}
event Actor SpecialHandling(Pawn Other)
{
local int i;
local vector Dist2D;
// This is called when pawn is about to come here directly - reachable so to speak
// When a teleporter is not active it should work as a blocked path...
if ( !bEnabled )
return None; //or Return a Moron type coding...
if ( bEnabled && (Other.RouteCache[1] != None)
&& Other.RouteCache[1].IsA('Teleporter') && (string(Other.RouteCache[1].tag)~=URL) )
{
if ( Abs(Location.Z - Other.Location.Z) < CollisionHeight + Other.CollisionHeight )
{
Dist2D = Location - Other.Location;
Dist2D.Z = 0;
if ( VSize(Dist2D) < CollisionRadius + Other.CollisionRadius )
Touch(Other);
}
return self;
}
if (TriggerActor == None)
{
FindTriggerActor();
if (TriggerActor == None)
return None;
}
if ( (TriggerActor2 != None)
&& (VSize(TriggerActor2.Location - Other.Location) < VSize(TriggerActor.Location - Other.Location)) )
return TriggerActor2;
return TriggerActor;
}
function Touch( actor Other )
{
local Teleporter Dest;
local int i;
local Actor A;
if ( bEnabled )
{
if ( bPlayerOnly && Pawn(Other) != None && Pawn(Other).Health > 0 && !Pawn(Other).bIsPlayer )
return;
if ( Pawn(Other) != None && Pawn(Other).Health > 0 ) //No bullshit here
if( Other.bCanTeleport && Other.PreTeleport(Self)==false )
{
if( (InStr( URL, "/" ) >= 0) || (InStr( URL, "#" ) >= 0) )
{
// Teleport to a level on the net.
if( (Role == ROLE_Authority) && (PlayerPawn(Other) != None) )
Level.Game.SendPlayer(PlayerPawn(Other), URL);
}
else
{
// Teleport to a random teleporter in this local level, if more than one pick random.
foreach AllActors( class 'Teleporter', Dest )
if( string(Dest.tag)~=URL && Dest!=Self )
i++;
i = rand(i);
foreach AllActors( class 'Teleporter', Dest )
if( string(Dest.tag)~=URL && Dest!=Self && i-- == 0 )
break;
if( Dest != None )
{
// Teleport the actor into the other teleporter.
if ( Other.IsA('Pawn') )
PlayTeleportEffect( Pawn(Other), false);
Dest.Accept( Other, self );
if( (Event != '') && (Other.IsA('Pawn')) )
foreach AllActors( class 'Actor', A, Event )
A.Trigger( Other, Other.Instigator );
}
else if ( Role == ROLE_Authority )
Pawn(Other).ClientMessage( "Teleport destination for "$self$" not found!" );
}
}
}
}
To add SpecialHandling for NonPlayer deal ? Is that even needed ? Monsters are morons after all but I'll try to catch if they are causing issues. Definitely monster from area is not allowed to roam out of guarding spot.
Code is not compatible to be conformed with stock because of new function needed and forgotten by Epic. Using a child Teleporter might be much recommended.
Function touch is not simulated here because player has no purpose to mess touching based on prediction specific to On-Line latency. Player location it's decided by server and NOT by client.