How to identify a kill?

nik

L12: Fabulous Member
Aug 14, 2009
987
564
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
 

Penguin

Clinically Diagnosed with Small Mapper's Syndrome
aa
May 21, 2009
2,039
1,484
Two gigantic trigger_multiple over the entire map.

Each has a teamfilter.

OnEndTouch, trigger whatever.
 

nik

L12: Fabulous Member
Aug 14, 2009
987
564
Two gigantic trigger_multiple over the entire map.

Each has a teamfilter.

OnEndTouch, trigger whatever.

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:

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
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.
 

nik

L12: Fabulous Member
Aug 14, 2009
987
564
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.

Alright, this could work, but the team changes are unfortunate..

thank you
 

Washipato

L3: Member
Jun 22, 2009
149
331
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
 
Last edited:

l3eeron

L8: Fancy Shmancy Member
Jan 4, 2008
593
88
hey cool, I love this kind of stuff, thanks.
 

nik

L12: Fabulous Member
Aug 14, 2009
987
564
Holy cow, thanks alot washi

this was exactly what I was looking for!