Page 1 of 1
UnrealScript for filtering chat log
Posted: Wed Jul 27, 2011 1:05 am
by Seven_of_69
Is there any way to use UnrealScript to intercept and alter the chat log? Printing TO the chat log is simple but I would like to grab the chat lines before they're displayed and have options to ignore them, alter them, modify their color, etc. I have no idea where to begin, specifically if there is a class I would need to subclass, or if it's even possible. My programming ability is expert but I'm new to UnrealScript. :ssmile:
Re: UnrealScript for filtering chat log
Posted: Wed Jul 27, 2011 2:05 pm
by DW_Ant
I've seen some unique hacks and codes mappers used to display unique colors within the same message. I'm aware there's a character limit when chatting so there's a good chance that using these codes may prevent you from keeping under the character limit.
As for intercepting the chat logs, that sounds difficult to do since you'll have to write a client function and some how avoid any security programs. I'm fairly certain Anti TCC will yell at you for running an unknown program.
But if you insist on playing only on noncompetative servers then this will be the place to start I think:
Player Controller Source
This link is the UScript reference. Be mindful that you'll come across native code (specially when you get to the console part in your research). Modders don't have access to native code.
Good luck to you.
Re: UnrealScript for filtering chat log
Posted: Wed Jul 27, 2011 2:30 pm
by Tichinde925
zEh:

Re: UnrealScript for filtering chat log
Posted: Wed Jul 27, 2011 8:59 pm
by DW_WailofSuicide
I would suggest looking at PlayerChatManager. I don't know if this is the correct place but might be worth a look. What you're suggesting should be possible though: There are servers that filter out cursewords, or alter the color or content of text strings (thinking of Assault Trials servers here).
Re: UnrealScript for filtering chat log
Posted: Wed Aug 03, 2011 4:18 pm
by Anonymouse
UT comp does colored text messages; it is used on pretty much all trial servers. Take a look at that if you can.
Re: UnrealScript for filtering chat log
Posted: Mon Aug 15, 2011 5:15 am
by Seven_of_69
Thanks for the suggestions. So far it seems like one place to start is with the UnrealGame.UnrealPlayerChatManager.AcceptText method, at least for applying a simple filter.
http://www.wailofsuicide.com/code/ut200 ... r.html#206
I guess I can subclass UnrealGame.UnrealPlayerChatManager and override the AcceptText method. But now the question becomes how do I get my code "installed"/"registered" into UT2k4? Somehow I'd have to get UT to create my subclassed object instead of an UnrealPlayerChatManager object.
Another option is the Engine.PlayerController.TeamMessage event. However I'm not sure if it can be overridden. And it also comes with its own caveats, e.g.
Code: Select all
// This is a built-in Unreal class and it shouldn't be modified.
// for the change in Possess().
And even if either method is possible, I don't want to be flagged for having untrusted client side code. :sdoh: