#1
|
|||
|
|||
Read Server Chat in Script?
Does anybody know how to access the chat logs from a script? I tried registering a method with the GameDef.Chat delegate, but that doesn't seem to work. Maybe it's for sending messages? Anyway, it would be really nice to be able to read player chat from a script. There's a lot of possibilities there.
|
#2
|
|||
|
|||
I was told that time of writing a server log file was reduced in recent beta. Parsing the log file is one of obvious but not very elegant ways I think.
On the other hand the content of a log file is created by a code that watches for game events and outputs them to logfile. You can write a similar code that would watch game events and output all needed data not to logfile but to your code directly I guess. |
#3
|
|||
|
|||
Hi Ataros, you are right. That would not be a very elegant solution. You are also right that I need some way to listen for the event. Unfortunately, I do not know how to do that. It is easy to override the OnAircraftLanded() method to listen to that event, but there is no OnChat() method or anything similar.
|
#4
|
|||
|
|||
What kind of events do you want to read from chat?
|
#5
|
|||
|
|||
I want to be able to read what players write in the chat bar. I was thinking of making a mission where players could type a command into the chat bar and receive a mission to complete. Maybe ferrying an aircraft from one airbase to another or performing recon over an enemy position. Things like that.
|
#6
|
|||
|
|||
Quote:
They said before that you can compile a dll with a user interface and it will be downloaded from the server. Maybe it would be easier to make such a dll that would intercept keyboard commands. Then a player would just press a number key to select a line from menu. |
#7
|
|||
|
|||
Thanks Ataros. Hopefully, there's a better way. I don't know anything about WPF.
|
|
|