|
Author
|
Message
|
|
Junior Member
|

02-12-2007
, 04:14
DeathMsg and Damage order problems
|
#1
|
Hello all. I'm encountering a tricky problem. In CS:Source, log lines for attacks have additional information at the end for hitgroups: (hitgroup "stomach") ... for example. I'd like to add the same information to log lines in 1.6. My first thought was to simply capture the logevent with
register_logevent("hook_log_attacked", 9, "1=attacked")
and then grab the hitgroup from get_user_attacker() and add it on the end of the log line. The problem for attacks is, 'register_logevent()' occurs before the 'register_event("Damage")' and 'client_damage()' calls, so I cannot retrieve the hitgroup information this way.
So you could say, why not just block the normal attack message and re-create it in client_damage() with the hitgroup information? Well, one of the problems there is that the logevent contains how much armor damage was dealt, where client_damage() does not (along with the victim's health and armor stats). I could create a lot of extra code to calculate what the armor damage should be, but there's yet another problem.
The other problem is that if a player dies, the DeathMsg and Kill log lines occur before the final Damage event! So, if I waited to reconstruct the attack message in client_damage(), it would be out of order any time there is a kill. In fact, if it's the end of the round, DeathMsg won't take place until after both the Kill log AND the Round End logs.
Sorry if that's very confusing, but I'm trying to figure out the best possible solution (if any) to add hitgroups to the end of each attack log. The only solution I can think of right now is to block regular attack and kill logs, reconstruct both the attack and kill logs in client_damage(), and then set a flag to block the 2 Round End logs until the remaining Damage events have taken place. That's enormously complicated for what should be an easy task...
|
|
|
|