Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 10-07-2012, 12:11 AM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default EventChat

Sometimes it would be useful to react on chat messages in your mission script (e.g. to list the remaining targets). I found the solution at sukhoi.ru, there is a hidden flag in the conf.ini that enables this.

IMPORTANT:
You have to add the following line to your conf.ini or confs.ini file:
Code:
[rts]
scriptAppDomain=0
Without that you get a System.Runtime.Serialization.SerializationExceptio n.

This is the code for the mission:

Code:
public override void OnBattleStarted()
{
    base.OnBattleStarted();

    if (GamePlay is GameDef)
    {
        (GamePlay as GameDef).EventChat += new GameDef.Chat(Mission_EventChat);
    }
}

void Mission_EventChat(IPlayer from, string msg)
{
    // msg contains the chat message.

    // Example: This code causes the server to repeat the message from the player.
    if (GamePlay is GameDef)
    {
        (GamePlay as GameDef).gameInterface.CmdExec("chat " + msg);
    }    
}
Happy coding

Last edited by 41Sqn_Banks; 10-07-2012 at 10:48 AM.
Reply With Quote
  #2  
Old 10-07-2012, 07:24 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Nice find, thanks. Sometimes i wish my russian would be better. But only with "Dawei Dawei"
Reply With Quote
  #3  
Old 10-07-2012, 09:36 AM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

Now I only need a way to write a chat message to a player (which is shown in the dogfight menu chat window).

Any ideas?
Reply With Quote
  #4  
Old 10-07-2012, 10:05 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Nice find Banks. Makes you wonder what other functionality is hidden.
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash.

Get the latest COD Team Fusion patch info HERE
Reply With Quote
  #5  
Old 10-07-2012, 11:00 AM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

This allows the server to write chat messages:
Code:
string msg = "Hello World!";
if (GamePlay is GameDef)
{
    (GamePlay as GameDef).gameInterface.CmdExec("chat " + msg);
}
Is there a way to send a chat message only to a specific player?
Reply With Quote
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. The time now is 02:33 PM.


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