Default campaign use GamePlay.gpHUDLogCenter for "yellow messages" and SayToGroup for planes "chit chat".
Code:
//$reference Campaign.dll
//-$debug
using System;
using maddox.game;
using maddox.game.world;
public class Mission : maddox.game.campaign.Mission
{
AiActor a1, a2, a3;
AiAircraft airc1, airc2, airc3, my_airc;
public override void OnBattleStarted() {
base.OnBattleStarted();
a1 = GamePlay.gpActorByName("0:BoB_RAF_F_FatCat_Early.010");
a2 = GamePlay.gpActorByName("0:BoB_RAF_F_FatCat_Early.100");
a3 = GamePlay.gpActorByName("0:BoB_RAF_F_FatCat_Early.000");
if (a1 == null || a2 == null || a3 == null) {
System.Console.WriteLine("SCRIPR ERROR: Aircraft not found");
}
airc1 = (AiAircraft)a1;
airc2 = (AiAircraft)a2;
airc3 = (AiAircraft)a3;
my_airc = (AiAircraft)GamePlay.gpPlayer().Place();
if (airc1.Person(0) != null) {
Timeout(20.0, () => {
airc1.SayToGroup(my_airc.AirGroup(), "Weather_looks_good_all_the_way_to_Manston_Good_luck_sir");
});
Timeout(90.0, () => {
airc1.SayToGroup(my_airc.AirGroup(), "Hello_Hurricane_do_you_copy_There_s_an_enemy_flight");
});
}
}
private void checkLanded(AiAircraft aircraft) {
if (GamePlay.gpPlayer().Place() != aircraft)
return;
if (GamePlay.gpGetTrigger("airdrome1").Active) {
if (Campaign != null) {
if (Campaign.battleSuccess != null)
return;
Campaign.battleSuccess = true;
}
GamePlay.gpHUDLogCenter("MISSION COMPLETE");
}
}
Bookmarks