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

Streak triggering?

Status
Not open for further replies.
Level 5
Joined
Jul 24, 2008
Messages
106
Heya Hive! I'm trying to create a system that does the following:

~ Plays (Sound Effect 1) and displays (Text 1) to all players when the first hero kill in the game occurs
- Plays (Sound Effect 2) and displays (Text 2) to all players when a hero kills 3 other heroes
- Plays (Sound Effect 3) and displays (Text 3) to all players when a hero kills 4 other heroes
- Plays (Sound Effect 4) and displays (Text 4) to all players when a hero kills 5 other heroes

**and so on.. you get the pattern :D
**kills don't necessarily have to be done at the same time, you just have to acquire them
**however, when the hero with X number of hero kills dies, his streak will be reset and has to acquire another 3 kills to start another streak.
**the (~) trigger cannot be repeated in 1 game (activated only once in a whole game)
**the (-) triggers are always active and can be acquired by all players

I know, it's kinda complicated, that's why I need the Hive's help. So, +rep and credits would be given to anyone who could help me and my friends. :D Thanks!
 
Level 4
Joined
Jun 12, 2009
Messages
57
You can use a couple of variables and simple triggers. Here's how it can be done.
  • First kill
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • ((Killing unit) is A Hero) Equal to True
    • Actions
      • Sound - Play (your sound here)
      • Game - Display to (All players) the text: ((Name of (Owner of (Killing unit))) + has the first kill)
      • Trigger - Turn off (This trigger)



  • A hero dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set killingvalue[(Player number of (Owner of (Dying unit)))] = 0
Kill counter
  • Events
    • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Killing unit) is A Hero) Equal to True
        • Then - Actions
          • Set killingvalue[(Player number of (Owner of (Killing unit)))] = (killingvalue[(Player number of (Owner of (Killing unit)))] + 1)
        • Else - Actions


Three kills
  • Events
    • Unit - A unit Dies
    • Conditions
      • ((Killing unit) is A Hero) Equal to True
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • killingvalue[(Player number of (Owner of (Killing unit)))] Equal to 3
        • Then - Actions
          • Sound - Play (your sound here)
          • Game - Display to (All players) the text: ((Name of (Owner of (Killing unit))) + has three kills)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • killingvalue[(Player number of (Owner of (Killing unit)))] Equal to 4
            • Then - Actions
              • Sound - Play (your sound here)
              • Game - Display to (All players) the text: ((Name of (Owner of (Killing unit))) + has fourkills)
            • Else - Actions


For this trigger you can keep following the pattern for how many times you want it to go on for.

I only used one variable and that was killingvalue it was a integer array. The size of it is the number of players in the game
 
Level 12
Joined
Mar 10, 2008
Messages
869
Create a variable integer array and call it whatever you want (E.G. KillStreak)
  • Kill Streak
    • Events
      • Unit - A unit dies
    • Conditions
      • If (killing unit) = a Hero
    • Actions
      • Set KillStreak[Player Number of (Owner of (Killing unit))] = KillStreak[Player Number of (Owner of (Killing Unit))] + 1
  • Lose Kill Streak
    • Events
      • Unit - A unit dies
    • Conditions
      • If (dying unit) = a Hero
    • Actions
      • Set KillStreak[Player Number of (Owner of (dying unit))] = 0
After, add your sound and text triggers with the conditions for the integer being +3
This is all you need.
 
Level 9
Joined
Jun 3, 2009
Messages
486
Just like in DotA, First blood and so on and then if you die you loose your streak, but only one person can get a first blood, and you can only get it once per game

Edit: i will post the trigger to this post when its complete ;)

Edit: alright i have just made a map with the triggers in it, also if you want you can try to add MortAr-s first blood system to mine, and you can edit the sounds and text that is used to whatever you want.
 

Attachments

  • Kill Sound System.w3x
    18.9 KB · Views: 97
Last edited:
Level 5
Joined
Jul 24, 2008
Messages
106
@ Ale_tuskarr, kongfuman, manstie
thanks dudes. I've tried what you told me, and I think it's gonna work. :D

@ SpEtNeZz
thanks, I'll be waiting for it :D
 
Level 19
Joined
Feb 25, 2009
Messages
2,004

  • First Blood
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Dying unit) is A Hero) Equal to True // only for hero
          • (Owner of (Dying unit)) Not equal to (Owner of (Killing unit)) // user not actually killed a teammate
          • First_Blood Equal to False // bolean that works for the FB
          • ((Dying unit) is an illusion) Equal to False // the dying unit for the FB is not an illusion
    • Actions
      • Custom script: call PlaySoundBJ (gg_snd_firstblood) // playing a sound
      • Game - Display to (All players) for 7.00 seconds the text: (|c00797979 + ((Name of (Owner of (Killing unit))) + |rjust drew the |c00FF5E5Efirst-blood|r!)) // text (announce for the kill)
      • Player - Add 250 to (Owner of (Killing unit)) Current gold // bonus gold
      • Player - Add 2 to (Owner of (Killing unit)) Current lumber // bonus lumbers (if used)
      • Set First_Blood = True // fb is done, bolean goes true
      • Trigger - Turn off (This trigger) // trigger goes off now (not neccessary)



  • Kill
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True // again only for Hero
      • (Owner of (Dying unit)) Not equal to (Owner of (Killing unit)) // does not count for team-kill
      • ((Dying unit) is an illusion) Equal to False // does not count for illusions
    • Actions
      • Set Reward_Gold = (Random integer number between 150 and 300) // using a real we set the gold awarded for the kill
      • Game - Display to (Player group((Owner of (Killing unit)))) for 7.00 seconds the text: (|c00FF5E5EYou have killed + ((Name of (Owner of (Dying unit))) + ( for|r |cffffcc00 + ((String(Reward_Gold)) + |r|c00FF5E5E gold!|r)))) // text-display (announce for the KILLER ONLY)
      • Game - Display to (Player group((Owner of (Dying unit)))) for 7.00 seconds the text: (|c00FF5E5E + ((Name of (Owner of (Killing unit))) + has killed you!|r)) // text display (announce for the DEAD HERO PLAYER ONLY)
  • --- 2 texts can always be replaced with only 1 liek in the FB-trigger --
    • Player - Add Reward_Gold to (Owner of (Killing unit)) Current gold // gold reward for killing
    • Player - Add 1 to (Owner of (Killing unit)) Current lumber // lumber (if used)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • KillsInARow[(Player number of (Owner of (Dying unit)))] Greater than or equal to 1 // if the player which Hero dies has a streak it will be gone
      • Then - Actions
        • Set KillsInARow[(Player number of (Owner of (Dying unit)))] = 0
      • Else - Actions
    • Set KillsInARow[(Player number of (Owner of (Killing unit)))] = (KillsInARow[(Player number of (Owner of (Killing unit)))] + 1) // killed gets +1 to its own steak-kills
    • Trigger - Run Kills in a Row <gen> (ignoring conditions) // running other trigger with integer check (Check next trigger in the post)



  • Kills in a Roww
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KillsInARow[(Player number of (Owner of (Killing unit)))] Equal to 3 // if player steak-kills are 3, he enters in a KILLING-SPREE streak
        • Then - Actions
          • Sound - Play Killing_Spree <gen> // playing the sound
          • Game - Display to (All players) for 7.00 seconds the text: ((Name of (Owner of (Killing unit))) + ( killed + ((Name of (Owner of (Dying unit))) + for a killing-spree streak!))) // showing the message
        • Else - Actions

Last trigger does need soo much triggering, because its just a checking trigger.
Increasing the streak number can be done by making the same If/Then/Else function but changing the "KillsInARow[(Player number of (Owner of (Killing unit)))] Equal to 3" can be 4,5,6 or whatever.
But mostly, if you want an unstoppable streak (liek the BEYOND GODLIKE in DotA) the last If/Then/Else function must be liek this:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • KillsInARow[(Player number of (Owner of (Killing unit)))] Greater than or Equal to 10 // if the streak-kills goes to 10 or more, streak continue
    • Then - Actions
      • Sound - Play Killing_Spree <gen> // playing a sound
      • Game - Display to (All players) for 7.00 seconds the text: ((Name of (Owner of (Killing unit))) + ( killed + ((Name of (Owner of (Dying unit))) + for a killing-spree streak!))) // and the text display (announce for streak)
    • Else - Actions


Well, I hope so all the 3 triggers will help, if you have any question, feel free to ask. If you still don't understand the how all the 3 triggers works, I can make a Testmap if you want.

Edit: If you wonder where I got these trigger - its from my old map, I didn't steal it from anywhere and all done by me.
 
Level 9
Joined
Jun 3, 2009
Messages
486

  • First Blood
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Dying unit) is A Hero) Equal to True // only for hero
          • (Owner of (Dying unit)) Not equal to (Owner of (Killing unit)) // user not actually killed a teammate
          • First_Blood Equal to False // bolean that works for the FB
          • ((Dying unit) is an illusion) Equal to False // the dying unit for the FB is not an illusion
    • Actions
      • Custom script: call PlaySoundBJ (gg_snd_firstblood) // playing a sound
      • Game - Display to (All players) for 7.00 seconds the text: (|c00797979 + ((Name of (Owner of (Killing unit))) + |rjust drew the |c00FF5E5Efirst-blood|r!)) // text (announce for the kill)
      • Player - Add 250 to (Owner of (Killing unit)) Current gold // bonus gold
      • Player - Add 2 to (Owner of (Killing unit)) Current lumber // bonus lumbers (if used)
      • Set First_Blood = True // fb is done, bolean goes true
      • Trigger - Turn off (This trigger) // trigger goes off now (not neccessary)



  • Kill
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True // again only for Hero
      • (Owner of (Dying unit)) Not equal to (Owner of (Killing unit)) // does not count for team-kill
      • ((Dying unit) is an illusion) Equal to False // does not count for illusions
    • Actions
      • Set Reward_Gold = (Random integer number between 150 and 300) // using a real we set the gold awarded for the kill
      • Game - Display to (Player group((Owner of (Killing unit)))) for 7.00 seconds the text: (|c00FF5E5EYou have killed + ((Name of (Owner of (Dying unit))) + ( for|r |cffffcc00 + ((String(Reward_Gold)) + |r|c00FF5E5E gold!|r)))) // text-display (announce for the KILLER ONLY)
      • Game - Display to (Player group((Owner of (Dying unit)))) for 7.00 seconds the text: (|c00FF5E5E + ((Name of (Owner of (Killing unit))) + has killed you!|r)) // text display (announce for the DEAD HERO PLAYER ONLY)
  • --- 2 texts can always be replaced with only 1 liek in the FB-trigger --
    • Player - Add Reward_Gold to (Owner of (Killing unit)) Current gold // gold reward for killing
    • Player - Add 1 to (Owner of (Killing unit)) Current lumber // lumber (if used)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • KillsInARow[(Player number of (Owner of (Dying unit)))] Greater than or equal to 1 // if the player which Hero dies has a streak it will be gone
      • Then - Actions
        • Set KillsInARow[(Player number of (Owner of (Dying unit)))] = 0
      • Else - Actions
    • Set KillsInARow[(Player number of (Owner of (Killing unit)))] = (KillsInARow[(Player number of (Owner of (Killing unit)))] + 1) // killed gets +1 to its own steak-kills
    • Trigger - Run Kills in a Row <gen> (ignoring conditions) // running other trigger with integer check (Check next trigger in the post)

Pretty nice system man, check out mine, its 2 posts up ;)
 
Status
Not open for further replies.
Top