#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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 |
#3
|
|||
|
|||
Wow wounderfull good that there are such peple like you out there without you i would have been lost. I will test it
|
#4
|
|||
|
|||
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 { } }); } |
#5
|
|||
|
|||
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. |
|
|