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-01-2011, 04:41 PM
adonys adonys is offline
Approved Member
 
Join Date: Apr 2010
Posts: 850
Default

there are two ways to do it atm:

1) this is the new one (haven't tested it yet)

Code:
//$reference parts/MissionTools/MissionTools.dll
using nsMissionTools;

mt = new MissionTools();
mt.MissionToolsInit(GamePlay, Time);
2) the old one (used by TEF in his server tool)

Code:
using nsMissionTools;

LoadDll();
mt = new MissionTools();
mt.MissionToolsInit(GamePlay, Time);

private void LoadDll() {
    try {
      //Load the new DLL from the specified path and set the current method to popCommand().
      Assembly a = null;
      a = Assembly.LoadFrom(Directory.GetCurrentDirectory() + @"\IL2ServerMasterLibrary.dll");
    }
    catch (Exception e) {
      GamePlay.gpLogServer(new Player[] { GamePlay.gpPlayer() }, "ERR: Could not load MisionTools library!", null);
    }
  }
I also intend to add all the MP needed functions (to clean unused AIs, etc.)

Then I intend to release it for everyone, and use it to create a Dynamic Campaign Generator.

BTW, do you know any method to reference an AiActor from an AiAircraft (a simple one, not searching through all AiActors to find the one being that specific AiAircraft)? You can d it the other way around using (AiAircraft) AiActor or AiActor as AiAircraft, but how can I reverse this? I've asked naryv, but he hasn't responded yet..

Last edited by adonys; 08-01-2011 at 04:45 PM.
Reply With Quote
  #2  
Old 08-01-2011, 05:09 PM
stillborn stillborn is offline
Approved Member
 
Join Date: Sep 2010
Posts: 21
Default

Thanks, this would be useful.
Quote:
Originally Posted by adonys View Post
BTW, do you know any method to reference an AiActor from an AiAircraft
AiAircraft is a class derived from AiActor, type casting works both ways, ive tested it like this
Code:
    public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
        AiAircraft ac = actor as AiAircraft;
        AiActor ak = ac as AiActor;
        GamePlay.gpHUDLogCenter(ak.Name());
    }
Reply With Quote
  #3  
Old 08-01-2011, 05:24 PM
adonys adonys is offline
Approved Member
 
Join Date: Apr 2010
Posts: 850
Default

hmm.. I didn't thought it might work both ways.. I'll need to do some testing then, thank you
Reply With Quote
  #4  
Old 08-01-2011, 09:44 PM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

You can always cast from AiAircraft to AiActor but you can not always cast from AiActor to AiAircraft.

You can check if its possible to cast from AiActor to AiAircraft by this:

Code:
AiActor actor;
if( actor is AiAircraft )
{
    AiAircraft aircraft = actor as AiAircraft;
    ...
}
If the "as" operator fails it returns null. This can be checked by
Code:
AiAircraft aircraft = actor as AiAircraft;
if(aircraft != null)
{
   ...
}
Of course its not necessary to check the success of the "as" operator if the "is" operator was successful.
Reply With Quote
  #5  
Old 08-01-2011, 10:18 PM
adonys adonys is offline
Approved Member
 
Join Date: Apr 2010
Posts: 850
Default

the problem was not with casting AiActor to AiAircraft, but viceversa.
Reply With Quote
  #6  
Old 08-02-2011, 12:13 AM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

I'm assuming there will be documentation?

I'm assuming you're using Visual Studio? Unfortunately, Visual Studio doesn't include a nice html documentation generator. If you're not aware, there are several third party documentation generators. My favorite is Doxygen. It uses Visual Studio's xml files to produce html files that are fairly easy to navigate, but most importantly, it's very easy to use.
Reply With Quote
  #7  
Old 08-05-2011, 05:00 PM
adonys adonys is offline
Approved Member
 
Join Date: Apr 2010
Posts: 850
Default

Of course there will be, I'll have to learn to use that Doxygen though
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 08:46 AM.


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