Raised This Month: $12 Target: $400
 3% 

[INC] [TF2] Alternative Hud Text


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GNCMatt
Member
Join Date: Apr 2009
Old 04-28-2011 , 05:47   [INC] [TF2] Alternative Hud Text
Reply With Quote #1

Yea I couldn't think of a good title...

Anyway, I do a lot of tf2 stuff that requires displaying information, so I was playing around a bit today trying to get access to the message area that the game_text_tf entity uses, after a few fails I got it working. Decided an include file was the best way to implement it, but I've never written one before so I used Colors as a base, and a lot of it was relevant so there are a couple borrowed lines in here, so thanks exvel.

Still in its early stages, code is pretty ugly and hardcoded settings, but it gets the job done. The one pitfall of using this that I've noticed so far is that if the player has the minimal interface enabled, these notifications don't display. Might make a fallback for that later if it's possible to determine if minimal interface is enabled on a client.


Code:
stock PrintToHud(client, const String:szMessage[], any:...)
stock PrintToHudAll(const String:szMessage[], any:...)

Also included isay as an example. Enjoy.
Attached Files
File Type: inc tf2_hud.inc (1.1 KB, 890 views)
File Type: sp Get Plugin or Get Source (isay.sp - 752 views - 743 Bytes)
File Type: smx isay.smx (3.1 KB, 531 views)
__________________

Last edited by GNCMatt; 04-28-2011 at 12:48.
GNCMatt is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-28-2011 , 14:03   Re: [INC] [TF2] Alternative Hud Text
Reply With Quote #2

Some more info on that message's structure:
String - text - The message displayed.
String - icon - The icon used (this include hard codes "voice_self").
Byte - team - Used to determine the background colour of the panel (this include hard codes "0").
__________________
asherkin is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 04-28-2011 , 14:36   Re: [INC] [TF2] Alternative Hud Text
Reply With Quote #3

The names for the different icons can be found in:
tf/scripts/mod_textures.txt
__________________
pheadxdll is offline
GNCMatt
Member
Join Date: Apr 2009
Old 04-28-2011 , 17:29   Re: [INC] [TF2] Alternative Hud Text
Reply With Quote #4

Quote:
Originally Posted by asherkin View Post
Some more info on that message's structure:
String - text - The message displayed.
String - icon - The icon used (this include hard codes "voice_self").
Byte - team - Used to determine the background colour of the panel (this include hard codes "0").
Yea, but there are two team related params, display_to_team, and background. Both are hard coded to 0.
__________________

Last edited by GNCMatt; 04-28-2011 at 17:32.
GNCMatt is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-29-2011 , 01:31   Re: [INC] [TF2] Alternative Hud Text
Reply With Quote #5

Quote:
Originally Posted by GNCMatt View Post
Yea, but there are two team related params, display_to_team, and background. Both are hard coded to 0.
"display_to_team" just depends on who you send the message to.
What I posted was the full usermessage structure (instead of the silly byte array).
__________________
asherkin is offline
pilger
Senior Member
Join Date: Sep 2010
Old 04-29-2011 , 18:09   Re: [INC] [TF2] Alternative Hud Text
Reply With Quote #6

Just an interesting information for those who think this is broken: it only works for players that have the "Enable minimal HUD" option disabled.
pilger is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-29-2011 , 18:17   Re: [INC] [TF2] Alternative Hud Text
Reply With Quote #7

Quote:
Originally Posted by pilger View Post
Just an interesting information for those who think this is broken: it only works for players that have the "Enable minimal HUD" option disabled.
Quote:
Originally Posted by GNCMatt View Post
The one pitfall of using this that I've noticed so far is that if the player has the minimal interface enabled, these notifications don't display. Might make a fallback for that later if it's possible to determine if minimal interface is enabled on a client.
It helps to even read the first post before replying.
__________________
asherkin is offline
GNCMatt
Member
Join Date: Apr 2009
Old 04-29-2011 , 18:45   Re: [INC] [TF2] Alternative Hud Text
Reply With Quote #8

Quote:
Originally Posted by asherkin View Post
"display_to_team" just depends on who you send the message to.
What I posted was the full usermessage structure (instead of the silly byte array).
Ahh, so "display_to_team" isn't in the usermessage?
__________________
GNCMatt is offline
Calystos
Member
Join Date: Jan 2011
Location: Terra
Old 07-08-2012 , 15:45   Re: [INC] [TF2] Alternative Hud Text
Reply With Quote #9

Pretty handy, did anyone ever figure out how to get this to display something on the minimal HUD display?
Calystos is offline
Send a message via ICQ to Calystos Send a message via AIM to Calystos Send a message via MSN to Calystos Send a message via Yahoo to Calystos Send a message via Skype™ to Calystos
TonyBaretta
Senior Member
Join Date: Mar 2014
Location: nope.avi
Old 02-19-2017 , 11:24   Re: [INC] [TF2] Alternative Hud Text
Reply With Quote #10

if client have cl_hud_minmode 1 this will be invisible , same for game_text_tf hud.

any solution?
__________________
TonyBaretta is offline
Reply


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 -4. The time now is 05:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode