![]() |
|
|
#1 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
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. |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Jan. 19th, 2006
Posts: 591
|
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). |
|
|
|
|
|
#3 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
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);
__________________
How to play NAB Last edited by Rajada; 10th Jun 2010 at 04:23 PM. |
|
|
|
|
|
#4 |
|
Registered User
Join Date: Jan. 19th, 2006
Posts: 591
|
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.
|
|
|
|
|
|
#5 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
Okay, great, thanks again, it looks awesome in-game!
__________________
How to play NAB |
|
|
|
|
|
#6 | |
|
Quote:
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 | PlanetJailbreak | Unreal Wiki | Liandri Archives Everything you ever wanted to know about replication (but were afraid to ask) [in German] | 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!" |
||
|
|
|
|
|
#7 |
|
Registered User
Join Date: Jan. 19th, 2006
Posts: 591
|
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.
|
|
|
|
|
|
#8 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
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 |
|
|
|
|
|
#9 |
|
Registered User
Join Date: Jan. 19th, 2006
Posts: 591
|
NP, glad to help out. I'll still post a follow up in this thread to an improved Mindreader if you don't mind.
|
|
|
|
|
|
#10 |
|
Registered User
Join Date: Jan. 19th, 2006
Posts: 591
|
@ 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) |
|
|
|
|
|
#11 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
Oh wow, looks awesome, I'd love to see how you did it as its definitely a vast improvement.
__________________
How to play NAB |
|
|
|
|
|
#12 |
|
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 | PlanetJailbreak | Unreal Wiki | Liandri Archives Everything you ever wanted to know about replication (but were afraid to ask) [in German] | 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!" |
|
|
|
|
|
|
#13 |
|
Registered User
Join Date: Jan. 19th, 2006
Posts: 591
|
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. |
|
|
|
![]() |
| Tags |
| health, mutator, overlay, replication, team |
| Thread Tools | |
| Display Modes | |
|
|