• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Sound when on low health

Status
Not open for further replies.
Is there a way to add a sound when my character in wc3 is on low health externally?
There's two kinds of sounds, 3D sounds which play from a point/unit and can only be heard when your camera is near them, and non-3D which play universally. I assumed you wanted a universal sound which can be heard by everyone since that's the default behavior (you need to use some tricks to play a sound for a single player):
  • Set Low Life Unit
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set Variable LowLifeUnit = Paladin 0000 <gen>
  • Play Low Life Sound
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (LowLifeUnit is alive) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of LowLifeUnit) Less than or equal to 25.00
              • LowLifeSoundIsOn Equal to False
            • Then - Actions
              • Set Variable LowLifeSoundIsOn = True
              • Sound - Play LowLifeLoop <gen>
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LowLifeSoundIsOn Equal to True
                  • (Percentage life of LowLifeUnit) Greater than 25.00
                • Then - Actions
                  • Set Variable LowLifeSoundIsOn = False
                  • Sound - Stop LowLifeLoop <gen> After fading
                • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LowLifeSoundIsOn Equal to True
            • Then - Actions
              • Set Variable LowLifeSoundIsOn = False
              • Sound - Stop LowLifeLoop <gen> After fading
            • Else - Actions
This value is the percentage of life that is considered "low life":
  • (Percentage life of LowLifeUnit) Less than or equal to 25.00
I'm using 25.00 which is equal to 25%. You can see it being referenced twice so make sure you update both of those values if you decide to change it.
 

Attachments

Last edited:
There's two kinds of sounds, 3D sounds which play from a point/unit and can only be heard when your camera is near them, and non-3D which play universally. I assumed you wanted a universal sound which can be heard by everyone since that's the default behavior (you need to use some tricks to play a sound for a single player):
  • Set Low Life Unit
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set Variable LowLifeUnit = Paladin 0000 <gen>
  • Play Low Life Sound
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (LowLifeUnit is alive) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of LowLifeUnit) Less than or equal to 25.00
              • LowLifeSoundIsOn Equal to False
            • Then - Actions
              • Set Variable LowLifeSoundIsOn = True
              • Sound - Play LowLifeLoop <gen>
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LowLifeSoundIsOn Equal to True
                  • (Percentage life of LowLifeUnit) Greater than 25.00
                • Then - Actions
                  • Set Variable LowLifeSoundIsOn = False
                  • Sound - Stop LowLifeLoop <gen> After fading
                • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LowLifeSoundIsOn Equal to True
            • Then - Actions
              • Set Variable LowLifeSoundIsOn = False
              • Sound - Stop LowLifeLoop <gen> After fading
            • Else - Actions
This value is the percentage of life that is considered "low life":
  • (Percentage life of LowLifeUnit) Less than or equal to 25.00
I'm using 25.00 which is equal to 25%. You can see it being referenced twice so make sure you update both of those values if you decide to change it.
Thank you for your input. I realize that I didn't provide enough details initially. I'm currently playing a mod, and I'm interested in knowing if there's a method to trigger a sound notification when I'm alt-tabbed and my character's health is low.
 
Status
Not open for further replies.
Back
Top