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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-24-2014, 08:31 PM
theOden theOden is offline
Approved Member
 
Join Date: May 2011
Location: Sweden
Posts: 221
Default OnAircraftTookOff broken?

I have these simple overrides but "OnAircraftTookOff" just refuse to trigger.
Back in the old days I built a simple BoB campaign using this among others and unless I'm way too senile by now this used to work?

I slapped in "OnPlaceEnter" for reference and that bugger does work.

Anyone more up-to-date with Dover than me who knows what might be missing?

TF 4.0 is in use btw and no errors in log.txt and the gpLogServer never shows in the log either.

Code:

    public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceEnter(player, actor, placeIndex);

        GamePlay.gpLogServer(null, "OnPlaceEnter '{0}' '{1}'", new object[] { actor.Name(), placeIndex });
        GamePlay.gpHUDLogCenter("OnPlaceEnter");
    }

    public override void OnAircraftTookOff(int missionNumber, string shortName, AiAircraft aircraft)
    {
        GamePlay.gpLogServer(null, "OnAircraftTookOff '{0}' '{1}'", new object[] { shortName, aircraft.TypedName() });
        GamePlay.gpHUDLogCenter("OnAircraftTookOff");
        bool activateBombers = false;
        if (GamePlay.gpIsServerSingle())
        {   // player CAP
            if (aircraft.Player(0) != null)
                if (!activateBombers)
                    activateBombers = true;
        } else {
            if(aircraft.Player(0) != null)
                activateBombers = true;
            if (!activateBombers)
                foreach (Player p in GamePlay.gpRemotePlayers())
                    if (aircraft == (AiAircraft)p.Place())
                        activateBombers = true;
        };
        activateBombers = true;
        if(activateBombers)
        {
            if (!bWellington)
            {
                GamePlay.gpHUDLogCenter("Wellington bombers are inbound from the north, escort them to target");
                bWellington = true;
                AiAction action = GamePlay.gpGetAction("redAirborne");
                if (action != null) action.Do();
            };
        };
    }



Edit:
Ok, this function is singleplayer only it seems.
Starting to remember why I dropped this product a few ago..
Pure Quality.

Edit2:
Nope, function runs ok in both SP and MP - unless you delete all SP planes when hosted in MP.
Need to create another solution I guess.
__________________

Last edited by theOden; 02-25-2014 at 01:35 PM.
Reply With Quote
 


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


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