PDA

View Full Version : OnAircraftTookOf ???


_1SMV_Poppy_64
04-24-2014, 04:58 PM
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 ...

theOden
04-25-2014, 08:44 AM
hmm I had issues with this one before but got it working after removing code that deletes all "editor placed planes" if served in multiplayer.

Now on the other hand (TF4.312) I get the behaviour you describe (I guess I was TF4.3 last time).

Simple mission on Steppe having "Birthplaces" and one single in editor Hurricane (=player) with this code only:


using System;
using System.Collections;
using maddox.game;
using maddox.game.world;
using maddox.GP;

public class Mission : AMission
{
// Public Overrides //
public override void OnAircraftTookOff(int missionNumber, string shortName, AiAircraft aircraft)
{
base.OnAircraftTookOff(missionNumber, shortName, aircraft);

GamePlay.gpHUDLogCenter("OnAircraftTookOff " + shortName + " as " + aircraft.InternalTypeName());
GamePlay.gpLogServer(null, "OnAircraftTookOff {0} as {1}", new object[] { shortName, aircraft.InternalTypeName() });
}

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

GamePlay.gpHUDLogCenter("OnAircraftLanded " + shortName + " as " + aircraft.InternalTypeName());
GamePlay.gpLogServer(null, "OnAircraftLanded {0} as {1}", new object[] { shortName, aircraft.InternalTypeName() });
//Timeout(150, () => { if (aircraft != null) aircraft.Destroy(); });
}
}


Weird but I'll try to dig some more.

Edit:
Just tried my little Steppe-mission without TF-patch (vanilla 1.11 that is) and I get the very same behaviour - only editor placed planes trigger this.

_1SMV_Poppy_64
04-26-2014, 11:55 AM
Yes, I'm trying on 4.312 without succes, it's working only if is an AI that take off or land...

It is very important to have this event wrote on an eventlog, for statistics (we are building up a new statistic parser) and for dinamic campaign. :roll: