XIII
Class CamViewTrigger

source: C:\XIII\XIII\Classes\CamViewTrigger.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Triggers
         |
         +--XIII.XIIITriggers
            |
            +--XIII.CamViewTrigger
Direct Known Subclasses:None

class CamViewTrigger
extends XIII.XIIITriggers

//----------------------------------------------------------- // //-----------------------------------------------------------
Variables
 float FOVToUse
 Actor ObjectTofollow
 bool bHighDetail
 bLookedAt, bOn


Function Summary
 void Go(Actor other)
     
//_____________________________________________________________________________
 void LookedAt(Actor other)
     
//_____________________________________________________________________________
 void PlayerTrigger(Actor Other, Pawn EventInstigator)
     
//____________________________________________________________________
 void UnLookedAt(Actor other)
     
//_____________________________________________________________________________



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class CamViewTrigger extends XIIITriggers;
00005	
00006	var() actor ObjectTofollow;
00007	var() float FOVToUse;
00008	var bool bTouched, bLookedAt, bOn;
00009	var bool bHighDetail;
00010	
00011	//____________________________________________________________________
00012	event PostBeginPlay()
00013	{
00014	    Super.PostBeginPlay();
00015	    bHighDetail = ( (Level.Game != none) && (Level.Game.DetailLevel > 1) );
00016	}
00017	
00018	//____________________________________________________________________
00019	function PlayerTrigger( actor Other, pawn EventInstigator )
00020	{
00021	    if ( !bHighDetail )
00022	      XIIIPlayerController(Other).SetCamView(ObjectTofollow, FOVToUse);
00023	}
00024	
00025	//_____________________________________________________________________________
00026	function UnLookedAt(actor other)
00027	{
00028	    if ( !bHighDetail )
00029	      return;
00030	
00031	    if ( bOn )
00032	    {
00033	      Pawn(other).StopSound(XIIIPlayerController(Pawn(Other).controller).hCamViewInUseSound);
00034	      Pawn(other).Playsound(XIIIPlayerController(Pawn(Other).controller).hCamViewBeginUseSound);
00035	      bOn = false;
00036	    }
00037	
00038	    XIIIPlayerController(Pawn(Other).controller).CamViewMode = 0;
00039	    bLookedAt = false;
00040	}
00041	
00042	//_____________________________________________________________________________
00043	function LookedAt(actor other)
00044	{
00045	    if ( !bHighDetail )
00046	      return;
00047	    if ( bTouched )
00048	      Go(other);
00049	    bLookedAt = True;
00050	}
00051	
00052	//_____________________________________________________________________________
00053	event Touch(Actor other)
00054	{
00055	    if ( !bHighDetail )
00056	      return;
00057	    if ( bLookedAt )
00058	      Go(other);
00059	    bTouched = true;
00060	}
00061	
00062	//_____________________________________________________________________________
00063	function Go(actor other)
00064	{
00065	    if ( !bHighDetail )
00066	      return;
00067	    if ( !bOn )
00068	    {
00069	      Pawn(Other).Playsound(XIIIPlayerController(Pawn(Other).controller).hCamViewBeginUseSound);
00070	      Pawn(Other).Playsound(XIIIPlayerController(Pawn(Other).controller).hCamViewInUseSound);
00071	      bOn = true;
00072	    }
00073	    XIIIPlayerController(Pawn(Other).controller).CamViewMode = 1;
00074	    XIIIPlayerController(Pawn(Other).controller).SetCamViewPortal(objectToFollow, FOVToUse);
00075	}
00076	
00077	//_____________________________________________________________________________
00078	event Untouch(Actor other)
00079	{
00080	    if ( !bHighDetail )
00081	      return;
00082	
00083	    if ( bOn )
00084	    {
00085	      Pawn(other).StopSound(XIIIPlayerController(Pawn(Other).controller).hCamViewInUseSound);
00086	      Pawn(other).Playsound(XIIIPlayerController(Pawn(Other).controller).hCamViewBeginUseSound);
00087	      bOn = false;
00088	    }
00089	
00090	    XIIIPlayerController(Pawn(Other).controller).CamViewMode = 0;
00091	    bTouched=false;
00092	    bLookedAt=false;
00093	}
00094	
00095	
00096	defaultproperties
00097	{
00098	     bCanBeLocked=True
00099	     bInteractive=True
00100	}

End Source Code