UE1 - UT Team game name overlay

  • 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.

Rajada

Member
Jan 21, 2008
213
0
16
rajada.tumblr.com
Team game name overlay in a weapon

You know how if you put your crosshair on a person in a teamgame itll show their name (and health if on your team)? I found it in the HUD code, but can I place these trace functions in a weapon so I can render similar text that identifies if you own a projectile? Say for example a mine?
 
Last edited:

gopostal

Active Member
Jan 19, 2006
848
47
28
Sure, and it isn't hard. I made this simple mod to help me when I mapped for monsterhunt:
MindReader2.jpg


The download is here:
Mindreader2
(Original bot mindreader redone with permission)

I included the source so you can add this hud pop-up to your mod. Swap out the lines for any sort of information you want to show, in this case it would be Pawn(Owner).
 

Rajada

Member
Jan 21, 2008
213
0
16
rajada.tumblr.com
Except, it can't be used online? That was kind of the point. I should've said that earlier. XP If I made this code in the weapon rather than a HUD though I think maybe I could work around it.

EDIT: Fixed one problem... used...

Code:
C.DrawText(pawn(p.owner).playerreplicationinfo.playername, true);

But if I look up or down the rendered text/icon slides down as though I was simply flying down/up. I assume it is because player view rotation is not being taken into account. Is there an easy fix for that?
 
Last edited:

gopostal

Active Member
Jan 19, 2006
848
47
28
It's very hard to account for that. In 2k4 they are tied to the playerpawn and render nicely but I've been unable to do that in UT. Once you get a high amount of z axis, the overlay tends to slide away. If you can fix this, or improve it, I'd love to know how.
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
It's very hard to account for that. In 2k4 they are tied to the playerpawn and render nicely but I've been unable to do that in UT. Once you get a high amount of z axis, the overlay tends to slide away. If you can fix this, or improve it, I'd love to know how.

If you're using UT's Redeemer code, you already lost because it simply uses the wrong formula. Try the code from my Redeemer 2k4 or Team Beacon 2k4 mutators, they use the correct formula to map world coordinates to screen coordinates.
Also, Long Range Target Identify emulates the HUD code for drawing the player name, but for much longer distances. I don't remember how UT stores that name, but maybe you can reuse the code for non-player objects.
 

gopostal

Active Member
Jan 19, 2006
848
47
28
I see exactly what you mean now. Thank you (yet again) wormbo for your direction. I'll improve this mod and post it by the weekend.
 

Rajada

Member
Jan 21, 2008
213
0
16
rajada.tumblr.com
I'm not too worried about the sliding unless its a very easy change to make. Not having it in front of me I'll have to look later.

Shot0015.jpg


I think it works well though, enemy mines render text in red and yours are green. In a team game however the function isn't even used... the mines are team-based so they use color rather than the text overlay. That and you have to have the mine gun out to "scan" the mines and you have to be within about 500 pixels of them; so its used so little and at such close range that unless its a super easy fix I don't think I want to spend more time on it.

But thanks again guys, this was really super-helpful.
 

gopostal

Active Member
Jan 19, 2006
848
47
28
NP, glad to help out. I'll still post a follow up in this thread to an improved Mindreader if you don't mind.
 

gopostal

Active Member
Jan 19, 2006
848
47
28
@ Rajada: I imported wormbo's way of doing things and it is a VAST improvement. Really cleans the hud up well and stops all that sliding of the health.

This vid is a little grainy but you get the idea:HUD demo

Wormbo, I'm not sure how you came up with this, I spent Saturday going line-by-line trying to fully comprehend it, but you sir are in a category of your very own. Thank you for the help on this!! (I made a donation to your paypal)
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
To be honest, I think the MapToHUD() function I came up with back then might be a bit more complex than it needs to be.
Also, it contains two minor bugs. One is only relevant in windowed mode with height larger than width, because it assumes landscape (width>height) or at least quadratic viewport format when calculating TanFOVx/y. The other concerns modified clipping regions. The function really expects the clipping region to be the entire screen, which is the case by default but can be changed to cut off screen actors and wrap or clip screen text.
 

gopostal

Active Member
Jan 19, 2006
848
47
28
I used a large part of the teambeacon mod and imported it into my canvas draw. I get the general idea of what each of your code lines are doing, but it will take more studying to really understand the specifics. I can swap enough to make it work the way it needs to be, but I'd like to fully get the "why" of it too.

@ Rajada: I sent you the whole HUD class I did for this video.

BTW, I attempted to donate via the paypal button on your site. It says I must register (I did) but now I have to tie my bank account to the paypal account in order to use it. Is there another way I can make a donation for your gracious help to me over the years?
 
Last edited: