home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Gameplay / Classes / MusicEvent.uc < prev    next >
Text File  |  2003-12-11  |  1KB  |  64 lines

  1. //=============================================================================
  2. // MusicEvent.
  3. // OBSOLETE - superceded by ScriptedTrigger
  4. //=============================================================================
  5. class MusicEvent extends Triggers
  6.     notplaceable;
  7.  
  8. // Variables.
  9. var() string           Song;
  10. var() EMusicTransition Transition;
  11. var() bool             bSilence;
  12. var() bool             bOnceOnly;
  13. var() bool             bAffectAllPlayers;
  14.  
  15. // When gameplay starts.
  16. function BeginPlay()
  17. {
  18.     if( Song=="" )
  19.     {
  20.         Song = Level.Song;
  21.     }
  22.     if( bSilence )
  23.     {
  24.     }
  25. }
  26.  
  27. // When triggered.
  28. function Trigger( actor Other, pawn EventInstigator )
  29. {
  30.     local PlayerController P;
  31.     local Controller A;
  32.  
  33.     if( bAffectAllPlayers )
  34.     {
  35.         For ( A=Level.ControllerList; A!=None; A=A.nextController )
  36.             if ( A.IsA('PlayerController') )
  37.                 PlayerController(A).ClientSetMusic( Song, Transition );
  38.     }
  39.     else
  40.     {
  41.         // Only affect the one player.
  42.         P = PlayerController(EventInstigator.Controller);
  43.         if( P==None )
  44.             return;
  45.             
  46.         // Go to music.
  47.         P.ClientSetMusic( Song, Transition );
  48.     }    
  49.  
  50.     // Turn off if once-only.
  51.     if( bOnceOnly )
  52.     {
  53.         SetCollision(false,false,false);
  54.         disable( 'Trigger' );
  55.     }
  56. }
  57.  
  58. defaultproperties
  59. {
  60.      Transition=MTRAN_Fade
  61.      bAffectAllPlayers=True
  62.      bObsolete=true
  63. }
  64.