1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

help with a kill counter

Discussion in 'World Editor Help Zone' started by EpiK_Phail, Jan 8, 2010.

  1. EpiK_Phail

    EpiK_Phail

    Joined:
    Jan 23, 2009
    Messages:
    72
    Resources:
    0
    Resources:
    0
    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?
     
  2. bowser499

    bowser499

    Joined:
    Jul 20, 2009
    Messages:
    782
    Resources:
    7
    Tools:
    1
    Maps:
    3
    Spells:
    3
    Resources:
    7
    I can try to help you. Wait, I'll be back with this triggers...
    Btw, say me is the only leader will receive #, or all the players?
     
  3. .Talon

    .Talon

    Joined:
    Aug 30, 2009
    Messages:
    68
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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)
     
  4. ClanOOKARep

    ClanOOKARep

    Joined:
    Apr 14, 2009
    Messages:
    117
    Resources:
    0
    Resources:
    0
    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
     
  5. bowser499

    bowser499

    Joined:
    Jul 20, 2009
    Messages:
    782
    Resources:
    7
    Tools:
    1
    Maps:
    3
    Spells:
    3
    Resources:
    7
    .Talon
    Maybe. But maybe he mean that like in my attachment example.
     

    Attached Files:

  6. .Talon

    .Talon

    Joined:
    Aug 30, 2009
    Messages:
    68
    Resources:
    1
    Maps:
    1
    Resources:
    1
    What your triggers do is counting all the kills and add every minute to the name of the one wih the most kills a '#'.
    There are no kills per minute in it...
     
  7. bowser499

    bowser499

    Joined:
    Jul 20, 2009
    Messages:
    782
    Resources:
    7
    Tools:
    1
    Maps:
    3
    Spells:
    3
    Resources:
    7
    .Talon
    That is useful to remember the kills I think. And every minute we can count KPM.
     
  8. EpiK_Phail

    EpiK_Phail

    Joined:
    Jan 23, 2009
    Messages:
    72
    Resources:
    0
    Resources:
    0
    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
     
  9. .Talon

    .Talon

    Joined:
    Aug 30, 2009
    Messages:
    68
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I tested it with just the 3 triggers i posted above and it works perfectly.
    Maybe you use some other triggers that prevent updating or you made another leaderboard after the KPM-board?
     
  10. EpiK_Phail

    EpiK_Phail

    Joined:
    Jan 23, 2009
    Messages:
    72
    Resources:
    0
    Resources:
    0
    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?
     

    Attached Files:

  11. .Talon

    .Talon

    Joined:
    Aug 30, 2009
    Messages:
    68
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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.
     
  12. Hell13east

    Hell13east

    Joined:
    Apr 8, 2008
    Messages:
    88
    Resources:
    0
    Resources:
    0
    Here's a version with a multiboard instead ;) Use it if you want to
     

    Attached Files:

  13. EpiK_Phail

    EpiK_Phail

    Joined:
    Jan 23, 2009
    Messages:
    72
    Resources:
    0
    Resources:
    0
    Thank to both of you for the help, not only with the map but teaching me a few things also + rep to both :)
     
  14. EpiK_Phail

    EpiK_Phail

    Joined:
    Jan 23, 2009
    Messages:
    72
    Resources:
    0
    Resources:
    0
    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: Feb 15, 2010
  15. Maximilianx

    Maximilianx

    Joined:
    Oct 14, 2008
    Messages:
    334
    Resources:
    0
    Resources:
    0
    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?
     
  16. EpiK_Phail

    EpiK_Phail

    Joined:
    Jan 23, 2009
    Messages:
    72
    Resources:
    0
    Resources:
    0
    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: Feb 15, 2010
  17. EpiK_Phail

    EpiK_Phail

    Joined:
    Jan 23, 2009
    Messages:
    72
    Resources:
    0
    Resources:
    0
    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 : /
     
  18. EpiK_Phail

    EpiK_Phail

    Joined:
    Jan 23, 2009
    Messages:
    72
    Resources:
    0
    Resources:
    0
    Ok guys Problem solved and thanks for all the help with the multiboard and other stuff