Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Engine.LiftCenter


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
//=============================================================================
// LiftCenter.
//=============================================================================
class LiftCenter extends NavigationPoint
			native;

var() name LiftTag;
var	 mover MyLift;
var() name LiftTrigger;
var trigger RecommendedTrigger;
var float LastTriggerTime;
var() float MaxZDiffAdd;  //added threshold for Z difference between pawn and lift (for lifts which are at the end of a ramp or stairs)

function PostBeginPlay()
{
	if ( LiftTag != '' )
		ForEach AllActors(class'Mover', MyLift, LiftTag )
	{
		MyLift.myMarker = self;
		SetBase(MyLift);
		break;
	}
	//log(self$" attached to "$MyLift);
	if ( LiftTrigger != '' )
		ForEach AllActors(class'Trigger', RecommendedTrigger, LiftTrigger )
		break;
	Super.PostBeginPlay();
}

/* SpecialHandling is called by the navigation code when the next path has been found.
It gives that path an opportunity to modify the result based on any special considerations
*/

function Actor SpecialHandling(Pawn Other)
{
	local float dist2d;

	if ( MyLift == None )
		return self;
	if ( Other.base == MyLift )
	{
		if ( (RecommendedTrigger != None)
				&& (myLift.SavedTrigger == None)
				&& (Level.TimeSeconds - LastTriggerTime > 5) )
		{
			Other.SpecialGoal = RecommendedTrigger;
			LastTriggerTime = Level.TimeSeconds;
			return RecommendedTrigger;
		}

		return self;
	}

	if ( (LiftExit(Other.MoveTarget) != None)
			&& (LiftExit(Other.MoveTarget).RecommendedTrigger != None)
			&& (LiftExit(Other.MoveTarget).LiftTag == LiftTag)
			&& (Level.TimeSeconds - LiftExit(Other.MoveTarget).LastTriggerTime > 5)
			&& (MyLift.SavedTrigger == None)
			&& (Abs(Other.Location.X - Other.MoveTarget.Location.X) < Other.CollisionRadius)
			&& (Abs(Other.Location.Y - Other.MoveTarget.Location.Y) < Other.CollisionRadius)
			&& (Abs(Other.Location.Z - Other.MoveTarget.Location.Z) < Other.CollisionHeight) )
	{
		LiftExit(Other.MoveTarget).LastTriggerTime = Level.TimeSeconds;
		Other.SpecialGoal = LiftExit(Other.MoveTarget).RecommendedTrigger;
		return LiftExit(Other.MoveTarget).RecommendedTrigger;
	}

	dist2d = square(Location.X - Other.Location.X) + square(Location.Y - Other.Location.Y);
	if ( (Location.Z - CollisionHeight - MaxZDiffAdd < Other.Location.Z - Other.CollisionHeight + Other.MaxStepHeight)
			&& (Location.Z - CollisionHeight > Other.Location.Z - Other.CollisionHeight - 1200)
			&& ( dist2D < 160000) )
	{
		return self;
	}

	if ( MyLift.BumpType == BT_PlayerBump && !Other.bIsPlayer )
		return None;
	Other.SpecialGoal = None;

	MyLift.HandleDoor(Other);
	MyLift.RecommendedTrigger = None;

	if ( (Other.SpecialGoal == MyLift) || (Other.SpecialGoal == None) )
		Other.SpecialGoal = self;

	return Other.SpecialGoal;
}

// LiftCenter can only be bound with matching LiftExit.
function PathBuildingType EdPathBuildExec( NavigationPoint End, out int ForcedDistance )
{
	if( LiftExit(End)!=None && LiftExit(End).LiftTag==LiftTag && End.CanBindWith(Self) )
	{
		ForcedDistance = 500;
		return PATHING_Special;
	}
	return PATHING_Proscribe;
}

// LiftCenter accepts no path requests.
function bool CanBindWith( NavigationPoint Start )
{
	return false;
}

defaultproperties
{
				ExtraCost=400
				bNoStrafeTo=True
				ForcedPathSize=60
				bStatic=False
				bNoDelete=True
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: zo 11-11-2012 21:10:26.000 - Creation time: zo 11-11-2012 21:14:19.084 - Created with UnCodeX