Storm of When
05-02-2012, 01:48 PM
Hi,
Could one of you really clever chaps edit this file so that all the actors are cleared at the end of each map, I`ve tried to write the correct text in but have failed miserably. Thx.
using System;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;
using part;
using System.Threading;
using System.IO;
public class Mission : AMission
{
public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
{
base.OnPlaceEnter(player, actor, placeIndex);
AiAircraft aircraft = actor as AiAircraft;
if (aircraft != null)
switch (aircraft.Army())
{
case 1:
if (aircraft.Type() == AircraftType.Bomber)
{ GamePlay.gpHUDLogCenter(new Player[] {player},"You should bomb tankers in Folkestone-Wissant. Цель-танкеры в Фолкстон-Виссан."); }
else { GamePlay.gpHUDLogCenter(new Player[] { player }, "You should cover bombers in Folkestone-Wissant. Прикрыть бомберы в Фолкстон-Виссан."); }
break;
case 2:
if (aircraft.Type() == AircraftType.Bomber)
{ GamePlay.gpHUDLogCenter(new Player[] { player }, "You should bomb tankers in Folkestone-Wissant. Цель-танкеры в Фолкстон-Виссан."); }
else { GamePlay.gpHUDLogCenter(new Player[] { player }, "You should cover bombers in Folkestone-Wissant. Прикрыть бомберы в Фолкстон-Виссан."); }
break;
}
}
public override void OnTickGame()
{
// loads the 1st sub-mission in 12 min and repeates it every 80 min.
if (Time.tickCounter() % 144000 == 21600) // 144000 = 80 min repeat. 21600 = 12 min delay.
// pls. note!!! the 1st figure above must be always larger than 2nd!
{
GamePlay.gpPostMissionLoad("missions/BF/submissions/redships.mis");
// prints message on screen after mission load
GamePlay.gpHUDLogCenter("New allies ships in E6!");
}
// loads the 2nd sub-mission, etc. the same way
if (Time.tickCounter() % 144000 == 72000) // 144000 = 80 min repeat, 75000 = 40 min delay.
{
GamePlay.gpPostMissionLoad("missions/BF/submissions/blueships.mis");
GamePlay.gpHUDLogCenter("New axis ships in I5!");
}
// loads the 3rd sub-mission
if (Time.tickCounter() % 27000 == 26999) // 27000 = 15 min repeat, 26999 = 15 min delay
{
GamePlay.gpPostMissionLoad("missions/BF/submissions/redplanes.mis");
//GamePlay.gpHUDLogCenter("New allies planes in E6!");
// сообщение через 1 минуту
double initTime = 0.0;
Timeout(initTime += 60, () =>
{
GamePlay.gpHUDLogCenter("New allies planes in E6!");
});
}
// loads the 4th sub-mission
if (Time.tickCounter() % 27000 == 1800) // 15 min repeat, 1800 = 1 min delay
{
GamePlay.gpPostMissionLoad("missions/BF/submissions/blueplanes.mis");
//GamePlay.gpHUDLogCenter("New axis planes in I5!");
// сообщение через 1 минуту
double initTime = 0.0;
Timeout(initTime += 60, () =>
{
GamePlay.gpHUDLogCenter("New axis planes in I5!");
});
}
}
}
Could one of you really clever chaps edit this file so that all the actors are cleared at the end of each map, I`ve tried to write the correct text in but have failed miserably. Thx.
using System;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;
using part;
using System.Threading;
using System.IO;
public class Mission : AMission
{
public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
{
base.OnPlaceEnter(player, actor, placeIndex);
AiAircraft aircraft = actor as AiAircraft;
if (aircraft != null)
switch (aircraft.Army())
{
case 1:
if (aircraft.Type() == AircraftType.Bomber)
{ GamePlay.gpHUDLogCenter(new Player[] {player},"You should bomb tankers in Folkestone-Wissant. Цель-танкеры в Фолкстон-Виссан."); }
else { GamePlay.gpHUDLogCenter(new Player[] { player }, "You should cover bombers in Folkestone-Wissant. Прикрыть бомберы в Фолкстон-Виссан."); }
break;
case 2:
if (aircraft.Type() == AircraftType.Bomber)
{ GamePlay.gpHUDLogCenter(new Player[] { player }, "You should bomb tankers in Folkestone-Wissant. Цель-танкеры в Фолкстон-Виссан."); }
else { GamePlay.gpHUDLogCenter(new Player[] { player }, "You should cover bombers in Folkestone-Wissant. Прикрыть бомберы в Фолкстон-Виссан."); }
break;
}
}
public override void OnTickGame()
{
// loads the 1st sub-mission in 12 min and repeates it every 80 min.
if (Time.tickCounter() % 144000 == 21600) // 144000 = 80 min repeat. 21600 = 12 min delay.
// pls. note!!! the 1st figure above must be always larger than 2nd!
{
GamePlay.gpPostMissionLoad("missions/BF/submissions/redships.mis");
// prints message on screen after mission load
GamePlay.gpHUDLogCenter("New allies ships in E6!");
}
// loads the 2nd sub-mission, etc. the same way
if (Time.tickCounter() % 144000 == 72000) // 144000 = 80 min repeat, 75000 = 40 min delay.
{
GamePlay.gpPostMissionLoad("missions/BF/submissions/blueships.mis");
GamePlay.gpHUDLogCenter("New axis ships in I5!");
}
// loads the 3rd sub-mission
if (Time.tickCounter() % 27000 == 26999) // 27000 = 15 min repeat, 26999 = 15 min delay
{
GamePlay.gpPostMissionLoad("missions/BF/submissions/redplanes.mis");
//GamePlay.gpHUDLogCenter("New allies planes in E6!");
// сообщение через 1 минуту
double initTime = 0.0;
Timeout(initTime += 60, () =>
{
GamePlay.gpHUDLogCenter("New allies planes in E6!");
});
}
// loads the 4th sub-mission
if (Time.tickCounter() % 27000 == 1800) // 15 min repeat, 1800 = 1 min delay
{
GamePlay.gpPostMissionLoad("missions/BF/submissions/blueplanes.mis");
//GamePlay.gpHUDLogCenter("New axis planes in I5!");
// сообщение через 1 минуту
double initTime = 0.0;
Timeout(initTime += 60, () =>
{
GamePlay.gpHUDLogCenter("New axis planes in I5!");
});
}
}
}