[Snippet] TF2 Damage
Yet another snippet :) I know this has been posted before by naris, but it had all these unnecessary files and stocks, so I made a shorter one a while back (just in case I'd ever need it), and now I'm posting it here :P Enjoy.
Code:
|
Re: [Snippet] TF2 Damage
What about when players pick up med packs or use a resupply cabinet?
|
Re: [Snippet] TF2 Damage
And why should this be limited to TF2 only ? player_hurt and player_spawn are available in all games afaik.
|
Re: [Snippet] TF2 Damage
@bl4nk: good point... You can hook medipacks being picked up, but you can't hook the resupply cabinet being used, so I'm not sure how to do the latter (other than a continuous check). naris' code didn't do this either though did it?
@berni: It's not limited to TF2, the point is that TF2 doesn't send the damage done in the player_hurt event, like most other mods do. This stores their previous health so you can get the damage done. |
Re: [Snippet] TF2 Damage
You could hook the OnEndTouch output of func_regenerate. That might do it for you.
|
Re: [Snippet] TF2 Damage
According to http://developer.valvesoftware.com/wiki/Func_regenerate (and Hammer for that matter) func_regenerate only has the OnUser1-4 outputs, that's the problem :(
|
Re: [Snippet] TF2 Damage
I wouldn't trust the wiki pages too much. Looking at the datamaps, I see the following for func_regenerate:
Code:
- m_OnStartTouch (Save|Key|Output)(0 Bytes) - OnStartTouch |
Re: [Snippet] TF2 Damage
Nope, none of those outputs, nor OnPlayerTouch (which works fine for healthkits), fire for func_regenerate.
|
Re: [Snippet] TF2 Damage
That's odd. Valve confuses me sometimes with why they leave stuff like that in there if it doesn't actually do anything.
|
Re: [Snippet] TF2 Damage
In this case, I imagine that the func_regenerate at one time was classed as a Trigger entity, which all share the same OnStartTouch/EndTouch/etc outputs, but at some point for some reason was changed strictly to a normal function brush entity. The Valve wiki actually is right more often than not, and in either case you can load up Hammer and see what Outputs the entity can fire from there.
|
All times are GMT -4. The time now is 07:30. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.