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

help with a kill counter

Status
Not open for further replies.
Level 4
Joined
Jan 23, 2009
Messages
74
Hi there, i am currently making a map where there is a set time limit (twenty minutes) and a FFA fight takes place. The person with the most kills per minute should win (as opposed to the most kills).

Here is what i am attempting to do
1) Make a leader board to go the following trigger

2) Create a trigger(s) that:

a) counts the kills per player every 60 seconds, and at the end of the 60 seconds posts the # on the leader board next to the player name.

b) However every time it would post the # on the leader board, it would check to see if the previous count was higher.
If the new # is higher it replaces the old record on the leader board, if it isn't then nothing should change.


Using these triggers i would make it so the winner would be the person with the highest score (# of KPM on leader board).



Does any1 think they can help me with this?
 
Level 4
Joined
Aug 30, 2009
Messages
70
I think this is what you mean:

  • Leaderboard
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled Kills
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Leaderboard - Add (Player((Integer A))) to (Last created leaderboard) with label (Name of (Player((Integer A)))) and value 0
      • Countdown Timer - Start OneMinuteTimer as a Repeating timer that will expire in 60.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Next Count:
      • Countdown Timer - Show (Last created timer window)
      • Game - Display to (All players) the text: The game started!
  • Count
    • Events
      • Time - OneMinuteTimer expires
    • Conditions
    • Actions
      • Game - Display to (All players) the text: One minute expired!
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KillsPerMinute[(Integer A)] Greater than OldKPM[(Integer A)]
            • Then - Actions
              • Leaderboard - Change the value for (Player((Integer A))) in (Last created leaderboard) to KillsPerMinute[(Integer A)]
              • Set OldKPM[(Integer A)] = KillsPerMinute[(Integer A)]
            • Else - Actions
          • Set KillsPerMinute[(Integer A)] = 0
  • Add
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set KillsPerMinute[(Player number of (Owner of (Killing unit)))] = (KillsPerMinute[(Player number of (Owner of (Killing unit)))] + 1)
 
Level 4
Joined
Apr 14, 2009
Messages
118
Im at school right now, so i cant get the exact triggers, but here is something that could help.

Make the kills a variable, if you havnt already.
Then make a seperate trigger thats like:
Every .01 seconds of game time
If Kills = X then....(im at a loss...ill be able to tell more once i get home....)

Edit: i think he solved it so NVM :D
 
Level 4
Joined
Jan 23, 2009
Messages
74
I think this is what you mean:

  • Leaderboard
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled Kills
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Leaderboard - Add (Player((Integer A))) to (Last created leaderboard) with label (Name of (Player((Integer A)))) and value 0
      • Countdown Timer - Start OneMinuteTimer as a Repeating timer that will expire in 60.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Next Count:
      • Countdown Timer - Show (Last created timer window)
      • Game - Display to (All players) the text: The game started!
  • Count
    • Events
      • Time - OneMinuteTimer expires
    • Conditions
    • Actions
      • Game - Display to (All players) the text: One minute expired!
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KillsPerMinute[(Integer A)] Greater than OldKPM[(Integer A)]
            • Then - Actions
              • Leaderboard - Change the value for (Player((Integer A))) in (Last created leaderboard) to KillsPerMinute[(Integer A)]
              • Set OldKPM[(Integer A)] = KillsPerMinute[(Integer A)]
            • Else - Actions
          • Set KillsPerMinute[(Integer A)] = 0
  • Add
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set KillsPerMinute[(Player number of (Owner of (Killing unit)))] = (KillsPerMinute[(Player number of (Owner of (Killing unit)))] + 1)

Thank you for showing me the way, but there one little problem, and that is:
after the timer ends the KPM doesn't update on the leader board

i also tried adjusting adding a delay to resetting the kpm time but that didn't work either
  • Count
    • Events
      • Time - OneMinuteTimer expires
    • Conditions
    • Actions
      • Game - Display to (All players) the text: <>First Phase Passe...
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KPM[(Integer A)] Greater than OldKPM[(Integer A)]
            • Then - Actions
              • Leaderboard - Change the value for (Player((Integer A))) in (Last created leaderboard) to KPM[(Integer A)]
              • Set OldKPM[(Integer A)] = KPM[(Integer A)]
              • Wait 1.00 seconds
              • Set KPM[(Integer A)] = 0
            • Else - Actions
              • Set KPM[(Integer A)] = 0
can any1 think of any ways to fix this issue :)
Then i can than both you (if your not .Talon) and .Talon +rep
 
Level 4
Joined
Jan 23, 2009
Messages
74
I still can't located the source of the problem, i haven't created any other leaderboards and i don't believe the other triggers are getting in the way.

would you mind peeking at this, this map contains all the triggers and # of the map i'm working on (including the one you helped with).

can you see if u can find what i did wrong?
 

Attachments

  • KPMtest.w3x
    18.2 KB · Views: 48
Level 4
Joined
Aug 30, 2009
Messages
70
You used this thing to add KPM:
  • Actions
    • Set KPM[(Player number of (Owner of (Killing unit)))] = KPM[((Player number of (Owner of (Killing unit))) + 1)]
but it should be
  • Actions
    • Set KPM[(Player number of (Owner of (Killing unit)))] = (KPM[(Player number of (Owner of (Killing unit)))] + 1)
You set the +1 into the array so it takes the KPM of the next player and not add 1 to the KPM.
 
Level 4
Joined
Jan 23, 2009
Messages
74
Hi again, i used hell beasts trigger multi board earlier, it worked like a charm, but then a few map updates later, it doesn't display the kpm's of the players in a table. it records them, but does not display, i was wondering if sum1 could diagnose the problem

see map
 
Last edited:
Level 7
Joined
Oct 14, 2008
Messages
340
Wait, the map has a 20 minute time limit, and the person with the highest KPM at the end wins? You do realize that the person who has the highest average kills per minute is the same person who has the most kills?

Or do you mean the person who got the most kills within any given minute?
 
Level 4
Joined
Jan 23, 2009
Messages
74
Or do you mean the person who got the most kills within any given minute?
YEP



oh and also, this one spell(triggered) in my map was working fine until last update, in which all i did was uploaded a model by general frank.
now when the spell is cast it freezes wc3. the spell is called "combat throw"

can someone take a peek at the triggs to find the leak or w/e :)
 
Last edited:
Level 4
Joined
Jan 23, 2009
Messages
74
at 1st i thought the problem was i added 2 targets for the spell, then i realized its bugging on lvl 1, meaning its somehow the trigger, or a leak but i have no clue how to fix it, im gunna try getting rid of the imported models, and see if that works, mean time can somebody peek at the map 4 me, i suck at triggering, and suck more at spotting leaks : /
 
Status
Not open for further replies.
Top