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

  1. class ACTION_PlayMusic extends ScriptedAction;
  2.  
  3. var(Action) string                Song;
  4. var(Action) Actor.EMusicTransition    Transition;
  5. var(Action) bool                bAffectAllPlayers;
  6.  
  7. function bool InitActionFor(ScriptedController C)
  8. {
  9.     local PlayerController P;
  10.     local Controller A;
  11.  
  12.     if( bAffectAllPlayers )
  13.     {
  14.         For ( A=C.Level.ControllerList; A!=None; A=A.nextController )
  15.             if ( A.IsA('PlayerController') )
  16.                 PlayerController(A).ClientSetMusic( Song, Transition );
  17.     }
  18.     else
  19.     {
  20.         // Only affect the one player.
  21.         P = PlayerController(C.GetInstigator().Controller);
  22.         if( P==None )
  23.             return false;
  24.             
  25.         // Go to music.
  26.         P.ClientSetMusic( Song, Transition );
  27.     }    
  28.     return false;    
  29. }
  30.  
  31. function string GetActionString()
  32. {
  33.     return ActionString@Song;
  34. }
  35.  
  36. defaultproperties
  37. {
  38.      Transition=MTRAN_Fade
  39.      bAffectAllPlayers=True
  40.      ActionString="play song"
  41. }