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 03-08-2012, 11:47 PM
keinmann keinmann is offline
Approved Member
 
Join Date: Mar 2012
Posts: 19
Default Setting waypoint/take off time

Hey guys,

I can't seem to figure out how to get planes to take off at a certain time. I have a huge wave of Luftwaffe planes flying from inland France, and I don't want the RAF to respond until the Germans are just off the coast. But it seems that FMB won't let me designate a time for the planes to take off -- it just forces them to take off at the start of the mission!

Any idea how I can accomplish this?
Reply With Quote
  #2  
Old 03-09-2012, 12:22 AM
bolox bolox is offline
Approved Member
 
Join Date: May 2008
Posts: 351
Default

http://forum.1cpublishing.eu/showthread.php?t=28487

this uses a pass thru trigger rather than 'setting a time'.
Reply With Quote
  #3  
Old 03-09-2012, 04:10 AM
keinmann keinmann is offline
Approved Member
 
Join Date: Mar 2012
Posts: 19
Default

Hmm, this is new to me (never been into FMB too much) and looks quite useful.

However, it's a shame you can't just set the time...
Reply With Quote
  #4  
Old 03-09-2012, 04:42 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

You can do this via script:

Set your Airgroups on Idle.

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;
using maddox.GP;


public class Mission : AMission
{

    public void SetAirgroupActivAfter(Dictionary<string, double> StartAirgroupAfterTime)
        {
            List<AiAirGroup> allAirgroups = new List<AiAirGroup>();

            if (gamePlay.gpAirGroups(1) != null)
                allAirgroups.AddRange(gamePlay.gpAirGroups(1));
            if (gamePlay.gpAirGroups(2) != null)
                allAirgroups.AddRange(gamePlay.gpAirGroups(2));

            allAirgroups.ForEach(item =>
                {
                    
                    foreach (KeyValuePair<string, double> kvp in StartAirgroupAfterTime)
                    {
                        if (item.Name().Contains(kvp.Key))
                        {
                            Timeout(kvp.Value, () =>
                            {
                                item.Idle = false;
                            });
                        }
                    }
                });
        }

    public override void OnBattleStarted()
    {
        base.OnBattleStarted();

        SetAirgroupActivAfter(new Dictionary<string, double>
                            {
                                {"BoB_RAF_F_64Sqn_Early", 120.0}, //2min
                                {"BoB_RAF_F_111Sqn_Early", 180.0}, //3min
                                {"BoB_LW_JG51_III", 900.0} //15min
                            });
    }
}
With SetAirgroupActivAfter you can activate the Airgroup.
You can also use (for example)
SetAirgroupActivAfter(new Dictionary<string, double>
{
{"BoB_RAF_F", 900.0} //15min
});

to set all RAF Fighter units active after (in this case) 15min.
Reply With Quote
  #5  
Old 03-11-2012, 02:37 AM
keinmann keinmann is offline
Approved Member
 
Join Date: Mar 2012
Posts: 19
Default

I have years of professional experience with C#, but I'm a n00b for FMB. I'm not quite sure how to even load/execute a C# module with the IL-2 engine/FMB!

Anyway... You got me wondering... If I set up some front markers for red and blue, is there a C# event/delegate I can subscribe to when aircraft cross the front? Something like:

void onFrontCrossed(params Plane[] planes) {
// ...blah blah blah ...
}

???

Where can I find documentation on this stuff? Is there any? If I had some comprehensive documentation I suspect I could get quite good with FMB fast, and be able to develop some interesting missions and content.

P.S. -- I also have VS Pro, and would much prefer using my own IDE. Is there any way to do it properly?

Last edited by keinmann; 03-11-2012 at 02:42 AM.
Reply With Quote
  #6  
Old 03-11-2012, 03:56 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

First there is no documentation. If there is a cs file with the same name than the mission the Engine calls the .net csc and execute the file.
To get access to the "CloDo programming interface" add references to the assemblies "antlr.runtime.dll", "core.dll", "gamePages.dll", "gamePlay.dll", "gameWorld.dll", "HostView.dll", "maddox.dll", "part.dll", "sound.dll" and "Strategy.dll" in ..\Steam\SteamApps\common\il-2 sturmovik cliffs of dover\parts\core
and
to the files "partBob.dll" and "Campaign.dll" in ..\Steam\SteamApps\common\il-2 sturmovik cliffs of dover\parts\bob

Then you can examine the classes with the object explorer.
The importent classes for missions are AMission and IGamePlay (GamePlay Object).
There is many try and error expirience, some of the members not working proberly (or not fully implementet at time) or they work in single player and player hosted missions but not on Dedi Server.

There is no event for crossing Front but you can use
GamePlay.gpFrontExist() // true if there is a front line
GamePlay.gpFrontDistance(int army, double x, double y) // double distance to front line < 0 if army == player.Army() > 0 if oposite
And with the OnTickGame() - Event (one Tick is 1/30sek) you can check by your own if a plane cross the line

Last edited by FG28_Kodiak; 03-11-2012 at 04:10 AM.
Reply With Quote
  #7  
Old 03-11-2012, 06:50 AM
keinmann keinmann is offline
Approved Member
 
Join Date: Mar 2012
Posts: 19
Default

THANK YOU!!!!!!! A post like that should be stickied!

I had no idea what references where needed, so thanks a LOT!

P.S. - Bist du Deutscher?
Reply With Quote
  #8  
Old 03-11-2012, 07:01 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Jawohl
Reply With Quote
  #9  
Old 03-11-2012, 07:32 PM
keinmann keinmann is offline
Approved Member
 
Join Date: Mar 2012
Posts: 19
Default

Ahhh, kühl... sehr gut! Ich dachte dass! Ich bin Amerikaner, aber ich kann Deutsch; nicht der best, obwohl gut genug, ich glaube!

Dein Englisch ist einwandfrei, aber die sehr kleine linguistische Feinheiten gibt mir das Andeutung. Zum Beispiel, du sagte "one Tick is 1/30sek", statt "1/30sec".
Reply With Quote
  #10  
Old 03-11-2012, 08:10 PM
Smokeynz Smokeynz is offline
Approved Member
 
Join Date: Apr 2011
Posts: 106
Default

I spotted TOD (time of day) in the classes whilst searching for other stuff.

I suspect it would be possible to use that to spawn in aircraft or idle to a TOD setpoint.

Keinmann, personally I think it is just easier to spawn in aircraft via a separate mission from timer in a script, where you can choose to use a single time period or repeating spawn in cycles. (or any other trigger event you can load a mission containing items required)

Think of the base core mission as a clean "just the choosen map and battle area" , then the idea is you have a separate missions with just the items required.

Have a look through the sticky links of collections of scripts gathered already.
I'm only learning C# as far as application to CLOD so come unstuck with syntax at times, but if like Kodiak you have experience with C# it helps alot with exploring better methods and getting basic syntax correct.
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:07 AM.


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