UnrealI
Class CodeTrigger

source: e:\games\UnrealTournament\UnrealI\Classes\CodeTrigger.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Triggers
         |
         +--UnrealI.CodeTrigger
Direct Known Subclasses:None

class CodeTrigger
extends Engine.Triggers

//============================================================================= // CodeTrigger. //=============================================================================
Variables
 int Code
           What is the label code of this trigger/mover with respect to the sequence
 name CodeMasterTag
           The Tag of the codemaster object to use
 CodeMaster cdMaster
           The Tag of the codemaster object to use
 ElevatorMover elMover
           The Tag of the codemaster object to use


Function Summary
 void BeginPlay()
 void Touch(Actor Other)



Source Code


00001	//=============================================================================
00002	// CodeTrigger.
00003	//=============================================================================
00004	class CodeTrigger extends Triggers;
00005	
00006	// Used along with an ElevatorMover (which is its visual cue), it sends
00007	// a code to the CodeMaster object which tries to match up a pattern
00008	// of a set of CodeTrigger activations, whereupon the CodeMaster executes
00009	// a special event.
00010	// If the order of triggerings is invalid, the set of ElevatorMovers are
00011	// reset to the initial state. M
00012	
00013	var() int 	Code;			// What is the label code of this trigger/mover with respect to the sequence
00014	var() name   CodeMasterTag;	// The Tag of the codemaster object to use
00015	
00016	var   CodeMaster 		cdMaster;
00017	var   ElevatorMover  	elMover;
00018	
00019	function BeginPlay()
00020	{
00021		local CodeMaster cm;
00022		local ElevatorMover em;
00023	
00024		// Find the CodeMaster who's Tag matches the CodeMasterTag
00025		if( CodeMasterTag != '' )
00026			foreach AllActors( class 'CodeMaster', cm, CodeMasterTag )
00027				cdMaster = cm;
00028		
00029		// Find the ElevatorMover who's Tag matches this triggers Event
00030		if( Event != '' )
00031			foreach AllActors( class 'ElevatorMover', em, Event )
00032				elMover = em;
00033	
00034		if( cdMaster == None ) log("No CodeMaster object found.");
00035		if( elMover  == None ) log("No ElevatorMover object found.");
00036	}
00037	
00038	function Touch( actor Other )
00039	{
00040		// Set the Elevator Mover to Keyframe 1
00041		elMover.MoveKeyframe( 1, elMover.MoveTime );
00042	
00043		// Notify the CodeMaster that it has been triggered
00044		cdMaster.NotifyTriggered( Code );
00045	}
00046	
00047	defaultproperties
00048	{
00049	}

End Source Code