AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [INC] [TF2] Alternative Hud Text (https://forums.alliedmods.net/showthread.php?t=155911)

GNCMatt 04-28-2011 05:47

[INC] [TF2] Alternative Hud Text
 
3 Attachment(s)
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.

asherkin 04-28-2011 14:03

Re: [INC] [TF2] Alternative Hud Text
 
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").

pheadxdll 04-28-2011 14:36

Re: [INC] [TF2] Alternative Hud Text
 
The names for the different icons can be found in:
tf/scripts/mod_textures.txt

GNCMatt 04-28-2011 17:29

Re: [INC] [TF2] Alternative Hud Text
 
Quote:

Originally Posted by asherkin (Post 1459624)
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.

asherkin 04-29-2011 01:31

Re: [INC] [TF2] Alternative Hud Text
 
Quote:

Originally Posted by GNCMatt (Post 1459767)
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).

pilger 04-29-2011 18:09

Re: [INC] [TF2] Alternative Hud Text
 
Just an interesting information for those who think this is broken: it only works for players that have the "Enable minimal HUD" option disabled.

asherkin 04-29-2011 18:17

Re: [INC] [TF2] Alternative Hud Text
 
Quote:

Originally Posted by pilger (Post 1460355)
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 (Post 1459336)
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.

GNCMatt 04-29-2011 18:45

Re: [INC] [TF2] Alternative Hud Text
 
Quote:

Originally Posted by asherkin (Post 1459910)
"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?

Calystos 07-08-2012 15:45

Re: [INC] [TF2] Alternative Hud Text
 
Pretty handy, did anyone ever figure out how to get this to display something on the minimal HUD display?

TonyBaretta 02-19-2017 11:24

Re: [INC] [TF2] Alternative Hud Text
 
if client have cl_hud_minmode 1 this will be invisible , same for game_text_tf hud.

:x any solution?


All times are GMT -4. The time now is 19:11.

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