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

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