Advertisement
FtDLulz

Halo CE .hsc Music System

Sep 24th, 2019
636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.97 KB | None | 0 0
  1. ;< Music Control
  2. ; Set musicID to a valid ID to stop the last music and start the new music - set it to -1 to stop the music.
  3. (global short musicID -1)
  4. (global short ~cachedMusicID -1)
  5. (global looping_sound ~musicLoopingSound levels\b40\music\b40_03)
  6. (script static looping_sound MusicIDToLoopingSound ;; Why can't I just return the value by itself? hsc plz
  7.     (cond
  8.         ((= 0 ~cachedMusicID)
  9.             (set ~musicLoopingSound levels\b40\music\b40_07)
  10.         )
  11.         ((= 1 ~cachedMusicID)
  12.             (set ~musicLoopingSound levels\b40\music\b40_03)
  13.         )
  14.         ((= 2 ~cachedMusicID)
  15.             (set ~musicLoopingSound levels\b40\music\b40_06)
  16.         )
  17.     )
  18.     ~musicLoopingSound
  19. )
  20.  
  21. (script continuous ~ChangeMusic
  22.     (sleep_until (!= musicID ~cachedMusicID))
  23.     (sound_looping_stop (MusicIDToLoopingSound))
  24.     (set ~cachedMusicID musicID)
  25.     (if (>= ~cachedMusicID 0)
  26.         (begin
  27.             (sound_looping_predict (MusicIDToLoopingSound))
  28.             (sleep 30)
  29.             (sound_looping_start (MusicIDToLoopingSound) none 1.0)
  30.         )
  31.     )
  32. )
  33. ;>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement