Overview | Package | Class | Source | Class tree | Glossary | 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 |
//============================================================================= // ElevatorTrigger. //============================================================================= class ElevatorTrigger expands Triggers; // A special trigger devised for the ElevatorMover class, since // detecting one trigger message is not enough to determine 2 or more // different commands (like up/down). When an actor is within its' // radius, it sends a message to the ElevatorMover with the desired // keyframe change and moving time interval. var() int GotoKeyframe; var() float MoveTime; var() bool bTriggerOnceOnly; var() class<actor> ClassProximityType; // Trigger type. var() enum ETriggerType { TT_PlayerProximity, // Trigger is activated by player proximity. TT_PawnProximity, // Trigger is activated by any pawn's proximity TT_ClassProximity, // Trigger is activated by actor of that class only TT_AnyProximity, // Trigger is activated by any actor in proximity. TT_Shoot, // Trigger is activated by player shooting it. } TriggerType; // // See whether the other actor is relevant to this trigger. // final function bool IsRelevant( actor Other ) { switch( TriggerType ) { case TT_PlayerProximity: return Pawn(Other)!=None && Pawn(Other).bIsPlayer; case TT_PawnProximity: return Pawn(Other)!=None && ( Pawn(Other).Intelligence > BRAINS_None ); case TT_ClassProximity: return ClassIsChildOf(Other.Class, ClassProximityType); case TT_AnyProximity: return true; case TT_Shoot: return ( Projectile(Other) != None ); } } // // Called when something touches the trigger. // function Touch( actor Other ) { local ElevatorMover EM; if( IsRelevant( Other ) ) { // Call the ElevatorMover's Move function if( Event != '' ) foreach AllActors( class 'ElevatorMover', EM, Event ) EM.MoveKeyframe( GotoKeyFrame, MoveTime ); if( bTriggerOnceOnly ) // Ignore future touches. SetCollision(False); } } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |