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 01-03-2013, 03:14 PM
nilsabc nilsabc is offline
Registered Member
 
Join Date: Jul 2012
Posts: 5
Default Planes despawn

Hi i have a problem with AI planes they all follow a rout and after 15-30 min they have order to land and then the mission starts again it all works fine and the script to restart mission is working. But the planes who have landed are not despawning thats really a problem for the performance. Is there a script where i can define that the AI planes despawn after landing and parking in their box? Or am i missing something (I did not set KI to inactive). A other thing i noticed is that landed planes sometimes begin to start again and doing what ever they want i really need to fix that issue. I hope someone can help me and i thank you in advance

PS: Its a MP mission

Greatings
Reply With Quote
  #2  
Old 01-04-2013, 10:11 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Code:
    public override void OnAircraftLanded(int missionNumber, string shortName, AiAircraft aircraft)
    {
        base.OnAircraftLanded(missionNumber, shortName, aircraft);

        double DespawnAfter = 5 * 60;   // seconds after landing
        Timeout(DespawnAfter, () =>     // despawn after specified seconds
        {
            try { aircraft.Destroy(); }
            catch { }
        });
    }
__________________
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 01-04-2013, 01:08 PM
nilsabc nilsabc is offline
Registered Member
 
Join Date: Jul 2012
Posts: 5
Default

Wow wounderfull good that there are such peple like you out there without you i would have been lost. I will test it
Reply With Quote
  #4  
Old 01-04-2013, 02:11 PM
nilsabc nilsabc is offline
Registered Member
 
Join Date: Jul 2012
Posts: 5
Default

OK i tried it and it didn't work script was marked as ok but in mission nothing happend when plane landed but i think its because i implemented that script into the main mission where no aircraft are placed i tried to get it into te sub mission where the aircrafts get spawned but i have a simple problem there :

I have no other script there and i am lost what do i need to do if i just want the single script
Code:
    public override void OnAircraftLanded(int missionNumber, string shortName, AiAircraft aircraft)
    {
        base.OnAircraftLanded(missionNumber, shortName, aircraft);

        double DespawnAfter = 5 * 60;   // seconds after landing
        Timeout(DespawnAfter, () =>     // despawn after specified seconds
        {
            try { aircraft.Destroy(); }
            catch { }
        });
    }
to work without anything else because i failed to achieve that
Reply With Quote
  #5  
Old 01-06-2013, 10:14 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Some scripting commands don't work from sub-missions so as a general rule put your scripts in your main mission. Sounds like you're missing a 'missionlistener' that will watch for your submission events. Try this in your main script file.

Code:
    public override void OnBattleStarted()
    {
        base.OnBattleStarted();
        MissionNumberListener = -1;
     }
__________________
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

Last edited by salmo; 01-06-2013 at 10:17 AM.
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 10:39 AM.


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