Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation
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

    //=============================================================================
    // LiftCenter.
    //=============================================================================
    class LiftCenter extends NavigationPoint
    	placeable
    	native;

    var() name LiftTag;
    var	 mover MyLift;
    var() name LiftTrigger;
    var trigger RecommendedTrigger;
    var float MaxDist2D;
    var vector LiftOffset;	// starting vector between MyLift location and LiftCenter location

    function PostBeginPlay()
    {
    	if ( LiftTrigger != '' )
    		ForEach DynamicActors(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

    Here, we check if the mover needs to be triggered
    */

    function Actor SpecialHandling(Pawn Other)
    {
    	// if no lift, no special handling
    	if ( MyLift == None )
    		return self;

    	// check whether or not need to trigger the lift
    	if ( !MyLift.IsInState('StandOpenTimed') )
    	{
    		if ( MyLift.bClosed
    			&& (RecommendedTrigger != None) )
    			return RecommendedTrigger;
    	}
    	else if ( MyLift.BumpType == BT_PlayerBump && !Other.IsPlayerPawn() )
    		return None;

    	return self;
    }

    /*
    Check if mover is positioned to allow Pawn to get on
    */
    // DLB Controller clean pass: removed AI logic
    /*function 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
    	SetLocation(MyLift.Location + LiftOffset);
    	SetBase(MyLift);

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

    	return false;
    }*/

    function bool ProceedWithMove(Pawn Other)
    {
    	local LiftExit Start;
    	local float dist2D;
    	local vector dir;

    	// see if mover is at appropriate location/keyframe
    	Start = LiftExit(Other.Anchor);

    	if ( (Start != None) && (Start.KeyFrame != 255) )
    	{
    		if ( MyLift.KeyNum == Start.KeyFrame )
    			return true;
    	}
    	else
    	{
    		//check distance directly - make sure close
    		dir = Location - Other.Location;
    		dir.Z = 0;
    		dist2D = VSize(dir);
    		if ( (Location.Z - CollisionHeight < Other.Location.Z - Other.CollisionHeight + MAXSTEPHEIGHT)
    			&& (Location.Z - CollisionHeight > Other.Location.Z - Other.CollisionHeight - 1200)
    			&& ( dist2D < MaxDist2D) )
    		{
    			return true;
    		}
    	}

    	// if mover not operating, need to start it
    	// DLB Controller clean pass: removed AI logic
    	/*if ( MyLift.bClosed )
    	{
    		Other.SetMoveTarget(SpecialHandling(Other));
    		return true;
    	}*/

    	return false;
    }

    defaultproperties
    {
    	Texture=Texture'Engine_res.S_LiftCenter'
    	RemoteRole=ROLE_None
    	bStatic=false
    	bSpecialMove=true
    	ExtraCost=400
    	MaxDist2D=+400.000
    	bNoAutoConnect=true
    	bNeverUseStrafing=true
    	bForceNoStrafing=true
    }

Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation
previous class next class | frames no frames

Class file time: ne 5.9.2004 16:01:26.000 - Creation time: st 23.5.2018 00:10:45.006 - Created with UnCodeX