How to identify a kill?

Discussion in 'Mapping Questions & Discussion' started by nik, Mar 9, 2010.

  1. nik

    nik L12: Fabulous Member

    Messages:
    987
    Positive Ratings:
    246
    Hi again,

    I was just wondering if it's possible to track when a kill happens, and for which team it is against, that is all. I wanted to do this without the use of a mod of any kind, which would complicate things. If you have any ideas on where to start/tips, they would be very welcome since I have NO idea where to begin with this one.


    thanks
     
  2. Penguin

    aa Penguin Clinically Diagnosed with Small Mapper's Syndrome

    Messages:
    1,993
    Positive Ratings:
    1,237
    Two gigantic trigger_multiple over the entire map.

    Each has a teamfilter.

    OnEndTouch, trigger whatever.
     
    • Thanks Thanks x 2
  3. nik

    nik L12: Fabulous Member

    Messages:
    987
    Positive Ratings:
    246
    this would count suicides/any death not caused by the other team, would it not?

    (wouldn't it also count one for when someone goes into their spawn? If you put it inside the spawn it would count it for when they change classes)
     
    Last edited: Mar 9, 2010
  4. Tehrasha

    Tehrasha L3: Member

    Messages:
    115
    Positive Ratings:
    26
    Simple -and- genius. I would never have thought it would be that easy.
     
  5. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    It does not count class changes, because the player entity never leaves the trigger, your properties are just being altered. It will of course count suicides and team changes, as well as leaving the server.
     
    • Thanks Thanks x 2
  6. nik

    nik L12: Fabulous Member

    Messages:
    987
    Positive Ratings:
    246
    Alright, this could work, but the team changes are unfortunate..

    thank you
     
  7. Washipato

    Washipato L3: Member

    Messages:
    149
    Positive Ratings:
    97
    There is another way to count kills using game events, that doesn't count team changes, suicides and player leaving the server.

    Place a trigger_brush in you map with toolstrigger texture (it can be as small as you want, it only needs to be somewhere) and name it game_playerkill. Then, put one (or two if you are going to count kills for both teams) filter_activator_tfteam.

    The game will trigger the game_playerkill event with the "Use" output every time a player is killed. Having an entity with the same name and a "Use" input will trigger that entity too. Then you can filter the activator to know who killed the player and trigger some event in the map.

    In the trigger_brush, create the following output:
    Code:
    OnUse --> tfactivatorfilterRED --> TestActivator
    OnUse --> tfactivatorfilterBLU --> TestActivator
    and in the filter_activator_tfteam
    Code:
    OnPass --> ACTION
    Only one of the filter will activate (or none if it was suicide). If you want a test map, download this vmf. You will need this prefab to make it work
     
    • Thanks Thanks x 3
    Last edited: Mar 10, 2010
  8. l3eeron

    l3eeron L8: Fancy Shmancy Member

    Messages:
    594
    Positive Ratings:
    86
    hey cool, I love this kind of stuff, thanks.
     
  9. nik

    nik L12: Fabulous Member

    Messages:
    987
    Positive Ratings:
    246
    Holy cow, thanks alot washi

    this was exactly what I was looking for!