Overview | Package | Class | Source | Class tree | Glossary | Deus Ex UnrealScript Documentation |
previous class next class | frames no frames |
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 |
//============================================================================= // 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) var() float MaxDist2D; var vector LiftOffset; function PostBeginPlay() { if ( LiftTag != '' ) ForEach AllActors(class'Mover', MyLift, LiftTag ) { MyLift.myMarker = self; SetBase(MyLift); LiftOffset = Location - MyLift.Location; if ( MyLift.InitialState == 'BumpOpenTimed' ) log("Warning: "$MyLift$" is BumpOpenTimed. Bots don't understand this well - use StandOpenTimed instead!"); 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; local NavigationPoint N, Exit; 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; } SetLocation(MyLift.Location + LiftOffset); SetBase(MyLift); 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 < MaxDist2D * MaxDist2D) ) { return self; } if ( MyLift.BumpType == BT_PlayerBump && !Other.bIsPlayer ) return None; Other.SpecialGoal = None; // make sure Other is at valid lift exit if ( LiftExit(Other.MoveTarget) == None ) { for ( N=Level.NavigationPointList; N!=None; N=N.NextNavigationPoint ) if ( N.IsA('LiftExit') && (LiftExit(N).LiftTag == LiftTag) && (Abs(Other.Location.X - N.Location.X) < Other.CollisionRadius) && (Abs(Other.Location.Y - N.Location.Y) < Other.CollisionRadius) && (Abs(Other.Location.Z - N.Location.Z) < Other.CollisionHeight) ) { Exit = N; break; } if ( Exit == None ) return self; } MyLift.HandleDoor(Other); MyLift.RecommendedTrigger = None; if ( (Other.SpecialGoal == MyLift) || (Other.SpecialGoal == None) ) Other.SpecialGoal = self; return Other.SpecialGoal; } defaultproperties { MaxDist2D=400.000000 ExtraCost=400 bStatic=False bNoDelete=True RemoteRole=ROLE_None } |
Overview | Package | Class | Source | Class tree | Glossary | Deus Ex UnrealScript Documentation |
previous class next class | frames no frames |