Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   FMB, Mission & Campaign builder Discussions (http://forum.fulqrumpublishing.com/forumdisplay.php?f=203)
-   -   Read Server Chat in Script? (http://forum.fulqrumpublishing.com/showthread.php?t=24029)

TheEnlightenedFlorist 06-24-2011 01:54 AM

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.

Ataros 06-24-2011 10:54 AM

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.

TheEnlightenedFlorist 06-24-2011 11:02 PM

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.

Ataros 06-25-2011 02:18 PM

What kind of events do you want to read from chat?

TheEnlightenedFlorist 06-25-2011 11:03 PM

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.

Ataros 06-26-2011 11:11 AM

Quote:

Originally Posted by TheEnlightenedFlorist (Post 302337)
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.

Asked the devs how to do it http://www.sukhoi.ru/forum/showthrea...=1#post1644944

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.

TheEnlightenedFlorist 06-27-2011 12:54 AM

Thanks Ataros. Hopefully, there's a better way. I don't know anything about WPF. :)


All times are GMT. The time now is 10:33 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.