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
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
//=============================================================================
// LiftCenter.
// Used to support AI navigation on lifts.
// should be placed in the center of the navigable lift surface.
// Used in conjunction with LiftExits
// Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
//=============================================================================
class LiftCenter extends NavigationPoint
	placeable
	native;

var		InterpActor		MyLift;
var		float			MaxDist2D;
var		vector			LiftOffset;		// starting vector between MyLift location and LiftCenter location
var		bool			bJumpLift;
var		float			CollisionHeight;
/** if specified, must touch this to start the lift */
var() Trigger LiftTrigger;

// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)

event PostBeginPlay()
{
	Super.PostBeginPlay();

	if (Base == MyLift && MyLift != None)
	{
		LiftOffset = Location - MyLift.Location;
		MyLift.bIsLift = true;
	}
}

/** 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
Here, we check if the mover needs to be triggered
*/
event Actor SpecialHandling(Pawn Other)
{
	// if no lift, no trigger, or trigger already hit, no special handling
	if (MyLift == None || LiftTrigger == None || LiftTrigger.bRecentlyTriggered)
	{
		return self;
	}
	else
	{
		return LiftTrigger;
	}
}

/*
Check if mover is positioned to allow Pawn to get on
*/
event bool SuggestMovePreparation(Pawn Other)
{
	// if already on lift, no problem
	if ( Other.base == MyLift )
		return false;

	// make sure LiftCenter is correctly positioned on the lift
	if ( (Base != MyLift) || (Location != MyLift.Location + LiftOffset) )
	{
		SetLocation(MyLift.Location + LiftOffset);
		SetBase(MyLift);
	}

	// if mover is moving, wait
	if (!IsZero(MyLift.velocity) || !ProceedWithMove(Other))
	{
		Other.Controller.WaitForMover(MyLift);
		return true;
	}

	return false;
}

function bool ProceedWithMove(Pawn Other)
{
	// see if mover is at appropriate location
	if ( Other.Controller == None )
		return false;
	else if ( (LiftExit(Other.Controller.MoveTarget) != None) && Other.ReachedDestination(self) )
		return LiftExit(Other.Controller.MoveTarget).CanBeReachedFromLiftBy(Other);
	else
	{
		//check distance directly - make sure close
		if ( (Location.Z - CollisionHeight < Other.Location.Z - Other.GetCollisionHeight() + Other.MAXSTEPHEIGHT + 2.0)
			&& (Location.Z - CollisionHeight > Other.Location.Z - Other.GetCollisionHeight() - 1200)
			&& (VSize2D(Location - Other.Location) < MaxDist2D || (IsZero(MyLift.Velocity) && Other.ValidAnchor() && LiftExit(Other.Anchor) != None)) )
		{
			return true;
		}
	}

	// if we need to hit the trigger, go do that
	if (LiftTrigger != None && !LiftTrigger.bRecentlyTriggered && IsZero(MyLift.Velocity))
	{
		Other.SetMoveTarget(LiftTrigger);
		return true;
	}

	return false;
}

defaultproperties
{
   MaxDist2D=400.000000
   CollisionHeight=50.000000
   bNeverUseStrafing=True
   bForceNoStrafing=True
   bSpecialMove=True
   bNoAutoConnect=True
   ExtraCost=400
   Begin Object Class=CylinderComponent Name=CollisionCylinder ObjName=CollisionCylinder Archetype=CylinderComponent'Engine.Default__NavigationPoint:CollisionCylinder'
      ObjectArchetype=CylinderComponent'Engine.Default__NavigationPoint:CollisionCylinder'
   End Object
   CylinderComponent=CollisionCylinder
   Begin Object Class=SpriteComponent Name=Sprite ObjName=Sprite Archetype=SpriteComponent'Engine.Default__NavigationPoint:Sprite'
      Sprite=Texture2D'EngineResources.lift_center'
      ObjectArchetype=SpriteComponent'Engine.Default__NavigationPoint:Sprite'
   End Object
   GoodSprite=Sprite
   Begin Object Class=SpriteComponent Name=Sprite2 ObjName=Sprite2 Archetype=SpriteComponent'Engine.Default__NavigationPoint:Sprite2'
      ObjectArchetype=SpriteComponent'Engine.Default__NavigationPoint:Sprite2'
   End Object
   BadSprite=Sprite2
   Components(0)=Sprite
   Components(1)=Sprite2
   Begin Object Class=ArrowComponent Name=Arrow ObjName=Arrow Archetype=ArrowComponent'Engine.Default__NavigationPoint:Arrow'
      ObjectArchetype=ArrowComponent'Engine.Default__NavigationPoint:Arrow'
   End Object
   Components(2)=Arrow
   Components(3)=CollisionCylinder
   Begin Object Class=PathRenderingComponent Name=PathRenderer ObjName=PathRenderer Archetype=PathRenderingComponent'Engine.Default__NavigationPoint:PathRenderer'
      ObjectArchetype=PathRenderingComponent'Engine.Default__NavigationPoint:PathRenderer'
   End Object
   Components(4)=PathRenderer
   bStatic=False
   CollisionComponent=CollisionCylinder
   CollisionType=COLLIDE_CustomDefault
   Name="Default__LiftCenter"
   ObjectArchetype=NavigationPoint'Engine.Default__NavigationPoint'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: tr 31-1-2018 17:17:54.000 - Creation time: sk 18-3-2018 10:01:09.701 - Created with UnCodeX