Headshot counter

Hectormd

L1: Registered
May 18, 2012
7
0
Hi there =) I'm new to this hammer thing, I've read quite a bit about it, I would like to contribute this cool sniper training map I am making, but I'd like to add some counters so you could be able to track your progress, I might add that awesome Engineer's Counter from washipato but I can't find the right way to do this, my help request if you could help me please would be the following:

Count headshots
Count shots fired
Count damage

If this is not possible, does anybody have some source I could read so I could get the game output? like... some kind of programming geek stuff to interact from let's say a logical entity which I could program to count headshots and pretty much anythig I'd want since I would be able to read the tf2 outputs and stuff.

I would like to be able to do something like the following:

Somehow read from the game that: a headshot was performed or a shot was fired > pass this info to a logical entity > Show this info in-game > Keep track of your stats per session / per day etc. so you can compare and examine your progress

ANY help will be highly appreciated

HINT: I know this info is written to: C:\Program Files (x86)\Steam\steamapps\<account name>\team fortress 2\tf\tf2_playerstats.dmx
Therefore there must be someway to "hijack" the source that feeds the info to this file.

HINT 2: anybody knows how those sniper maps where only headshots are allowed work?

THANKS!!!!!

Edit: Lazy way around I just thought of for counting headshots:
*Turn crits off
*Add a damage filter for crits
*Count Crits as headshots
 
Last edited:

Hectormd

L1: Registered
May 18, 2012
7
0
Hmm hmm... I'll have to poke around with some ideas. I'm not confident enough either way to say yes or no.

Thanks :D
Any help is highly appreciated, :) tbh I wouldn't know the "clean" way to do either of these counters, all I can think of is some ideas like the one I did write in the "edit".
I know the game has the exact information, the headshots, the shots fired etc, everything, all of it is written in that tf2stats file I posted, but I wouldn't know how to access to it to use in my training map
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
Well yes, but that's the problem. None of that information is going to be accessible to the map without a plugin. Anything will be entirely in-map and there won't be any way to carry it across sessions.
 

Hectormd

L1: Registered
May 18, 2012
7
0
Well yes, but that's the problem. None of that information is going to be accessible to the map without a plugin. Anything will be entirely in-map and there won't be any way to carry it across sessions.
A plugin such as this one: http://forums.alliedmods.net/showthread.php?t=109006 ?
I would like to do this as simple as posible whenever I'm distributing the map, I'd like to include everything inside just the map, so this would be a bit hard I guess :confused:
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
Not really, no. That is an independent full stat tracker. I mean a custom plugin that would interface with the map entities. But in either cause, it requires SourceMod and all the stuff setup, which isn't going to happen with a custom map. It is server-side stuff.

I also looked into a few ideas I had for doing it within the map, however the player entity doesn't have any of the necessary outputs for where my idea was headed, so I think this is pretty much impossible without the aforementioned server stuff.
 

Hectormd

L1: Registered
May 18, 2012
7
0
Not really, no. That is an independent full stat tracker. I mean a custom plugin that would interface with the map entities. But in either cause, it requires SourceMod and all the stuff setup, which isn't going to happen with a custom map. It is server-side stuff.

I also looked into a few ideas I had for doing it within the map, however the player entity doesn't have any of the necessary outputs for where my idea was headed, so I think this is pretty much impossible without the aforementioned server stuff.

Dang :eek:hmy: sad face :(
If you, the almighty developer of the Ultimate Mapping Resource Pack says it can't be done... :confused:
Then I'll have to find a way around it, I was thinking about...
Crit hits will be counted as headshots
Non-crit hits will be counted as missed shots

Hey mate, thanks a lot for your help, I would appreciatte if you could help me or point me somewhere I could learn to use the damage filters, cause I just don't get it :confused: and I can't find anywhere info about it.
I've seen a lot of CSS tutorials on how to use them, but kinda do not work for TF2, please, how do you use the damage filters on TF2?
 
Last edited:

JustAHorrible

L2: Junior Member
May 5, 2012
68
4
Headshot counters are impossible.

But guess what?

If you take a look in tr_walkway, you realize you can count the number of bots you killed in your training. It can also send outputs if it reaches a certain number. (There was an easter egg where you had to kill 200 bots [I did this with a sentry gun] in order to fall in a very, very, very secret room, which I won't tell you, because I want you to see it.) So you could decompile that map and check it out.
 

MarcoPixel

L1: Registered
Apr 22, 2012
33
54
Headshot counters are impossible.

But guess what?

If you take a look in tr_walkway, you realize you can count the number of bots you killed in your training. It can also send outputs if it reaches a certain number. (There was an easter egg where you had to kill 200 bots [I did this with a sentry gun] in order to fall in a very, very, very secret room, which I won't tell you, because I want you to see it.) So you could decompile that map and check it out.

Hoovy wants his 200 kills.