Présenté ici uniquement 2 messages:
Code : Tout sélectionner
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Threading;
using maddox.GP;
using maddox.game;
using maddox.game.world;
using part;
using System.Diagnostics;
using System.Collections;
public class Mission : AMission
{
// -- Boucle MESSAGES ---------------------------------------------------
private void sayMessageTo(int army, string msg)
#region
{
foreach (AiAirGroup g in GamePlay.gpAirGroups(army))
{
bool SaidToGroup = false;
foreach (AiActor a in g.GetItems())
{
if (SaidToGroup == true) break;
SaidToGroup = true;
(a as AiAircraft).SayToGroup((a as AiAircraft).AirGroup(), msg);
}
}
}
#endregion
//--Boucles des "triggers"-------------------------------------
public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);
// MESSAGE Décollage Spitfires puis Hurricanes_________________________________________________________________
if (("OnR1".Equals(shortName)) || ("OnR2".Equals(shortName)))
{
int army = 1;
int i = 0;
// MESSAGE Spitfires________________________
Timeout(i += 1, () => { sayMessageTo(army, "Hello_guys"); });
Timeout(i += 1, () => { sayMessageTo(army, "This_is"); });
Timeout(i += 1, () => { sayMessageTo(army, "CallSign1"); });
Timeout(i += 2, () => { sayMessageTo(army, "Spitfires"); });
Timeout(i += 1, () => { sayMessageTo(army, "Takeoff"); });
Timeout(i += 2, () => { sayMessageTo(army, "Please_climb_now"); });
Timeout(i += 1, () => { sayMessageTo(army, "Height"); });
Timeout(i += 1, () => { sayMessageTo(army, "200h"); });
Timeout(i += 2, () => { sayMessageTo(army, "In_square"); });
Timeout(i += 1, () => { sayMessageTo(army, "A"); });
Timeout(i += 1, () => { sayMessageTo(army, "N"); });
Timeout(i += 1, () => { sayMessageTo(army, "13"); });
// MESSAGE Hurricane________________________
Timeout(i += 25, () => { sayMessageTo(army, "Hurricanes"); });
Timeout(i += 1, () => { sayMessageTo(army, "CallSign1"); });
Timeout(i += 1, () => { sayMessageTo(army, "Speaking"); });
Timeout(i += 1, () => { sayMessageTo(army, "Ground_control_here_Stand_by"); });
GamePlay.gpGetTrigger("OnR1").Enable = false;
GamePlay.gpGetTrigger("OnR2").Enable = false;
}
}
}
Notes:
- int army : 1 pour la RAF, 2 pour la Luftwaffe.
- Timeout: le chiffre correspond au délai en secondes.
- Les différents messages audios sont dans : xxx\Steam\SteamApps\common\il-2 sturmovik cliffs of dover\parts\bob\speech\de ou gb.