KF How to reach specific Zed's HP in HUD? (efficient way)

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Dinamix

FNG / Fresh Meat
Mar 23, 2012
199
1
0
Greetings all, I wonder how to access Specific Zed's Health in HUD class (more specific Pat's) without using foreach DynamicActors (the slowest way...)?
 

Dinamix

FNG / Fresh Meat
Mar 23, 2012
199
1
0
Yeah i noticed that in Hud class doesn't seem to work, so i have addded Health tracking into custom GameReplication class.
Health checks in Tick (using custom GameType) and Initiallazing in custom GameType (under Boss preparation in trader time) since i have already altered State MatchInProgress. So i just access to my custom GameRepliaction in HUD.

P.S. I guess it's better than using foreach DynamicActors?
 

Skell

Active member
Mar 21, 2013
1,245
2
38
On the Internet.
Yeah i noticed that in Hud class doesn't seem to work, so i have addded Health tracking into custom GameReplication class.
Health checks in Tick (using custom GameType) and Initiallazing in custom GameType (under Boss preparation in trader time) since i have already altered State MatchInProgress. So i just access to my custom GameRepliaction in HUD.

P.S. I guess it's better than using foreach DynamicActors?
the radar by WPC probably uses that. It's not the best, but it works.
 

poosh

Grizzled Veteran
Jan 6, 2011
3,403
327
83
Controllers exist on server side only. Except own PlayerController.

CollidingActors() is the fastest way to detect zeds within certain radius. But take into account that zeds far away from the player are irrelevant, i.e. are not replicated.

If you want to just replicate Pat/FP health, then I recommend doing that via ReplicationInfo.
 

Marco

Active member
May 23, 2009
644
232
43
Finland
Since there is only one pat, the most efficient way would be to set pat to be AlwaysRelevant and on client side use DynamicActors to find it and save the reference him.