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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #21  
Old 08-09-2011, 10:30 PM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

Code:
// IL2DCE: A dynamic campaign engine for IL-2 Sturmovik: Cliffs of Dover
// Copyright (C) 2011 Stefan Rothdach
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

//$reference parts/IL2DCE/IL2DCE.dll
//$reference parts/core/gamePlay.dll
//$debug

using System;
using maddox.game;
using maddox.game.world;

public class Mission : AMission
{
    public override void OnBattleStarted()
    {
        base.OnBattleStarted();
        maddox.game.GameDef game = GamePlay as maddox.game.GameDef;
        
        game.EventChat += new GameDef.Chat(Game_EventChat);
    }

    void Game_EventChat(IPlayer from, string msg)
    {
        if (msg.Contains("!hello"))
        {
            GamePlay.gpLogServer(new Player[] { from }, "Hello World!", null);
        }
    }

}
This script is also causing the serialization exception. It looks like the usage of GameDef forces the serialization. This is really a shame as capturing the chat would be very useful for multiplayer missions ... but writing a multiplayer addin was successful so far
Reply With Quote
 

Thread Tools
Display Modes

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 09:16 PM.


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