[Help]Hud Basics

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

krasnoarmiich

New Member
May 1, 2006
1
0
0
Hey there guys,

I'm quite new to UEd and Wotgreal, just to get that out of the way. I was curious if you guys could give me any pointers on how to completely remove the standard Unreal Tournament Hud, and create a new one that just displays ammo and health in the top corner.
I was hoping to try and get this so that I could understand the fundamentals of how the HUD works a little better, and I've tried and tried but can't find out what to do. I've got the HUD gone, but can't get the health and ammo.

Thanks for any help.
 

pospi

New Member
Jun 30, 2003
298
0
0
www.pospi.cjb.net
it's basically a case of reading variables from various places and then drawing them to your canvas. If you want to do the basics, you could just draw them with DrawText(), but a nicer way that the UT huds use is to draw NumericWidgets so that the font is pretty.

The two main places you have access to from the HUD are the player's controller (via PlayerOwner) and player's pawn (via PawnOwner). From there, you can get through to PlayerReplicationInfo (PlayerOwner.PlayerReplicationInfo), GameReplicationInfo (PlayerOwner.GameReplicationInfo) and even everyone else's PlayerReplicationInfos (PlayerOwner.GameReplicationInfo.PRIArray). Note that you can't access other people's controllers because these don't exist for clients in network games. So any variables you want on your hud from other players should be set in your PlayerReplicationInfo and replicated across that way. But that's another story.

Anyway point is, most of the important data for games can be found in those places. I'm not sure exactly where health and ammo are stored, but it's probably in PawnOwner.Health and PawnOwner.Weapon.AmmoCount().. I'm just guessing about those though, someone else can give you the proper rundown.

You can check out HudCDeathMatch for some insight into how the normal UT hud is drawn, and you should extend from HudBase to draw your own one, so look in there to see what functions you have available.

This is all for UT2003/4 by the way, you said Unreal Tournament so maybe youre looking for UT99 info, in which case a lot of what I said may not apply, but hopefully much of it is the same as well.