ok tried it, but i still dont know when and how i use those parts....
this is what i have so far....
PHP Code:
using System;
using maddox.game;
using maddox.game.world;
using System.Collections.Generic;
public class Mission : AMission
{
public override void OnBattleStarted()
{
base.OnBattleStarted();
MissionNumberListener = -1;
}
public override void OnActorCreated(int missionNumber, string shortName, AiActor actor)
{
base.OnActorCreated(missionNumber, shortName, actor);
if (actor is AiAircraft)
{
switch ((actor as AiAircraft).InternalTypeName())
{
case "bob:Aircraft.He-111P-2":
Timeout(420, () => // Time in Seconds
{
(actor as AiAircraft).Destroy();
});
break;
}
}
}
public override void OnTickGame()
{
Random ZufaelligeMission = new Random();
switch (ZufaelligeMission.Next(1,5))
{
case 1:
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\mission1.mis");
break;
case 2:
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission2.mis");
break;
case 3:
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission3.mis");
break;
case 4:
GamePlay.gpPostMissionLoad("missions\\Single\\apocalypseLondon\\mission4.mis");
break;
}
}
}
}
}
there is a main mission, with a bf109 and 9He's(which should be destroyed after xx seconds)
after xx seconds i want the game to load one mission ,selected randomly out of 4 submissions.
i also want the He's loaded with the submission to be destroyed after the xx seconds, like the ones from the main mission.
and i want the game to repeat that process, so that every xx seconds a new mission is loaded randomly.....so that the mission can run forever