#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
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 |
#3
|
|||
|
|||
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
__________________
|
|
|