home *** CD-ROM | disk | FTP | other *** search
/ Unreal Tournament Game Programming for Teens / UnrealTournamentGameProgrammingForTeens.iso / Chapter Files / Chapter09 / DiscoTrigger.txt < prev   
Encoding:
Text File  |  2006-11-02  |  1.2 KB  |  35 lines

  1. //=============================================================================
  2. // DiscoTrigger.
  3. //=============================================================================
  4. class DiscoTrigger extends Triggers placeable;
  5.  
  6. // # 1
  7. // Called when an actor touches a trigger
  8. function Touch( Actor Other )
  9. {
  10.     // # 2
  11.     // Create local storage for an Actor
  12.     local Actor SomeActor;
  13.     local TriggerLight SomeTriggerLight;
  14.  
  15.     // # 3
  16.     // Iterate over all Actors in the level and only care about
  17.     // the ones whose tag is set to the name of this trigger event
  18. // Find everything that is an actor
  19. //
  20. // A dynamic Actor object is one that can change
  21.     // ForEach DynamicActors( class 'Actor', SomeActor, Event)
  22.     // Event is the event that this trigger can process
  23.     // This is set in the Event property of the TriggerLight class
  24.     // This is under Events and is called DiscoLight
  25.     ForEach DynamicActors( class 'TriggerLight', SomeTriggerLight, Event)
  26.         // # 4
  27.         // Trigger this actor
  28.         SomeActor.Trigger(Other, Other.Instigator);
  29.  
  30.     // # 4
  31.     // Note: we do not call Super.Touch(Other) here because we
  32.     // are handling the trigger event ourself and that's all we
  33.     // want to do
  34. }
  35.