• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Stopping music when battle ends

Status
Not open for further replies.
Level 7
Joined
Aug 17, 2012
Messages
256
So yeah apocalypse helped me with this trigger (thanks to him/her) and now i want to know is there a way to make it like:
the music starts to play when hero(es) enter in battle (already done), but the music theme stops when the attacker enemy dies.

(trigger he/she helped me with:D)
  • Actions
    • Set randInt = (Random integer number between 1 and 3)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • randInt Equal to 1
      • Then - Actions
        • Sound - Play Tension <gen>
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • randInt Equal to 2
          • Then - Actions
            • Sound - Play TragicConfrontation <gen>
          • Else - Actions
            • Sound - Play War2IntroMusic <gen>
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
How do you define a battle has "ended" ?
At the "battle ends" event, just turn off the music
  • Sound - Stop music Immediately
And when you encounter enemy unit in "battle starts" event, play that random 3 sound again.

I suggest you should use Combat State system, it defines whether you're in a combat or not by setting some algorithm.
At the "out of combat" event, turn off music.
At the "enter combat" event, play music(s).
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
@Starquizer: thats nice and all, but eh i don't get whats that really...:S

Damage Detection Engine is a system made by Bribe. It detects many combat related things that you may need to determine if you are in combat or not. I never use it so I don't know how you could configure it though I tested it and know what it does.

The reason I am suggesting this system to you: you may define In-Combat or Out-Of-Combat state by detecting if there is enemy in your LOS but what if you are invisible and standing near the enemy and not doing anything.
 
Status
Not open for further replies.
Top