#21
|
|||
|
|||
wow this is great, will give it a try, thanks a lot!
|
#22
|
|||
|
|||
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); } } } |
#23
|
|||
|
|||
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.
|
#24
|
|||
|
|||
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; or Code:
maddox.game.GameDef game = GamePlay as maddox.game.GameDef; I tried both and both did work. Of course I still get the serialization exception. |
#25
|
|||
|
|||
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! |
#26
|
||||
|
||||
Quote:
|
#27
|
|||
|
|||
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. |
#28
|
||||
|
||||
Thanks Ataros overlooked it after searching various forums half the day to my eyes bleeds
Must get me some stronger glases |
|
|