Thread: Tigger INFO:
View Single Post
  #1  
Old 06-28-2012, 01:53 PM
king1hw king1hw is offline
Approved Member
 
Join Date: Jul 2010
Posts: 64
Default Tigger INFO:

In the Script below it sends the information to all pilots how do I set hud messages to only go to red or blue.

using System;
using maddox.game;
using maddox.game.world;
using System.Collections.Generic;

public class Mission : AMission
{

public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);

if ("Trigger2All".Equals(shortName) && active)
{
AiAction action = GamePlay.gpGetAction("Trigger2All");
if (action != null)
{
action.Do();
}
GamePlay.gpGetTrigger(shortName).Enable = false;
}

if ("ScoreBlue50".Equals(shortName) && active) //Trigger 1 Message
{
GamePlay.gpHUDLogCenter("The LW succeeded and inflicted heavy damage on Port of Dover");
GamePlay.gpGetTrigger(shortName).Enable = false;
}

if ("ScoreRed51".Equals(shortName) && active) //Trigger 1 Message
{
GamePlay.gpHUDLogCenter("The RAF inflicted heavy losses on the LW bombers");
GamePlay.gpGetTrigger(shortName).Enable = false;
}

if ("ScoreRed49".Equals(shortName) && active) //Trigger 2 Message
{
GamePlay.gpHUDLogCenter("The RAF inflicted heavy losses on the LW bombers");
GamePlay.gpGetTrigger(shortName).Enable = false;
}

if ("Trigger2All".Equals(shortName) && active) //Trigger 2 Message
{
GamePlay.gpHUDLogCenter("German build-up over Calais plotted, heading N!");
GamePlay.gpGetTrigger(shortName).Enable = false;
}

}

public override void OnTickGame()
{
if (Time.tickCounter() % 864000 == 63000) // 864000 = 8 hour repeat, 63000 = 35 min delay.
{
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/July1940_v10/Missionen/Mission2.mis");

List<Player> players = new List<Player>();
if (GamePlay.gpPlayer() != null)
players.Add(GamePlay.gpPlayer());
if (GamePlay.gpRemotePlayers() != null)
players.AddRange(GamePlay.gpRemotePlayers());

Player[] Reds = players.FindAll(item => item.Army() == 1).ToArray();
Player[] Blues = players.FindAll(item => item.Army() == 2).ToArray();

if (Reds.Length > 0)
{
GamePlay.gpHUDLogCenter(Reds, "RAF- Fly CAP between Calais and Dover", new object[] { }, 5);
GamePlay.gpLogServer(Reds, "RAF- Fly CAP between Calais and Dover", new object[] { });
}
if (Blues.Length > 0)
{
GamePlay.gpHUDLogCenter(Blues, "LW- Meet a flight of HE111's 5000m over Calais. Escort them to Dover!", new object[] { }, 5);
GamePlay.gpLogServer(Blues, "LW- Meet a flight of HE111's 5000m over Calais.\n In appr. 10 minutes into mission! Escort them to Dover!", new object[] { });
}
}
}

//Section 4 : AI remove

public override void OnActorCreated(int missionNumber, string shortName, AiActor actor)
{
base.OnActorCreated(missionNumber, shortName, actor);
if (actor is AiGroundActor)
Timeout(3599, () =>
{
if (actor != null)
{ (actor as AiGroundActor).Destroy(); }
}
);
}

}
Reply With Quote