• 🏆 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!

[Solved] Sound Trigger to Restart if Unit Dies?

Status
Not open for further replies.
Level 2
Joined
Jan 27, 2013
Messages
15
So pretty much what this trigger does is... plays a sound based on if the unit has killed 3-12 kills in a row. How can I make the trigger restart for when the unit dies?

Pretend the archer gets 3 kills in a row, it will make the sound killing spree and show the text, but when the unit dies this archer when he gets a kill will get the sound "Megakill" aka "4 kills in a row". How do I restart this when this unit dies?

  • sounds
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is in (Units of type Dark Archer)) Equal to True
      • ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • Set Combo[(Player number of (Owner of (Killing unit)))] = Combo[(Player number of (Owner of (Killing unit)))]
      • Set PlayerNumber = (Player number of (Owner of (Killing unit)))
      • Set Combo[PlayerNumber] = (Combo[PlayerNumber] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo[PlayerNumber] Equal to 3
        • Then - Actions
          • Game - Display to (All players) the text: ((PlayerColors[PlayerNumber] + (Name of (Player(PlayerNumber)))) + (|r killed + (PlayerColors[(Player number of (Owner of (Dying unit)))] + ((Name of (Owner of (Dying unit))) + |r is on a KILLING SPREEEEE!!!))))
          • Sound - Play killingspree <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo[PlayerNumber] Equal to 4
        • Then - Actions
          • Game - Display to (All players) the text: ((PlayerColors[PlayerNumber] + (Name of (Player(PlayerNumber)))) + |r has killed another bitch for the KILLING SPREE!)
          • Sound - Play megakill <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo[PlayerNumber] Equal to 5
        • Then - Actions
          • Game - Display to (All players) the text: ((PlayerColors[PlayerNumber] + (Name of (Player(PlayerNumber)))) + |r RAMPAGE! 5 KILL STREAK!)
          • Sound - Play rampage <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo[PlayerNumber] Equal to 6
        • Then - Actions
          • Game - Display to (All players) the text: ((PlayerColors[PlayerNumber] + (Name of (Player(PlayerNumber)))) + |r OWNAGE!!!!)
          • Sound - Play ownage <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo[PlayerNumber] Equal to 7
        • Then - Actions
          • Game - Display to (All players) the text: ((PlayerColors[PlayerNumber] + (Name of (Player(PlayerNumber)))) + |r IS GOING HAAAAM WITH THE ULTRA KILL!!!)
          • Sound - Play ultrakill <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo[PlayerNumber] Equal to 8
        • Then - Actions
          • Game - Display to (All players) the text: ((PlayerColors[PlayerNumber] + (Name of (Player(PlayerNumber)))) + (|r just took a shit on + (PlayerColors[(Player number of (Owner of (Dying unit)))] + ((Name of (Owner of (Dying unit))) + |r...WHAT A MONSTER!))))
          • Sound - Play mmmmmonsterkill <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo[PlayerNumber] Equal to 9
        • Then - Actions
          • Game - Display to (All players) the text: ((PlayerColors[PlayerNumber] + (Name of (Player(PlayerNumber)))) + |r HOLY SHITTT!!!!)
          • Sound - Play holyshit <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo[PlayerNumber] Equal to 10
        • Then - Actions
          • Game - Display to (All players) the text: ((PlayerColors[PlayerNumber] + (Name of (Player(PlayerNumber)))) + |r UNSTOPPABLE! 10 KILL STREAK!)
          • Sound - Play unstoppable <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo[PlayerNumber] Equal to 11
        • Then - Actions
          • Game - Display to (All players) the text: ((PlayerColors[PlayerNumber] + (Name of (Player(PlayerNumber)))) + |r WICKED SICK!!! You can't kill me bitch.)
          • Sound - Play wickedsick <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo[PlayerNumber] Equal to 12
        • Then - Actions
          • Game - Display to (All players) the text: ((PlayerColors[PlayerNumber] + (Name of (Player(PlayerNumber)))) + |r COMBO WHORE! Give up. Now.)
          • Sound - Play combowhore <gen>
        • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Put the sounds and text into arrays and your trigger could look like this:
  • sounds
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is in (Units of type Dark Archer)) Equal to True
      • ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • Combo[(Player number of (Owner of (Dying unit)))] = 0
      • Set PlayerNumber = (Player number of (Owner of (Killing unit)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo[PlayerNumber] Less than 12
        • Then - Actions
          • Set Combo[PlayerNumber] = (Combo[PlayerNumber] + 1)
        • Else
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo[PlayerNumber] Greater than 2
        • Then - Actions
          • Game - Display to (All players) the text: ((PlayerColors[PlayerNumber] + (Name of (Player(PlayerNumber)))) + (|r killed + (PlayerColors[(Player number of (Owner of (Dying unit)))] + ((Name of (Owner of (Dying unit))) + |r + texts[Combo[PlayerNumber]]))))
          • Sound - Play sounds[Combo[PlayerNumber]]
        • Else - Actions
 
Level 2
Joined
Jan 27, 2013
Messages
15
  • Set Combo[(Player number of (Owner of (Dying unit)))] = 0
Add that to the trigger.

Thanks! Wow idk how i didn't think of that.

@ Maker: Well.... it could, but that kinda makes it harder and more complicated than it should be. Setting variable arrays kinda takes awhile.
 
Status
Not open for further replies.
Top