Raised This Month: $ Target: $400
 0% 

[L4D] MessageText UserMessage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Whosat
Senior Member
Join Date: Nov 2007
Location: Singapore
Old 09-05-2009 , 03:52   [L4D] MessageText UserMessage
Reply With Quote #1

Was finding a way to hook those Game Instructor Hints stuff you see on your screen in L4D when you first look at an ammopile, hold a health pack or having gotten pounced. Like "<Mouse Clicking Icon> Use Pain Pills" at the bottom section of your screen, etc.

Experimented with the usermessages and found MessageText, but it was not I was looking for. But it looked interesting, like an on-screen in-game console thing.

[IMG]http://img406.**************/img406/4577/l4dhospital01apartment0c.th.jpg[/IMG]

Here's the snippet for sending these messages. Every MessageText you send will print a new line at the bottom of that panel, much like a console if you ask me.

PHP Code:
MessageText(clientrgbString:message[]) {
    new 
Handle:TextHandle StartMessageOne("MessageText"client);
    
BfWriteByte(TextHandler);        // R
    
BfWriteByte(TextHandleg);        // G
    
BfWriteByte(TextHandleb);        // B
    
BfWriteString(TextHandlemessage);
    
EndMessage();

Yes, colour can be changed by r/g/b values.

Some stuff you need to know:
31 character message limit
Text size is (very, very) small. (In that screenshot I put a CenterText to have a fontsize comparison - its even smaller!)
Make the panel close by ClientCommand-ing the client to do hide_message_panel
The messagepanel appears behind menus, hinttexts, chattexts. (i.e. its underlapped)

You might need this on whichever client you execute the panel to.
PHP Code:
    ClientCommand(client"bind - hide_message_panel"); 
Because by default hide_message_panel isn't bound on a client, and it seems like when you bind it it only lasts for that server connect. Once you quit the server, the bind gets removed.

The console command I used for that demo:
PHP Code:
public Action:TestText(clientargs) {
    if(
GetCmdArgs() < 1) {
        
ReplyToCommand(client"Usage: TestText <message>");
        return 
Plugin_Handled;
    }
    
    
decl String:arg1[32];
    
GetCmdArg(1arg132);
    
MessageText(client2551010arg1);
    
    return 
Plugin_Handled;

Don't know if it'll be of use to anyone but I'll just put it up here anyway.

P.S. anyone knows the usermessage/event that fires when the game instructor hints show? :X
__________________

Last edited by Whosat; 09-05-2009 at 03:55.
Whosat is offline
olj
Veteran Member
Join Date: Jun 2009
Old 09-05-2009 , 05:33   Re: [L4D] MessageText UserMessage
Reply With Quote #2

99999 CARMA TO YOU. And yeah, there are events for some hints. Browse l4d events.

P.S. Didnt exactly get - how should we close this message ? And if we wont close - can user kill this message window somehow? Can we just do
PHP Code:
ClientCommand(client"hide_message_panel"
?
__________________

Last edited by olj; 09-05-2009 at 05:37.
olj is offline
Whosat
Senior Member
Join Date: Nov 2007
Location: Singapore
Old 09-05-2009 , 05:35   Re: [L4D] MessageText UserMessage
Reply With Quote #3

lol.
Hmm there's only game_message that seems likely the one. Can't find the right one
__________________
Whosat is offline
olj
Veteran Member
Join Date: Jun 2009
Old 09-05-2009 , 05:41   Re: [L4D] MessageText UserMessage
Reply With Quote #4

explain_pills, explain_**** etc, maybe this?
__________________
olj is offline
Whosat
Senior Member
Join Date: Nov 2007
Location: Singapore
Old 09-05-2009 , 05:49   Re: [L4D] MessageText UserMessage
Reply With Quote #5

Hmm maybe. But speaking of which, does anyone know how to dump the events? Maybe a function like sm_dump_netprops?
__________________
Whosat is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 09-05-2009 , 06:19   Re: [L4D] MessageText UserMessage
Reply With Quote #6

If you mean usermessages, you can do "meta game" to get a list. You will have to find them in the SDK or a disassembler to figure out the params though.
__________________
CrimsonGT is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 09-05-2009 , 08:04   Re: [L4D] MessageText UserMessage
Reply With Quote #7

Isn't that the Subtitles Box? Have you tried what it does to Subs?
AtomicStryker is offline
Whosat
Senior Member
Join Date: Nov 2007
Location: Singapore
Old 09-05-2009 , 08:12   Re: [L4D] MessageText UserMessage
Reply With Quote #8

Quote:
Originally Posted by CrimsonGT View Post
If you mean usermessages, you can do "meta game" to get a list. You will have to find them in the SDK or a disassembler to figure out the params though.
Yeah I've done that. That's how I found MessageText. Figured out the params on my own lol.
SayText, SayText2, KeyHintText aren't the ones :/

Quote:
Originally Posted by AtomicStryker View Post
Isn't that the Subtitles Box? Have you tried what it does to Subs?
It is? What subtitles? Closed Captions, you mean?
I haven't tried that one
__________________
Whosat is offline
Thraka
AlliedModders Donor
Join Date: Aug 2005
Old 09-16-2009 , 13:27   Re: [L4D] MessageText UserMessage
Reply With Quote #9

Sucks the text is so small. On my display, I cannot read center text because it's too small.
Thraka is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 09-18-2009 , 16:37   Re: [L4D] MessageText UserMessage
Reply With Quote #10

Also, i hate to say it, but most L4D players are mindless automatrons. I can swap their teams and hardy ever will someone type "wtf" or even react. (Other than ragequitting)
AtomicStryker is offline
Reply



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 23:48.


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