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 08-08-2011, 07:33 PM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

Yes the chat is captured during the mission.

http://code.google.com/p/il2dce/sour...IL2DCE/Core.cs

Code:
        public Core(GameDef game)
        {
            _game = game;

            Game.EventChat += new GameDef.Chat(Game_EventChat);

Code:
        void Game_EventChat(IPlayer from, string msg)
        {
            if(msg.Contains("!hello"))
            {
                Game.gpLogServer(new Player[] { from }, "Hello World!", null);
            }
        }
Here is how the GameDef is given to the Core. This is also the entry point for the addin.
http://code.google.com/p/il2dce/sour.../GameSingle.cs
Code:
public GameSingle(GameSingleIterface game)
                : base(game)
            {
                core = new Core(this);
            }
To load the addin you need to have a .xml file:
http://code.google.com/p/il2dce/sour...GameSingle.xml
Reply With Quote
  #2  
Old 08-08-2011, 07:59 PM
fearlessfrog fearlessfrog is offline
Approved Member
 
Join Date: Jul 2010
Posts: 64
Default

Great - thank you!
Reply With Quote
  #3  
Old 08-14-2011, 09:12 PM
fearlessfrog fearlessfrog is offline
Approved Member
 
Join Date: Jul 2010
Posts: 64
Default

One related question to this is has anyone found out anything regarding an Add-in interface that works without having to define a single player mission or campaign setup pages?

Banks - it seems the GameDef reference is only passed down into the Add-In once a whole campaign set is defined, say a new 'Single Player' menu entry (i.e. an entry in the XML config to the right assembly etc).

So if I wanted to let people just use my add-in then I have to either:

- Define some custom pages to go pick quick missions that exist. Is there anyway to reuse what's been defined in Play.QuickMiss() as that seems to return ContentControls rather than a Page implementation?

- Define a complete WPF custom page that allows a mission file to be picked and then loads the Mission?

- Some other type of Client Add-In that gives me the GameDef reference but is included in all type so Campaign/Missions?

Anyone got any ideas of this?

Last edited by fearlessfrog; 08-14-2011 at 09:38 PM.
Reply With Quote
  #4  
Old 08-15-2011, 12:21 AM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

Quote:
Originally Posted by fearlessfrog View Post
One related question to this is has anyone found out anything regarding an Add-in interface that works without having to define a single player mission or campaign setup pages?

Banks - it seems the GameDef reference is only passed down into the Add-In once a whole campaign set is defined, say a new 'Single Player' menu entry (i.e. an entry in the XML config to the right assembly etc).

So if I wanted to let people just use my add-in then I have to either:

- Define some custom pages to go pick quick missions that exist. Is there anyway to reuse what's been defined in Play.QuickMiss() as that seems to return ContentControls rather than a Page implementation?
Yes you can reuse existing pages by IGameInterface.PageGet(string pageName).
Code:
Game.gameInterface.PagePush(Game.gameInterface.PageGet("SingleMissGame"), "mission " + missionFileName);
http://code.google.com/p/il2dce/sour...gnIntroPage.cs

By this you should be able to get the stock pages fpr single mission selection or the quick mission. Try the name of the corresponding ContentControl, so far this worked for me.

Quote:
- Define a complete WPF custom page that allows a mission file to be picked and then loads the Mission?
Yes this is possible. Or you can reuse the stock ContentControl, then you only have to implement the functionality and can reuse the layout.

Quote:
- Some other type of Client Add-In that gives me the GameDef reference but is included in all type so Campaign/Missions?
Could be possible but I think only the devs know this for sure.
Reply With Quote
  #5  
Old 08-19-2011, 08:38 PM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

I was in contact with one of the devs on how to access the Chat-event from a mission script. He told me that the next patch will feature an elegant way to do things like that. So better we wait for the next patch.
Reply With Quote
Reply

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 03:54 AM.


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