Page 1 of 1

Map Script help: Monitor player text.

Posted: April 7th, 2010, 12:15 am
by Uzumakibro93
Hi there, I am working on a script that monitors what a player says and will play a sound for certain words. Like how the quick chat works, or how typing in words in Half Life 2 will return a sound. I have no idea where to start, except for possibly taking the iprintln function apart to see how it works. If no one knows or can help, I would appreciate someone telling me where I can find the file which contains the iprintln function, if it exists. Thank you, Kyle Mulliger.

Re: Map Script help: Monitor player text.

Posted: April 7th, 2010, 12:49 am
by Drofder2004
Sorry to say this to you, but the only way to track text is using a third party software hooking into the console on the server.

The quickchat works with a simple selection system. You choose the option, the menu response system catches the selection and plays the corresponding item.

playSound() is the command the plays the sound.
sayText() forces the player to post text to everyone.
sayTeam() forces the player to send a message to just his team.

All of this can be found in _quickMessage.gsc

But, if you are trying to monitor the text itself and play a sound based on that text, stop here :)

Re: Map Script help: Monitor player text.

Posted: April 7th, 2010, 1:12 am
by Uzumakibro93
:(

Haha, I have scripted the "unscriptable" before, though... So have you all!
Hmm...If I were to monitor what is typed in (i.e. before you press "enter"), it would work hypothetically, right?

Re: Map Script help: Monitor player text.

Posted: April 7th, 2010, 1:18 am
by Drofder2004
Nope, the only way to even consider this working is to use a menu.

You can monitor what is entered into a textbox (for example, Key Codes & Player name).
This is done by using the same method as I was mentioning with menu responses.

Check _menus.gsc "onMenuResponse()"

Re: Map Script help: Monitor player text.

Posted: April 7th, 2010, 1:27 am
by Uzumakibro93
Well then...I can already create my own quick message messages and sounds, etc...That sucks. Thank you, man, Kyle Mulliger.

Re: Map Script help: Monitor player text.

Posted: April 7th, 2010, 1:28 am
by Drofder2004
No probs, let us know if you get stuck...