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
  #21  
Old 08-09-2011, 09:28 PM
stillborn stillborn is offline
Approved Member
 
Join Date: Sep 2010
Posts: 21
Default

wow this is great, will give it a try, thanks a lot!
Reply With Quote
  #22  
Old 08-09-2011, 09: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
  #23  
Old 08-10-2011, 01:55 AM
stillborn stillborn is offline
Approved Member
 
Join Date: Sep 2010
Posts: 21
Default

no matter what i tried i couldnt manage to create a reference to gamedev object, all castings i tried returned null in Init method, probably would get serialization error instead in OnBattleStarted method, since GameDev is abstract and its constructor which the game uses needs an IGameInterface, there must be a way to keep it as a reference with the right type. i guess "as" operator tries to serialize gameplay for conversion. idk if gameplay can be casted like this directly or indirectly. which makes me think devs may have done this to restrict these parts from users. it would be better to ask for a proper way for this, maybe they can include new methods/properties for us in the future to interact more extensively.
Reply With Quote
  #24  
Old 08-10-2011, 06:33 AM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

Did you check if GamePlay is null before the cast?

Basicly you can do the cast using
Code:
maddox.game.GameDef game = (maddox.game.GameDef)GamePlay;
- this will cause a exception if cast fails

or
Code:
maddox.game.GameDef game = GamePlay as maddox.game.GameDef;
- this will return null if cast fails.

I tried both and both did work. Of course I still get the serialization exception.
Reply With Quote
  #25  
Old 08-12-2011, 10:12 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Hi, Stillborn!

Is it possible to reduce number of destroyer ships by about 30-50%?
We have complains that it is not possible to have dogfights above them due to their uber AAA.

BTW some stats from Repka 2 http://r2.repka.su/

Thanks for the mission again!
Reply With Quote
  #26  
Old 08-29-2011, 09:33 PM
Wandalen's Avatar
Wandalen Wandalen is offline
Approved Member
 
Join Date: Nov 2008
Posts: 86
Default

Quote:
Originally Posted by Ataros View Post
Hi, Stillborn!


BTW some stats from Repka 2 http://r2.repka.su/
How did you do that mate?? trying to find out how to get the stats up but not mutch to find in google plz help
__________________
OS : Win7 64bit
CPU : i7
GF : GTX285
RAM : 4 GB

Reply With Quote
  #27  
Old 08-30-2011, 07:14 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by Wandalen View Post
How did you do that mate?? trying to find out how to get the stats up but not mutch to find in google plz help
The code is included in this mission by stillborn. If you open files there is place to enter your ftp address and password. The rest is done by the mission I can not explain how, as I am only a user. There are some details in original stillborn's post. He mentiones that anyone can use this stat code with any other mission. Someone else from this forum uses this stat with a different mission. I've seen a link in someones sig.

Last edited by Ataros; 08-30-2011 at 07:17 AM.
Reply With Quote
  #28  
Old 08-30-2011, 07:16 PM
Wandalen's Avatar
Wandalen Wandalen is offline
Approved Member
 
Join Date: Nov 2008
Posts: 86
Default

Thanks Ataros overlooked it after searching various forums half the day to my eyes bleeds
Must get me some stronger glases
__________________
OS : Win7 64bit
CPU : i7
GF : GTX285
RAM : 4 GB

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:46 AM.


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