PDA

View Full Version : OnAircraftTookOf ???



_1SMV_Poppy_64
Apr-28-2014, 18:25
Hi all,

please, someone know how OnAircraftTookOf doesn't work when the aircraft is created by a human player in a birthplace?



public override void OnAircraftTookOff(int missionNumber, string shortName, AiAircraft aircraft)
{
base.OnAircraftTookOff(missionNumber, shortName, aircraft);
GamePlay.gpHUDLogCenter("Debug: OnAircraftTookOF =>" + shortName + " is on flight.");
}


I'm going crazy ...

69th_Spiritus_Mortem
Apr-29-2014, 17:23
Sorry, most I can do is give you a bump. Coding is really discouraging.

Salmo
Apr-29-2014, 22:59
Hi all, please, someone know how OnAircraftTookOf doesn't work when the aircraft is created by a human player in a birthplace? I'm going crazy ...

Your code is good. You likely don't have a "event listener" enabled in your OnBattleStarted routine. Add this routine to your code & it should sense when an aircraft takeoff event occurs.



public override void OnBattleStarted()
{
base.OnBattleStarted();
MissionNumberListener = -1; // listen for events from this mission & all submissions
}

_1SMV_Poppy_64
Apr-30-2014, 17:33
Thank you Salmo!

You right, now the script is working.
Thank you again!