• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Music playlist system and timers?

Status
Not open for further replies.
Level 12
Joined
May 9, 2009
Messages
735
Hello, I am trying to make a music playlist system. I want to use some of the better warcraft 3 themes (such as sad mystery, heroic victory etc.) and play them in a loop.

I divided 13 tracks into 4 categories. Every category is played in order but the starting track of every track is chosen randomly.

The problem is is that I tried using timers. I mean real timers, the ones actually called timers and not the makeshift ones tinkered together with a periodic event.

This is how the triggers looks like:

  • Kickstarter
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start MusicTimerA as a One-shot timer that will expire in 1.00 seconds
  • Starting music
    • Events
      • Time - MusicTimerA expires
    • Conditions
    • Actions
      • Set AAARollMusic = (Random integer number between 1 and 3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AAARollMusic Equal to 1
        • Then - Actions
          • Sound - Play Arthas' Theme
          • Countdown Timer - Start MusicTimerA as a One-shot timer that will expire in 123.00 seconds
          • Trigger - Turn on Blood theme <gen>
          • Set MusicTicker = 1
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AAARollMusic Equal to 2
            • Then - Actions
              • Sound - Play Blood Elf Theme
              • Countdown Timer - Start MusicTimerA as a One-shot timer that will expire in 144.00 seconds
              • Trigger - Turn on Comradeship theme <gen>
              • Set MusicTicker = 1
              • Trigger - Turn off (This trigger)
            • Else - Actions
              • Sound - Play Comradeship
              • Countdown Timer - Start MusicTimerA as a One-shot timer that will expire in 124.00 seconds
              • Trigger - Turn on Arthas theme <gen>
              • Set MusicTicker = 1
              • Trigger - Turn off (This trigger)
  • Arthas theme
    • Events
      • Time - MusicTimerA expires
    • Conditions
    • Actions
      • Sound - Play Arthas' Theme
      • Countdown Timer - Start MusicTimerA as a One-shot timer that will expire in 123.00 seconds
      • Set MusicTicker = (MusicTicker + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MusicTicker Equal to 3
        • Then - Actions
          • Trigger - Turn on Developing music <gen>
        • Else - Actions
          • Trigger - Turn on Blood theme <gen>
      • Trigger - Turn off (This trigger)
The "arthas theme" type of trigger is repeated for every music theme while the "starting music" type of trigger is repeated for every music category. The music ticker variable is used to determine that only 3 tracks of each category are played (or 2 if the category has only 2 as opposed to 3). The issue I have is that although I restart the timer everytime every single trigger always treats it as if it is always expired no matter what. This results in the music playing but in a completely random order. There is no telling what theme comes up first and sometimes they get repeated.

I am hoping there is a simple solution to this. All I want is a functioning music playlist :(
 
Status
Not open for further replies.
Top