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 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
  #2  
Old 02-27-2014, 01:46 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

I can confirm that the OnAircraftTookOff event works in both SP & MP modes. If it's not achieving what you want then it must be your code itself.
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash.

Get the latest COD Team Fusion patch info HERE
Reply With Quote
  #3  
Old 02-27-2014, 05:27 AM
theOden theOden is offline
Approved Member
 
Join Date: May 2011
Location: Sweden
Posts: 221
Default

Yes, I've already confirmed SP/MP in my "Edit2".
It's a small loop in OnBattleStarted that removes all singleplayer planes, including "player", that has the extra effect of totally disabling this override (not even GamePlay.gpLogServer shows up if I keep the "clean-up code").

Was hoping to get the mission working in both SP and MP (as I always do in ArmA2) but I can keep all files but .mis as "unified code base" and I guess that is good enough (only removing the player flight before repacking as MP).

Anyway, thank you for your effort - I remember your name as a helpful one from earlier
__________________
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 12:12 PM.


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