News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 9th Jun 2010, 07:01 PM   #1
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 204
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?
__________________
How to play NAB


Last edited by Rajada; 9th Jun 2010 at 07:12 PM.
Rajada is offline   Reply With Quote
Old 10th Jun 2010, 06:18 AM   #2
gopostal
Registered User
 
Join Date: Jan. 19th, 2006
Posts: 593
Sure, and it isn't hard. I made this simple mod to help me when I mapped for monsterhunt:


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).
gopostal is offline   Reply With Quote
Old 10th Jun 2010, 12:30 PM   #3
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 204
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?
__________________
How to play NAB


Last edited by Rajada; 10th Jun 2010 at 04:23 PM.
Rajada is offline   Reply With Quote
Old 10th Jun 2010, 05:39 PM   #4
gopostal
Registered User
 
Join Date: Jan. 19th, 2006
Posts: 593
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.
gopostal is offline   Reply With Quote
Old 10th Jun 2010, 09:12 PM   #5
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 204
Okay, great, thanks again, it looks awesome in-game!
__________________
How to play NAB

Rajada is offline   Reply With Quote
Old 11th Jun 2010, 02:15 AM   #6
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,687
Quote:
Originally Posted by gopostal View Post
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 11th Jun 2010, 07:03 AM   #7
gopostal
Registered User
 
Join Date: Jan. 19th, 2006
Posts: 593
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.
gopostal is offline   Reply With Quote
Old 11th Jun 2010, 12:05 PM   #8
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 204
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.



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.
__________________
How to play NAB

Rajada is offline   Reply With Quote
Old 11th Jun 2010, 05:19 PM   #9
gopostal
Registered User
 
Join Date: Jan. 19th, 2006
Posts: 593
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 is offline   Reply With Quote
Old 14th Jun 2010, 07:35 AM   #10
gopostal
Registered User
 
Join Date: Jan. 19th, 2006
Posts: 593
@ 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)
gopostal is offline   Reply With Quote
Old 14th Jun 2010, 11:45 AM   #11
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 204
Oh wow, looks awesome, I'd love to see how you did it as its definitely a vast improvement.
__________________
How to play NAB

Rajada is offline   Reply With Quote
Old 14th Jun 2010, 05:35 PM   #12
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,687
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 14th Jun 2010, 05:55 PM   #13
gopostal
Registered User
 
Join Date: Jan. 19th, 2006
Posts: 593
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 by gopostal; 14th Jun 2010 at 06:13 PM.
gopostal is offline   Reply With Quote
Reply

Tags
health, mutator, overlay, replication, team

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:48 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer