• 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.

[Trigger] Double- Triple- and Multikill

Status
Not open for further replies.
Have a timer that refreshes every X seconds, and add a kill trigger that adds up kills.

Once the timer is run, display the kill type.

example..

  • setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set killtypes[2] = Double Kill
      • Set killtypes[3] = Multikill
  • kill
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set kills[(Player number of (Owner of (Killing unit)))] = (kills[(Player number of (Owner of (Killing unit)))] + 1)
  • Untitled Trigger 001
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • kills[(Integer A)] Greater than 1
            • Then - Actions
              • Game - Display to (All players) the text: ((Name of (Player((Integer A)))) + ( recieved a + killtypes[(Integer A)]))
            • Else - Actions
 
Level 4
Joined
Oct 29, 2008
Messages
65
Well, the OP wanted it after X amount of seconds.

Ah. Good point. But the way you did it would make it an inconsistent amount of time. He can add a wait in the second trigger... but then it would mess up multiple instances.

I don't see why he would want to wait to begin with. I think you and I can agree that it would make more sense to display the kill event immediately.
 
Level 27
Joined
Sep 24, 2006
Messages
4,981
I think it's the same idea as i had only then you're doing it a bit different.

You could make a variable ''multikill'' and then set it to the amount of kills the player has within a short period of time, when he does meet the requirements (so if the variable is 2 or 3) you display double/tripple kill. When he does not meet the requirements you just reset the variable and run the trigger again.

Etc.

Just sharing thoughts btw. =p
 
  • Kill
  • Events
    • Unit - A unit dies
  • Conditions
    • (Triggering Unit) is a hero equal to true
  • Actions
    • Set tplayer = Owner of (Killing Unit)
    • Set tinteger = Player number of tplayer
    • Set MultiKills[tinteger] = Multikills[tinteger] + 1
    • Countdown Timer - Start KillTimer[tinteger] as a one-shot timer that will expire in 2.00 seconds
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • MultiKills[tinteger] equal to 2
      • Then - Actions
        • -------- Double Kill --------
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • MultiKills[tinteger] equal to 3
          • Then - Actions
            • -------- Triple Kill --------
          • Else - Actions
  • Refresh
  • Events
    • Timer - KillTimer[1] expires
    • Timer - KillTimer[2] expires
    • [...]
  • Conditions
  • Actions
    • Set tinteger = 1
    • Custom script: loop
      • Custom script: exitwhen udg_KillTimer[udg_tinteger] == GetExpiredTimer()
      • Set tinteger = tinteger + 1
    • Custom script: endloop
    • set MultiKills[tinteger] = 0
This will count the number of kills. 2 secs after the first kill, the counter will be reseted to 0.

To avoid repeating the second trigger for every player I used those custom scripts. If you don't want them, create one for each player, and leave only the last action (delete the rest), and change tinteger to the player number :p
 
Level 4
Joined
Oct 29, 2008
Messages
65
@Super-Sheep
I brought up that the "Every 2 seconds..." bit would not be consistent. But using Wait is bad too, as multiple instances might not work out well. Or you can use an arrayed timer, but this is pretty lame. Like I said, make it immediate.

And it's rather shameful to ask people for a trigger. Even worse to award reputation to someone who does it.

@Marcelo Hossomi
Wow. Do not ever write a trigger FOR someone. It totally cuts the learning process out.

Sigh... but yes, using a timer would work.
 
Level 4
Joined
Oct 29, 2008
Messages
65
Ehmm what? Take a look at world editor help zone and be amezed. If you have no idea of timers, or variables, how do you help one with saying something. They will learn from examples. Trust me

Oh yeah, I'm fine with examples, but to write the entire damn thing is not good. Not only does the person not learn anything, he will have troubles tweaking it in the future.

And in this case, it seems like the person was being plain lazy.
 
Level 4
Joined
Oct 29, 2008
Messages
65
@Super-Sheep
There is an obvious difference between asking for help and rewarding someone for writing the trigger for you. It is actually more Marcelo Hossomi's problem than yours, but you should not be asking for others to do your work.
 
@ Taishaku
Yes I know, and I also know Super Sheep does know triggering. Showing him the solution is not a problem since he can understand what I did.

He learned, didn't he?

People cannot find all the solutions by themselves. If they have at least tried they have done what they could, and I think Super Sheep had thought about everything that was said before in this thread.

No, I don't care about reps.
 
Status
Not open for further replies.
Top