Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   FMB, Mission & Campaign builder Discussions (http://forum.fulqrumpublishing.com/forumdisplay.php?f=203)
-   -   Help!!!! please (http://forum.fulqrumpublishing.com/showthread.php?t=31687)

Storm of When 05-02-2012 01:48 PM

Help!!!! please
 
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!");
});

}
}





}

Troll2k 05-02-2012 05:59 PM

Ataros' sticky at the top of this page might have an example for you.


All times are GMT. The time now is 10:28 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.