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)
-   -   Ghosts and Bermuda Triangle Stuff (http://forum.fulqrumpublishing.com/showthread.php?t=30851)

5./JG27.Farber 04-01-2012 11:14 AM

Ghosts and Bermuda Triangle Stuff
 
Late last night we were testing a new mission on our dedicated server. Our missions are modula, for example, we have spawns as one maps, ground objects as another which loads instantaneously, then air missions which load throughout the time the maps up for - Usually three of them. So anyway, we are waiting over one of the targets and nothing shows up... OK so we turn external views on. One of the air missions is set to load within two mins of the mission starting and it does.


So in external view I follow the bombers. I can see what I thought was the next flight in the distance, so I cycle through the blue air objects. I can get hold of them, then I notice they are comming back from england! The ones Im looking at are going to England! Its the same flight on the homeward leg! Then bamm the outward bound bombers fly into a warm hole and vanish! Then their future selves vanish aswell!

The same thing happens with the next bombers.

ok what makes aircraft vanish - The despawn script! We removed it and there were no ghosts and the bombers went on their merry way...

This actually took 4 hours!


Anyone else had simular things happen? :confused::confused:

FG28_Kodiak 04-01-2012 02:00 PM

Yes i know this problem, best way to avoid this, is to store the Actors in a list (via OnActorCreator) and destroy the Actors with this list. Or to attach a landing Waypoint to the Aircraft and then destroy the Planes after landing.

_79_dev 04-01-2012 02:09 PM

Any chance for OnActorCreator list script example Pleas...

FG28_Kodiak 04-01-2012 02:52 PM

This i created for testing purposes:

Code:

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


public class Mission : AMission
{

    #region InGameActors
   
   

    internal class InGameActors
    {

        internal class Actor
        {
            internal bool destroyed = false;
            internal AiActor actor { get; set; }
            internal DateTime CreationTime { get; set; }
            internal int MissionNumber { get; set; }

            public Actor(AiActor actor, int missionNumber)
            {
                this.actor = actor;
                this.CreationTime = DateTime.Now;
                this.MissionNumber = missionNumber;
                this.destroyed = false;
            }
        }


        internal List<Actor> ActorsInGame = new List<Actor>();


        private bool IsActorDestroyable(AiActor actor)
        {
            bool ActorDestroyable = true;

            //Check if actor is empty (no Player)
            if (actor is AiCart)
            {
                if ((actor as AiCart).ExistCabin(0))
                    for (int i = 0; i < (actor as AiCart).Places(); i++)
                    {
                        if ((actor as AiCart).Player(i) != null)
                        {
                            ActorDestroyable = false;
                            break;
                        }
                    }
            }

            return ActorDestroyable;
        }


        private void destroyActor(AiActor actor)
        {
            if (actor != null)
                if (actor is AiCart)
                    (actor as AiCart).Destroy();
        }


        public void Add(AiActor actor, int missionNumber)
        {
            if (actor != null && actor is AiCart)
                ActorsInGame.Add(new Actor(actor, missionNumber));
        }


        public void Removeable(AiActor actor)
        {
            if (ActorsInGame.Exists(item => item.actor == actor))
                ActorsInGame[ActorsInGame.FindIndex(item => item.actor == actor)].destroyed = true;
        }


        public List<AiActor> GetActors()
        {
            List<AiActor> tmpActors = new List<AiActor>();

            ActorsInGame.ForEach(item => { tmpActors.Add(item.actor); });

            return tmpActors;
        }


        public void DestroyActor(AiActor actor)
        {
            if (ActorsInGame.Exists(item => item.actor == actor))
            {
                int i = ActorsInGame.FindIndex(item => item.actor == actor);

                if (IsActorDestroyable(ActorsInGame[i].actor))
                {
                    destroyActor(ActorsInGame[i].actor);
                }
            }
            ActorsInGame.RemoveAll(item => item.destroyed == true);
        }


        public void DestroyActors(int missionNumber)
        {

            if (missionNumber == -1)
            {
                ActorsInGame.ForEach(item => { if (IsActorDestroyable(item.actor)) destroyActor(item.actor); });
            }
            else if (ActorsInGame.Exists(item => item.MissionNumber == missionNumber))
                ActorsInGame.ForEach(item =>
                {
                    if (item.MissionNumber == missionNumber)
                        if (IsActorDestroyable(item.actor))
                            destroyActor(item.actor);
                });
            ActorsInGame.RemoveAll(item => item.destroyed == true);
        }


        public void DestroyActors(int missionNumber, int army)
        {
            if (ActorsInGame.Exists(item => item.MissionNumber == missionNumber && item.actor.Army() == army))
                ActorsInGame.ForEach(item =>
                {
                    if (item.MissionNumber == missionNumber && item.actor.Army() == army)
                        if (IsActorDestroyable(item.actor))
                            destroyActor(item.actor);
                });
            ActorsInGame.RemoveAll(item => item.destroyed == true);
        }


        public void DestroyActors(Point3d Position, double Radius)
        {

            if (ActorsInGame.Exists(item => item.actor.Pos().distance(ref Position) < Radius))
                ActorsInGame.ForEach(item =>
                {
                    if (item.actor.Pos().distance(ref Position) < Radius)
                        if (IsActorDestroyable(item.actor))
                            destroyActor(item.actor);
                });
            ActorsInGame.RemoveAll(item => item.destroyed == true);
        }


        public void DestroyActors(int missionNumber, Point3d Position, double Radius)
        {

            if (ActorsInGame.Exists(item => (item.MissionNumber == missionNumber && item.actor.Pos().distance(ref Position) < Radius)))
                ActorsInGame.ForEach(item =>
                {
                    if (item.MissionNumber == missionNumber && item.actor.Pos().distance(ref Position) < Radius)
                        if (IsActorDestroyable(item.actor))
                            destroyActor(item.actor);
                });
            ActorsInGame.RemoveAll(item => item.destroyed == true);
        }


        public void DestroyActors(int missionNumber, params AiGroundActorType[] types)
        {
            foreach (AiGroundActorType abat in types)
            {

                if (ActorsInGame.Exists(item => item.MissionNumber == missionNumber && (item.actor as AiGroundActor).Type() == abat))
                    ActorsInGame.ForEach(item =>
                    {
                        if (item.MissionNumber == missionNumber && (item.actor as AiGroundActor).Type() == abat)
                            if (IsActorDestroyable(item.actor))
                                destroyActor(item.actor);
                    });
            }
            ActorsInGame.RemoveAll(item => item.destroyed == true);
        }


        public void DestroyActors(TimeSpan DestroyAfterTime)
        {
            DateTime tmpTime = DateTime.Now.Subtract(DestroyAfterTime);

            if (ActorsInGame.Exists(item => item.CreationTime <= tmpTime))
                ActorsInGame.ForEach(item =>
                {
                    if (item.CreationTime <= tmpTime)
                        if (IsActorDestroyable(item.actor))
                            destroyActor(item.actor);
                });
            ActorsInGame.RemoveAll(item => item.destroyed == true);
        }


        public void DestroyActors(params AiGroundActorType[] types)
        {

            foreach (AiGroundActorType abat in types)
            {
                if (ActorsInGame.Exists(item => (item.actor is AiGroundActor) && (item.actor as AiGroundActor).Type() == abat))
                    ActorsInGame.ForEach(item =>
                    {
                        if ((item.actor is AiGroundActor) && (item.actor as AiGroundActor).Type() == abat)
                            if (IsActorDestroyable(item.actor))
                                destroyActor(item.actor);
                    });
            }
            ActorsInGame.RemoveAll(item => item.destroyed == true);
        }

    }

    #endregion


    #region Messages



    private void sendChatMessage(string msg, params object[] args)
    {
        GamePlay.gpLogServer(null, msg, args);
    }


    private void sendChatMessage(Player player, string msg, params object[] args)
    {
        if (player != null)
            GamePlay.gpLogServer(new Player[] { player }, msg, args);
    }


    private void sendChatMessage(int army, string msg, params object[] args)
    {
        List<Player> Consignees = new List<Player>();

        if (GamePlay.gpPlayer() != null)
            Consignees.Add(GamePlay.gpPlayer());
        if (GamePlay.gpRemotePlayers() != null)
            Consignees.AddRange(GamePlay.gpRemotePlayers());

        if (army == -1)
            GamePlay.gpLogServer(null, msg, args);
        else if (Consignees.Exists(item => item.Army() == army))
            GamePlay.gpLogServer(Consignees.FindAll(item => item.Army() == army).ToArray(), msg, args);
    }


    private void sendScreenMessage(string msg, params object[] args)
    {
        GamePlay.gpHUDLogCenter(null, msg, args);
    }


    private void sendScreenMessage(Player player, string msg, params object[] args)
    {
        if (player != null)
            GamePlay.gpHUDLogCenter(new Player[] { player }, msg, args);
    }


    private void sendScreenMessage(int army, string msg, params object[] args)
    {
        List<Player> Consignees = new List<Player>();

        if (GamePlay.gpPlayer() != null)
            Consignees.Add(GamePlay.gpPlayer());
        if (GamePlay.gpRemotePlayers() != null)
            Consignees.AddRange(GamePlay.gpRemotePlayers());

        if (army == -1)
            GamePlay.gpHUDLogCenter(null, msg, args);
        else if (Consignees.Exists(item => item.Army() == army))
            GamePlay.gpHUDLogCenter(Consignees.FindAll(item => item.Army() == army).ToArray(), msg, args);
    }

    #endregion

    Stopwatch MissionTimer = new Stopwatch();


    internal InGameActors ActorList = new InGameActors();

    public override void OnBattleStarted()
    {
        base.OnBattleStarted();

        MissionNumberListener = -1;
       
        //GamePlay.gpPostMissionLoad("missions/Tests/DestroyTestSub1.mis");

        MissionTimer.Start();
    }


    public override void OnActorCreated(int missionNumber, string shortName, AiActor actor)
    {
        base.OnActorCreated(missionNumber, shortName, actor);

        ActorList.Add(actor, missionNumber);
    }


    public override void OnActorDestroyed(int missionNumber, string shortName, AiActor actor)
    {
        base.OnActorDestroyed(missionNumber, shortName, actor);

        ActorList.Removeable(actor);


    }


    TimeSpan DestroyAfter = new TimeSpan(0, 1, 0); // Destroyafter set to one minute


    public override void OnTickGame()
    {
        base.OnTickGame();

        if (MissionTimer.Elapsed.TotalSeconds >= 10)
        {
            sendChatMessage("MissionNr: {0}", GamePlay.gpNextMissionNumber());


            //Point3d test = new Point3d(40128.09, 20605.83, 0);


            foreach (AiActor ac in ActorList.GetActors())
                sendChatMessage("Actor: {0}", ac.Name());


            //InGameGroundActors.DestroyActors(AiGroundActorType.Tank, AiGroundActorType.AAGun);

            ActorList.DestroyActors(-1);

            //InGameGroundActors.DestroyActors(1, AiGroundActorType.Artillery);

            //InGameGroundActors.DestroyActors(GamePlay.gpPlayer().Place().Pos(), 300.0);

            //if (GamePlay.gpNextMissionNumber() - 1 >0)
            //    InGameGroundActors.DestroyActors(GamePlay.gpNextMissionNumber() - 1);

            //GamePlay.gpPostMissionLoad("missions/Training/DestroyTestSub1.mis");

            sendChatMessage("-----------------");


            foreach (AiActor ac in ActorList.GetActors())
                sendChatMessage("Actor: {0}", ac.Name());

            MissionTimer.Reset();
        }
    }
}


_79_dev 04-02-2012 08:18 AM

PHP Code:


    
#region Messages



    
private void sendChatMessage(string msgparams object[] args)
    {
        
GamePlay.gpLogServer(nullmsgargs);
    }


    private 
void sendChatMessage(Player playerstring msgparams object[] args)
    {
        if (
player != null)
            
GamePlay.gpLogServer(new Player[] { player }, msgargs);
    }


    private 
void sendChatMessage(int armystring msgparams object[] args)
    {
        List<
PlayerConsignees = new List<Player>();

        if (
GamePlay.gpPlayer() != null)
            
Consignees.Add(GamePlay.gpPlayer());
        if (
GamePlay.gpRemotePlayers() != null)
            
Consignees.AddRange(GamePlay.gpRemotePlayers());

        if (
army == -1)
            
GamePlay.gpLogServer(nullmsgargs);
        else if (
Consignees.Exists(item => item.Army() == army))
            
GamePlay.gpLogServer(Consignees.FindAll(item => item.Army() == army).ToArray(), msgargs);
    }


    private 
void sendScreenMessage(string msgparams object[] args)
    {
        
GamePlay.gpHUDLogCenter(nullmsgargs);
    }


    private 
void sendScreenMessage(Player playerstring msgparams object[] args)
    {
        if (
player != null)
            
GamePlay.gpHUDLogCenter(new Player[] { player }, msgargs);
    }


    private 
void sendScreenMessage(int armystring msgparams object[] args)
    {
        List<
PlayerConsignees = new List<Player>();

        if (
GamePlay.gpPlayer() != null)
            
Consignees.Add(GamePlay.gpPlayer());
        if (
GamePlay.gpRemotePlayers() != null)
            
Consignees.AddRange(GamePlay.gpRemotePlayers());

        if (
army == -1)
            
GamePlay.gpHUDLogCenter(nullmsgargs);
        else if (
Consignees.Exists(item => item.Army() == army))
            
GamePlay.gpHUDLogCenter(Consignees.FindAll(item => item.Army() == army).ToArray(), msgargs);
    }

    
#endregion

    
Stopwatch MissionTimer = new Stopwatch();


    
internal InGameActors ActorList = new InGameActors();

    public 
override void OnBattleStarted()
    {
        
base.OnBattleStarted();

        
MissionNumberListener = -1;
        
        
//GamePlay.gpPostMissionLoad("missions/Tests/DestroyTestSub1.mis");

        
MissionTimer.Start();
    }


    public 
override void OnActorCreated(int missionNumberstring shortNameAiActor actor)
    {
        
base.OnActorCreated(missionNumbershortNameactor);

        
ActorList.Add(actormissionNumber);
    }


    public 
override void OnActorDestroyed(int missionNumberstring shortNameAiActor actor)
    {
        
base.OnActorDestroyed(missionNumbershortNameactor);

        
ActorList.Removeable(actor);


    }


    
TimeSpan DestroyAfter = new TimeSpan(010); // Destroyafter set to one minute


    
public override void OnTickGame()
    {
        
base.OnTickGame();

        if (
MissionTimer.Elapsed.TotalSeconds >= 10)
        {
            
sendChatMessage("MissionNr: {0}"GamePlay.gpNextMissionNumber());


            
//Point3d test = new Point3d(40128.09, 20605.83, 0);


            
foreach (AiActor ac in ActorList.GetActors())
                
sendChatMessage("Actor: {0}"ac.Name());


            
//InGameGroundActors.DestroyActors(AiGroundActorType.Tank, AiGroundActorType.AAGun);

            
ActorList.DestroyActors(-1);

            
//InGameGroundActors.DestroyActors(1, AiGroundActorType.Artillery);

            //InGameGroundActors.DestroyActors(GamePlay.gpPlayer().Place().Pos(), 300.0);

            //if (GamePlay.gpNextMissionNumber() - 1 >0)
            //    InGameGroundActors.DestroyActors(GamePlay.gpNextMissionNumber() - 1);

            //GamePlay.gpPostMissionLoad("missions/Training/DestroyTestSub1.mis");

            
sendChatMessage("-----------------");


            foreach (
AiActor ac in ActorList.GetActors())
                
sendChatMessage("Actor: {0}"ac.Name());

            
MissionTimer.Reset();
        }
    } 

This part o script is causing console errors with my original script. What is this part of script needed for except sending messages to console?

FG28_Kodiak 04-02-2012 08:25 AM

Which errormessage? Without i can't say where the problem is.

_79_dev 04-02-2012 10:11 AM

PHP Code:


//$reference IL2ClodCommanderStats.dll
// v.1_0. script by FG28_Kodiak, ZaltysZ, Oreva, Small_Bee, RAF238thWildWillie
using System;
using System.Diagnostics;
using System.Collections;
using maddox.GP;
using maddox.game;
using maddox.game.world;
using part;
using System.Collections.Generic;
using IL2ClodCommanderStats;


public class 
Mission AMission
{
    
#region Stats Initialization
    // For Connection to the IL2 Clod Commander Application
    // This allows you to store stats on players within Cliffs of Dover
    //  Change the following to meet your needs
    //
    
private static string serverName "5. JG 27 Server";
    private static 
string serverIP "127.0.0.1";
    
    
// Password is not used currently
    
private static string serverPassword "password";
    private static 
Int32  serverPort 27015;
    private 
StatsRecording stats = new StatsRecording(serverNameserverIPserverPasswordserverPort);
    private 
Dictionary<StringAiActorallActors = new Dictionary<StringAiActor>();
    private List<
ServerCommandnewCmds = new List<ServerCommand>();
    private 
Stopwatch MissionTimer = new Stopwatch();
    
#endregion

    
int LastMissionLoaded 0;

    
double initTime;


    private 
void sendChatMessage(string msgparams object[] args)
    {
        
GamePlay.gpLogServer(nullmsgargs);
    }


    private 
void sendChatMessage(Player playerstring msgparams object[] args)
    {
        if (
player != null)
            
GamePlay.gpLogServer(new Player[] { player }, msgargs);
    }


    private 
void sendChatMessage(int armystring msgparams object[] args)
    {
        List<
PlayerConsignees = new List<Player>();

        if (
GamePlay.gpPlayer() != null)
            
Consignees.Add(GamePlay.gpPlayer());
        if (
GamePlay.gpRemotePlayers() != null)
            
Consignees.AddRange(GamePlay.gpRemotePlayers());

        if (
army == -1)
            
GamePlay.gpLogServer(nullmsgargs);
        else if (
Consignees.Exists(item => item.Army() == army))
            
GamePlay.gpLogServer(Consignees.FindAll(item => item.Army() == army).ToArray(), msgargs);
    }




    
// loading sub-missions
    
public override void OnTickGame()
    {
          
#region Stats Timer
          
if (MissionTimer.Elapsed.TotalSeconds >= 5// 5 seconds
        
{
            
MissionTimer.Restart(); // stopwatch reset to 0 and restart
            
if (stats != null )
            {
               
newCmds stats.getCommands();
               if (
newCmds != null && newCmds.Count 0)
                   
ProcessCommands(newCmds);
            }
        }
        
#endregion
/////////////////////////////Missions timers here
       

// loads ground
       
if (Time.tickCounter() % 2592000 == 300)  
       {
           
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/adlertag/adlertag_ground.mis");
    
       }

// loads Mission1
       
if (Time.tickCounter() % 2592000 == 18000)  
       {
           
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/adlertag/adlertag_Air1blue20.mis");
                      
       }

    

// loads Mission2
       
if (Time.tickCounter() % 2592000 == 72000)  
       {
           
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/adlertag/adlertag_Air3red50.mis");
           
           
       }

// loads Mission3
       
if (Time.tickCounter() % 2592000 == 129600)  
       {
           
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/adlertag/adlertag_Air2blue35.mis");
          
           
       }


////////////////////////////End Missions Timer Region
      
}

////////////////////////////
// Base Scripts for Missions
  
private bool isAiControlledPlane (AiAircraft aircraft
  {
        if (
aircraft == null
        { 
            return 
false;
        }

        
Player [] players GamePlay.gpRemotePlayers ();
        foreach (
Player p in players
        {    
            if (
!= null && (p.Place () is AiAircraft) && (p.Place () as AiAircraft) == aircraft)
            { 
                return 
false;
            }
        }

        return 
true;
    }

    private 
void destroyPlane (AiAircraft aircraft) {
        if (
aircraft != null) { 
            
aircraft.Destroy ();
        }
    }

    private 
void explodeFuelTank (AiAircraft aircraft
  {
        if (
aircraft != null
        { 
            
aircraft.hitNamed (part.NamedDamageTypes.FuelTank0Exploded);
        }
    }

    private 
void destroyAiControlledPlane (AiAircraft aircraft) {
        if (
isAiControlledPlane (aircraft)) {
            
destroyPlane (aircraft);
        }
    }

    private 
void damageAiControlledPlane (AiActor actor) {
        if (
actor == null || !(actor is AiAircraft)) { 
            return;
        }

        
AiAircraft aircraft = (actor as AiAircraft);

        if (!
isAiControlledPlane (aircraft)) {
            return;
        }

        if (
aircraft == null) { 
            return;
        }

        
aircraft.hitNamed (part.NamedDamageTypes.ControlsElevatorDisabled);
        
aircraft.hitNamed (part.NamedDamageTypes.ControlsAileronsDisabled);
        
aircraft.hitNamed (part.NamedDamageTypes.ControlsRudderDisabled);
        
aircraft.hitNamed (part.NamedDamageTypes.FuelPumpFailure);

        
int iNumOfEngines = (aircraft.Group() as AiAirGroup).aircraftEnginesNum();
        for (
int i 0iNumOfEnginesi++)
        {
            
aircraft.hitNamed((part.NamedDamageTypes)Enum.Parse(typeof(part.NamedDamageTypes), "Eng" i.ToString() + "TotalFailure"));
        }

        
/***Timeout (240, () =>
                {explodeFuelTank (aircraft);}
            );
         * ***/

        
Timeout (300, () =>
                {
destroyPlane (aircraft);}
            );
    }

  public 
override void Init(maddox.game.ABattle battleint missionNumber)
  {
        
base.Init(battlemissionNumber);
        
MissionNumberListener = -1//Listen to events of every mission
  
}

//////////////////////////////////////////
// Methods for Stats (You can add any code you may need after the Stats Region
//////////////////////////////////////////

    
public override void OnBattleStarted()
    {
        
base.OnBattleStarted();
        
#region Stats
           
MissionTimer.Start(); // start the stopwatch
        #endregion
    
}

    private 
void sendScreenMessageTo(int armystring msgobject[] parms)
    {
        List<
PlayerPlayers = new List<Player>();

        
// on Dedi the server or for singleplayertesting
        
if (GamePlay.gpPlayer() != null)
        {
            if (
GamePlay.gpPlayer().Army() == army || army == -1)
                
Players.Add(GamePlay.gpPlayer());
        }
        if (
GamePlay.gpRemotePlayers() != null || GamePlay.gpRemotePlayers().Length 0)
        {
            foreach (
Player p in GamePlay.gpRemotePlayers())
            {
                if (
p.Army() == army || army == -1)
                    
Players.Add(p);
            }
        }
        if (
Players != null && Players.Count 0)
            
GamePlay.gpHUDLogCenter(Players.ToArray(), msgparms);
    }

    private 
void ProcessCommands(List<ServerCommandnewCmds)
    {
        try
        {
            foreach (
ServerCommand sc in newCmds)
            {
                if (
sc.CommandType.Equals("HUDmsg"))
                {
                    if (
sc.ToWho.Equals("All"))
                        
GamePlay.gpHUDLogCenter(sc.Command);
                  else if (
sc.ToWho.Equals("Red"))
                    {
                        
sendScreenMessageTo(1sc.Commandnull);
                    }
                    else if (
sc.ToWho.Equals("Blue"))
                    {
                        
sendScreenMessageTo(2sc.Commandnull);
                    }
                    else
                    {
                        if (
GamePlay.gpRemotePlayers() != null || GamePlay.gpRemotePlayers().Length 0)
                        {

                            foreach (
Player p in GamePlay.gpRemotePlayers())
                            {
                                if (
p.Name() == sc.ToWho)
                                    
GamePlay.gpLogServer(new Player[] { }, sc.Commandnull);
                            }
                        }
                        
// Message is for a specific player based on player name in string sc.ToWho
                    
}
                }
            }
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.ProcessCommands - Exception: " ex);
        }
    }
 
    public 
override void OnActorCreated(int missionNumberstring shortNameAiActor actor)
    {
        
#region stats
        
base.OnActorCreated(missionNumbershortNameactor);
        
// Add actor to list of all Actors
        
if (!allActors.ContainsKey(shortName))
           
allActors.Add(shortNameactor);
        try
        {
            
stats.newActor(shortNameactor);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnActorCreated - Exception: " ex);
        }
        
#endregion

        


    
}


    public 
override void OnPersonHealth(maddox.game.world.AiPerson personmaddox.game.world.AiDamageInitiator initiatorfloat deltaHealth)
    {
        
#region stats
        
base.OnPersonHealth(personinitiatordeltaHealth);
        try
        {
            
stats.playerHealth(personinitiatordeltaHealth);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPersonHealth - Exception: " ex);
        }
        
#endregion

    
}

    public 
override void OnPersonParachuteFailed(maddox.game.world.AiPerson person)
    {
        
#region stats
        
base.OnPersonParachuteFailed(person);
        try
        {
            
stats.personParachute("Failed"person);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPersonParachuteFailed - Exception: " ex);
        }
        
#endregion
    
}

    public 
override void OnPersonParachuteLanded(maddox.game.world.AiPerson person)
    {
        
#region stats
        
base.OnPersonParachuteLanded(person);
        try
        {
            
stats.personParachute("Landed"person);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPersonParachuteLanded - Exception: " ex);
        }
        
#endregion
    
}

    public 
override void OnPlayerArmy(maddox.game.Player playerint army)
    {
        
#region stats
        
base.OnPlayerArmy(playerarmy);
        try
        {
            
stats.playerArmy(playerarmy);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPlayerArmy - Exception: " ex);
        }
        
#endregion

    
}

    public 
override void OnPlayerConnected(maddox.game.Player player)
    {
        
#region stats
        
base.OnPlayerConnected(player);
        try
        {
            
stats.pilotInfo(player);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPlayerConnected - Exception: " ex);
        }

        
#endregion
        // Your code here
    
}
    public 
override void OnPlayerDisconnected(maddox.game.Player playerstring diagnostic)
    {
        
#region stats
        
base.OnPlayerDisconnected(playerdiagnostic);
        try
        {
            
stats.playerDisconnect(playerdiagnostic);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPlayerDisconnected - Exception: " ex);
        }

        
#endregion
        // Your code here
    
}
    
    public 
override void OnPlaceEnter(Player playerAiActor actorint placeIndex)
    {
        
#region stats
        
base.OnPlaceEnter(playeractorplaceIndex);
        try
        {
            
Point2d actorPos = new Point2d(actor.Pos().xactor.Pos().y);
            
String startingGrid GamePlay.gpSectorName(actorPos.xactorPos.y).ToString();
            
stats.sortieBegin(playeractorplaceIndexactorPosstartingGrid);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPlaceEnter - Exception: " ex);
        }
        
#endregion
        //add your code here
    
}


    public 
override void OnPlaceLeave(Player playerAiActor actorint placeIndex)
    {
        
#region stats
        
base.OnPlaceLeave(playeractorplaceIndex);
        try
        {
            
stats.sortieEnd(playeractorplaceIndex);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPlaceLeave - Exception: " ex);
        }

        
#endregion
        //add your code here
        
Timeout(1, () =>
                { 
damageAiControlledPlane(actor); }
            );
    }

    public 
override void OnAircraftCrashLanded (int missionNumberstring shortNameAiAircraft aircraft)
    {
        
#region stats
        
base.OnAircraftCrashLanded (missionNumbershortNameaircraft);
        try
        {
            
Point2d actorPos = new Point2d(aircraft.Pos().xaircraft.Pos().y);
            
String gridRef GamePlay.gpSectorName(actorPos.xactorPos.y).ToString();
            
stats.aircraftLanded("CrashLanded"shortNameaircraftactorPosgridRef);
            
System.Console.WriteLine("Stats.OnAircraftCrashLanded - ("+shortName+")");
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnAircraftCrashLanded - Exception: " ex);
        }
        
#endregion
        //add your code here
        
Timeout (300, () =>
            { 
destroyPlane(aircraft); }
            );
      }

    public 
override void OnAircraftTookOff(int missionNumberstring shortNameAiAircraft aircraft)
    {
        
#region stats
        
base.OnAircraftTookOff(missionNumbershortNameaircraft);
        try
        {
            
stats.aircraftTakeoff(shortNameaircraft);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnAircraftTookOff - Exception: " ex);
        }
        
#endregion
        //add your code here

        
sendChatMessage((-1), "PLEAS VISIT www.5jg27.net TO CHECK STATS");
    }
          
    public 
override void OnAircraftLanded (int missionNumberstring shortNameAiAircraft aircraft)
    {
          
#region stats
          
base.OnAircraftLanded(missionNumbershortNameaircraft);
            try
            {
              
Point2d actorPos = new Point2d(aircraft.Pos().xaircraft.Pos().y);
             
String gridRef GamePlay.gpSectorName(actorPos.xactorPos.y).ToString();
             
stats.aircraftLanded("Landed"shortNameaircraftactorPosgridRef);
            }
            catch (
Exception ex)
            {
            
System.Console.WriteLine("Stats.OnAircraftTookOff - Exception: " ex);
            }
          
#endregion
          //add your code here
          

          
Timeout(300, () =>
            { 
destroyPlane(aircraft); }
            );
    }

    public 
override void OnActorDamaged(int missionNumberstring shortNameAiActor actorAiDamageInitiator initiatorNamedDamageTypes damageType)
    {
        
#region stats
        
base.OnActorDamaged(missionNumbershortNameactorinitiatordamageType);
        try
        {
            
stats.missionActorDamaged(shortNameactorinitiatordamageType);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnActorDamaged - Exception: " ex);
        }
        
#endregion
        //add your code here

    
}

    public 
override void OnAircraftDamaged(int missionNumberstring shortNameAiAircraft aircraftAiDamageInitiator initiatorNamedDamageTypes damageType)
    {
        
#region stats
        
base.OnAircraftDamaged(missionNumbershortNameaircraftinitiatordamageType);
        try
        {
            
stats.missionAircraftDamaged(shortNameaircraftinitiatordamageType);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnAircraftDamaged - Exception: " ex);
        }
        
#endregion
        //add your code here

    
}

    public 
override void OnAircraftCutLimb(int missionNumberstring shortNameAiAircraft aircraftAiDamageInitiator initiatorLimbNames limbName)
    {
        
#region stats
        
base.OnAircraftCutLimb(missionNumbershortNameaircraftinitiatorlimbName);
        try
        {
            
stats.missionAircraftCutLimb(shortNameaircraftinitiatorlimbName);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnAircraftCutLimb - Exception: " ex);
        }
        
#endregion
        //add your code here
    
}

    public 
override void OnActorDead(int missionNumberstring shortNameAiActor actor, List<DamagerScoredamages)
    {
        
#region stats
        
base.OnActorDead(missionNumbershortNameactordamages);
        try
        {
             
stats.missionActorDead(shortNameactordamages); 
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnActorDead - Exception: " ex);
        }
        
#endregion
        //add your code here

    
}

    public 
override void OnActorDestroyed(int missionNumberstring shortNameAiActor actor)
    {
        
#region stats
        
base.OnActorDestroyed(missionNumbershortNameactor);
        try
        {
            
stats.actorDestroyed(shortNameactor);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnActorDestroyed - Exception: " ex);
        }
        
#endregion
        //add your code here

    
}
    public 
override void OnAircraftKilled(int missionNumberstring shortNameAiAircraft aircraft)
    {
        
#region stats
        
base.OnAircraftKilled(missionNumbershortNameaircraft);
        try
        {
            
stats.aircraftKilled(shortNameaircraft);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnAircraftKilled - Exception: " ex);
        }
        
#endregion
        //add your code here

    
}

    public 
override void OnBattleStoped()
    {
        
#region stats
        
base.OnBattleStoped();
        try
        {
            
stats.battleStopped();
            
// Loop through list of AiActors and destroy them all
            
List<stringkeys = new List<string>(allActors.Keys);
            for (
int i 0keys.Counti++)
            {
                
AiActor a allActors[keys[i]];
                
AiAircraft aircraft as AiAircraft;
                if (
aircraft != null)
                {
                    
aircraft.Destroy();
                }
                else
                {
                    
AiGroundActor aiGroundActor as AiGroundActor;
                    if (
aiGroundActor != null)
                    {
                        
aiGroundActor.Destroy();
                    }
                    else
                    {
                        
System.Console.WriteLine("Stats.OnBattleStoped - Unknown Actor (" a.Name()+") ShortName ("+keys[i]+")");
                    }
                }
            }
           
// stats.disconnectStats();
        
}
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnBattleStoped - Exception: " ex);
        }
        
#endregion
        //add your code here
    
}
//////////////////////////////////////////////////////////////////////////////////////////////////


 


this is my original script above, and console error beneath

PHP Code:

(System.Exceptionc:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(856,18): error CS0111Type 'Mission' already defines a member called 'sendChatMessage' with the same parameter types)
4/2/2012 3:04:06 AM ) New (CONSOLE): (c:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(862,18): error CS0111Type 'Mission' already defines a member called 'sendChatMessage' with the same parameter types)
4/2/2012 3:04:06 AM ) New (CONSOLE): (c:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(869,18): error CS0111Type 'Mission' already defines a member called 'sendChatMessage' with the same parameter types)
4/2/2012 3:04:06 AM ) New (CONSOLE): (c:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(915,15): error CS0102The type 'Mission' already contains a definition for 'MissionTimer')
4/2/2012 3:04:06 AM ) New (CONSOLE): (c:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(920,26): error CS0111Type 'Mission' already defines a member called 'OnBattleStarted' with the same parameter types)
4/2/2012 3:04:06 AM ) New (CONSOLE): (c:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(932,26): error CS0111Type 'Mission' already defines a member called 'OnActorCreated' with the same parameter types)
4/2/2012 3:04:06 AM ) New (CONSOLE): (c:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(940,26): error CS0111Type 'Mission' already defines a member called 'OnActorDestroyed' with the same parameter types)
4/2/2012 3:04:06 AM ) New (CONSOLE): (c:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(953,26): error CS0111Type 'Mission' already defines a member called 'OnTickGame' with the same parameter types)
4/2/2012 3:04:06 AM ) New (CONSOLE): (at LB33FuQ4EXuxyJPZ68D.GrT31TQ99wLitevXpuS.ATy34ceFvFk(String Boolean Boolean ))
4/2/2012 3:04:06 AM ) New (CONSOLE): (at LB33FuQ4EXuxyJPZ68D.GrT31TQ99wLitevXpuS.3LP34ebVrCU(String ))
4/2/2012 3:04:06 AM ) New (CONSOLE): (at LB33FuQ4EXuxyJPZ68D.GrT31TQ99wLitevXpuS.gMaqT2fu7OVhvSHaMehN(Object ))
4/2/2012 3:04:06 AM ) New (CONSOLE): (at LB33FuQ4EXuxyJPZ68D.GrT31TQ99wLitevXpuS.Xi734IyswCQ(String Int32 ))
4/2/2012 3:04:06 AM ) New (CONSOLE): (=================================================)
4/2/2012 3:04:06 AM ) New (CONSOLE): (=================================================)
4/2/2012 3:04:06 AM ) New (CONSOLE): (System.Exceptionc:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(856,18): error CS0111Type 'Mission' already defines a member called 'sendChatMessage' with the same parameter types)
4/2/2012 3:04:06 AM ) New (CONSOLE): (c:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(862,18): error CS0111Type 'Mission' already defines a member called 'sendChatMessage' with the same parameter types)
4/2/2012 3:04:06 AM ) New (CONSOLE): (c:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(869,18): error CS0111Type 'Mission' already defines a member called 'sendChatMessage' with the same parameter types)
4/2/2012 3:04:06 AM ) New (CONSOLE): (c:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(915,15): error CS0102The type 'Mission' already contains a definition for 'MissionTimer')
4/2/2012 3:04:06 AM ) New (CONSOLE): (c:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(920,26): error CS0111Type 'Mission' already defines a member called 'OnBattleStarted' with the same parameter types)
4/2/2012 3:04:06 AM ) New (CONSOLE): (c:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(932,26): error CS0111Type 'Mission' already defines a member called 'OnActorCreated' with the same parameter types)
4/2/2012 3:04:06 AM ) New (CONSOLE): (c:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(940,26): error CS0111Type 'Mission' already defines a member called 'OnActorDestroyed' with the same parameter types)
4/2/2012 3:04:06 AM ) New (CONSOLE): (c:\Users\John\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\adlertag\adlertag_Spawns.cs(953,26): error CS0111Type 'Mission' already defines a member called 'OnTickGame' with the same parameter types)
4/2/2012 3:04:06 AM ) New (CONSOLE): (at LB33FuQ4EXuxyJPZ68D.GrT31TQ99wLitevXpuS.Xi734IyswCQ(String Int32 ))
4/2/2012 3:04:06 AM ) New (CONSOLE): (at 4YQguDGg7WLABsU9pm3.T8Lw4SGw95gwTxUSs13.ySFG6YYvRQbIruAHfae(Object Int32 ))
4/2/2012 3:04:06 AM ) New (CONSOLE): (at 4YQguDGg7WLABsU9pm3.T8Lw4SGw95gwTxUSs13.sWbmrit6GT(dL3MgPdYLnmRhd1hBIK ))
4/2/2012 3:04:06 AM ) New (CONSOLE): (=================================================) 


_79_dev 04-02-2012 10:12 AM

and thats how it looks together

PHP Code:

//$reference IL2ClodCommanderStats.dll
// v.1_0. script by FG28_Kodiak, ZaltysZ, Oreva, Small_Bee, RAF238thWildWillie
using System;
using System.Diagnostics;
using System.Collections;
using maddox.GP;
using maddox.game;
using maddox.game.world;
using part;
using System.Collections.Generic;
using IL2ClodCommanderStats;


public class 
Mission AMission
{
    
#region Stats Initialization
    // For Connection to the IL2 Clod Commander Application
    // This allows you to store stats on players within Cliffs of Dover
    //  Change the following to meet your needs
    //
    
private static string serverName "5. JG 27 Server";
    private static 
string serverIP "127.0.0.1";
    
    
// Password is not used currently
    
private static string serverPassword "password";
    private static 
Int32  serverPort 27015;
    private 
StatsRecording stats = new StatsRecording(serverNameserverIPserverPasswordserverPort);
    private 
Dictionary<StringAiActorallActors = new Dictionary<StringAiActor>();
    private List<
ServerCommandnewCmds = new List<ServerCommand>();
    private 
Stopwatch MissionTimer = new Stopwatch();
    
#endregion

    
int LastMissionLoaded 0;

    
double initTime;


    private 
void sendChatMessage(string msgparams object[] args)
    {
        
GamePlay.gpLogServer(nullmsgargs);
    }


    private 
void sendChatMessage(Player playerstring msgparams object[] args)
    {
        if (
player != null)
            
GamePlay.gpLogServer(new Player[] { player }, msgargs);
    }


    private 
void sendChatMessage(int armystring msgparams object[] args)
    {
        List<
PlayerConsignees = new List<Player>();

        if (
GamePlay.gpPlayer() != null)
            
Consignees.Add(GamePlay.gpPlayer());
        if (
GamePlay.gpRemotePlayers() != null)
            
Consignees.AddRange(GamePlay.gpRemotePlayers());

        if (
army == -1)
            
GamePlay.gpLogServer(nullmsgargs);
        else if (
Consignees.Exists(item => item.Army() == army))
            
GamePlay.gpLogServer(Consignees.FindAll(item => item.Army() == army).ToArray(), msgargs);
    }




    
// loading sub-missions
    
public override void OnTickGame()
    {
          
#region Stats Timer
          
if (MissionTimer.Elapsed.TotalSeconds >= 5// 5 seconds
        
{
            
MissionTimer.Restart(); // stopwatch reset to 0 and restart
            
if (stats != null )
            {
               
newCmds stats.getCommands();
               if (
newCmds != null && newCmds.Count 0)
                   
ProcessCommands(newCmds);
            }
        }
        
#endregion
/////////////////////////////Missions timers here
       

// loads ground
       
if (Time.tickCounter() % 2592000 == 300)  
       {
           
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/adlertag/adlertag_ground.mis");
    
       }

// loads Mission1
       
if (Time.tickCounter() % 2592000 == 18000)  
       {
           
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/adlertag/adlertag_Air1blue20.mis");
                      
       }

    

// loads Mission2
       
if (Time.tickCounter() % 2592000 == 72000)  
       {
           
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/adlertag/adlertag_Air3red50.mis");
           
           
       }

// loads Mission3
       
if (Time.tickCounter() % 2592000 == 129600)  
       {
           
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/adlertag/adlertag_Air2blue35.mis");
          
           
       }


////////////////////////////End Missions Timer Region
      
}

////////////////////////////
// Base Scripts for Missions
  
private bool isAiControlledPlane (AiAircraft aircraft
  {
        if (
aircraft == null
        { 
            return 
false;
        }

        
Player [] players GamePlay.gpRemotePlayers ();
        foreach (
Player p in players
        {    
            if (
!= null && (p.Place () is AiAircraft) && (p.Place () as AiAircraft) == aircraft)
            { 
                return 
false;
            }
        }

        return 
true;
    }

    private 
void destroyPlane (AiAircraft aircraft) {
        if (
aircraft != null) { 
            
aircraft.Destroy ();
        }
    }

    private 
void explodeFuelTank (AiAircraft aircraft
  {
        if (
aircraft != null
        { 
            
aircraft.hitNamed (part.NamedDamageTypes.FuelTank0Exploded);
        }
    }

    private 
void destroyAiControlledPlane (AiAircraft aircraft) {
        if (
isAiControlledPlane (aircraft)) {
            
destroyPlane (aircraft);
        }
    }

    private 
void damageAiControlledPlane (AiActor actor) {
        if (
actor == null || !(actor is AiAircraft)) { 
            return;
        }

        
AiAircraft aircraft = (actor as AiAircraft);

        if (!
isAiControlledPlane (aircraft)) {
            return;
        }

        if (
aircraft == null) { 
            return;
        }

        
aircraft.hitNamed (part.NamedDamageTypes.ControlsElevatorDisabled);
        
aircraft.hitNamed (part.NamedDamageTypes.ControlsAileronsDisabled);
        
aircraft.hitNamed (part.NamedDamageTypes.ControlsRudderDisabled);
        
aircraft.hitNamed (part.NamedDamageTypes.FuelPumpFailure);

        
int iNumOfEngines = (aircraft.Group() as AiAirGroup).aircraftEnginesNum();
        for (
int i 0iNumOfEnginesi++)
        {
            
aircraft.hitNamed((part.NamedDamageTypes)Enum.Parse(typeof(part.NamedDamageTypes), "Eng" i.ToString() + "TotalFailure"));
        }

        
/***Timeout (240, () =>
                {explodeFuelTank (aircraft);}
            );
         * ***/

        
Timeout (300, () =>
                {
destroyPlane (aircraft);}
            );
    }

  public 
override void Init(maddox.game.ABattle battleint missionNumber)
  {
        
base.Init(battlemissionNumber);
        
MissionNumberListener = -1//Listen to events of every mission
  
}

//////////////////////////////////////////
// Methods for Stats (You can add any code you may need after the Stats Region
//////////////////////////////////////////

    
public override void OnBattleStarted()
    {
        
base.OnBattleStarted();
        
#region Stats
           
MissionTimer.Start(); // start the stopwatch
        #endregion
    
}

    private 
void sendScreenMessageTo(int armystring msgobject[] parms)
    {
        List<
PlayerPlayers = new List<Player>();

        
// on Dedi the server or for singleplayertesting
        
if (GamePlay.gpPlayer() != null)
        {
            if (
GamePlay.gpPlayer().Army() == army || army == -1)
                
Players.Add(GamePlay.gpPlayer());
        }
        if (
GamePlay.gpRemotePlayers() != null || GamePlay.gpRemotePlayers().Length 0)
        {
            foreach (
Player p in GamePlay.gpRemotePlayers())
            {
                if (
p.Army() == army || army == -1)
                    
Players.Add(p);
            }
        }
        if (
Players != null && Players.Count 0)
            
GamePlay.gpHUDLogCenter(Players.ToArray(), msgparms);
    }

    private 
void ProcessCommands(List<ServerCommandnewCmds)
    {
        try
        {
            foreach (
ServerCommand sc in newCmds)
            {
                if (
sc.CommandType.Equals("HUDmsg"))
                {
                    if (
sc.ToWho.Equals("All"))
                        
GamePlay.gpHUDLogCenter(sc.Command);
                  else if (
sc.ToWho.Equals("Red"))
                    {
                        
sendScreenMessageTo(1sc.Commandnull);
                    }
                    else if (
sc.ToWho.Equals("Blue"))
                    {
                        
sendScreenMessageTo(2sc.Commandnull);
                    }
                    else
                    {
                        if (
GamePlay.gpRemotePlayers() != null || GamePlay.gpRemotePlayers().Length 0)
                        {

                            foreach (
Player p in GamePlay.gpRemotePlayers())
                            {
                                if (
p.Name() == sc.ToWho)
                                    
GamePlay.gpLogServer(new Player[] { }, sc.Commandnull);
                            }
                        }
                        
// Message is for a specific player based on player name in string sc.ToWho
                    
}
                }
            }
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.ProcessCommands - Exception: " ex);
        }
    }
 
    public 
override void OnActorCreated(int missionNumberstring shortNameAiActor actor)
    {
        
#region stats
        
base.OnActorCreated(missionNumbershortNameactor);
        
// Add actor to list of all Actors
        
if (!allActors.ContainsKey(shortName))
           
allActors.Add(shortNameactor);
        try
        {
            
stats.newActor(shortNameactor);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnActorCreated - Exception: " ex);
        }
        
#endregion

        


    
}


    public 
override void OnPersonHealth(maddox.game.world.AiPerson personmaddox.game.world.AiDamageInitiator initiatorfloat deltaHealth)
    {
        
#region stats
        
base.OnPersonHealth(personinitiatordeltaHealth);
        try
        {
            
stats.playerHealth(personinitiatordeltaHealth);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPersonHealth - Exception: " ex);
        }
        
#endregion

    
}

    public 
override void OnPersonParachuteFailed(maddox.game.world.AiPerson person)
    {
        
#region stats
        
base.OnPersonParachuteFailed(person);
        try
        {
            
stats.personParachute("Failed"person);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPersonParachuteFailed - Exception: " ex);
        }
        
#endregion
    
}

    public 
override void OnPersonParachuteLanded(maddox.game.world.AiPerson person)
    {
        
#region stats
        
base.OnPersonParachuteLanded(person);
        try
        {
            
stats.personParachute("Landed"person);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPersonParachuteLanded - Exception: " ex);
        }
        
#endregion
    
}

    public 
override void OnPlayerArmy(maddox.game.Player playerint army)
    {
        
#region stats
        
base.OnPlayerArmy(playerarmy);
        try
        {
            
stats.playerArmy(playerarmy);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPlayerArmy - Exception: " ex);
        }
        
#endregion

    
}

    public 
override void OnPlayerConnected(maddox.game.Player player)
    {
        
#region stats
        
base.OnPlayerConnected(player);
        try
        {
            
stats.pilotInfo(player);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPlayerConnected - Exception: " ex);
        }

        
#endregion
        // Your code here
    
}
    public 
override void OnPlayerDisconnected(maddox.game.Player playerstring diagnostic)
    {
        
#region stats
        
base.OnPlayerDisconnected(playerdiagnostic);
        try
        {
            
stats.playerDisconnect(playerdiagnostic);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPlayerDisconnected - Exception: " ex);
        }

        
#endregion
        // Your code here
    
}
    
    public 
override void OnPlaceEnter(Player playerAiActor actorint placeIndex)
    {
        
#region stats
        
base.OnPlaceEnter(playeractorplaceIndex);
        try
        {
            
Point2d actorPos = new Point2d(actor.Pos().xactor.Pos().y);
            
String startingGrid GamePlay.gpSectorName(actorPos.xactorPos.y).ToString();
            
stats.sortieBegin(playeractorplaceIndexactorPosstartingGrid);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPlaceEnter - Exception: " ex);
        }
        
#endregion
        //add your code here
    
}


    public 
override void OnPlaceLeave(Player playerAiActor actorint placeIndex)
    {
        
#region stats
        
base.OnPlaceLeave(playeractorplaceIndex);
        try
        {
            
stats.sortieEnd(playeractorplaceIndex);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnPlaceLeave - Exception: " ex);
        }

        
#endregion
        //add your code here
        
Timeout(1, () =>
                { 
damageAiControlledPlane(actor); }
            );
    }

    public 
override void OnAircraftCrashLanded (int missionNumberstring shortNameAiAircraft aircraft)
    {
        
#region stats
        
base.OnAircraftCrashLanded (missionNumbershortNameaircraft);
        try
        {
            
Point2d actorPos = new Point2d(aircraft.Pos().xaircraft.Pos().y);
            
String gridRef GamePlay.gpSectorName(actorPos.xactorPos.y).ToString();
            
stats.aircraftLanded("CrashLanded"shortNameaircraftactorPosgridRef);
            
System.Console.WriteLine("Stats.OnAircraftCrashLanded - ("+shortName+")");
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnAircraftCrashLanded - Exception: " ex);
        }
        
#endregion
        //add your code here
        
Timeout (300, () =>
            { 
destroyPlane(aircraft); }
            );
      }

    public 
override void OnAircraftTookOff(int missionNumberstring shortNameAiAircraft aircraft)
    {
        
#region stats
        
base.OnAircraftTookOff(missionNumbershortNameaircraft);
        try
        {
            
stats.aircraftTakeoff(shortNameaircraft);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnAircraftTookOff - Exception: " ex);
        }
        
#endregion
        //add your code here

        
sendChatMessage((-1), "PLEAS VISIT www.5jg27.net TO CHECK STATS");
    }
          
    public 
override void OnAircraftLanded (int missionNumberstring shortNameAiAircraft aircraft)
    {
          
#region stats
          
base.OnAircraftLanded(missionNumbershortNameaircraft);
            try
            {
              
Point2d actorPos = new Point2d(aircraft.Pos().xaircraft.Pos().y);
             
String gridRef GamePlay.gpSectorName(actorPos.xactorPos.y).ToString();
             
stats.aircraftLanded("Landed"shortNameaircraftactorPosgridRef);
            }
            catch (
Exception ex)
            {
            
System.Console.WriteLine("Stats.OnAircraftTookOff - Exception: " ex);
            }
          
#endregion
          //add your code here
          

          
Timeout(300, () =>
            { 
destroyPlane(aircraft); }
            );
    }

    public 
override void OnActorDamaged(int missionNumberstring shortNameAiActor actorAiDamageInitiator initiatorNamedDamageTypes damageType)
    {
        
#region stats
        
base.OnActorDamaged(missionNumbershortNameactorinitiatordamageType);
        try
        {
            
stats.missionActorDamaged(shortNameactorinitiatordamageType);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnActorDamaged - Exception: " ex);
        }
        
#endregion
        //add your code here

    
}

    public 
override void OnAircraftDamaged(int missionNumberstring shortNameAiAircraft aircraftAiDamageInitiator initiatorNamedDamageTypes damageType)
    {
        
#region stats
        
base.OnAircraftDamaged(missionNumbershortNameaircraftinitiatordamageType);
        try
        {
            
stats.missionAircraftDamaged(shortNameaircraftinitiatordamageType);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnAircraftDamaged - Exception: " ex);
        }
        
#endregion
        //add your code here

    
}

    public 
override void OnAircraftCutLimb(int missionNumberstring shortNameAiAircraft aircraftAiDamageInitiator initiatorLimbNames limbName)
    {
        
#region stats
        
base.OnAircraftCutLimb(missionNumbershortNameaircraftinitiatorlimbName);
        try
        {
            
stats.missionAircraftCutLimb(shortNameaircraftinitiatorlimbName);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnAircraftCutLimb - Exception: " ex);
        }
        
#endregion
        //add your code here
    
}

    public 
override void OnActorDead(int missionNumberstring shortNameAiActor actor, List<DamagerScoredamages)
    {
        
#region stats
        
base.OnActorDead(missionNumbershortNameactordamages);
        try
        {
             
stats.missionActorDead(shortNameactordamages); 
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnActorDead - Exception: " ex);
        }
        
#endregion
        //add your code here

    
}

    public 
override void OnActorDestroyed(int missionNumberstring shortNameAiActor actor)
    {
        
#region stats
        
base.OnActorDestroyed(missionNumbershortNameactor);
        try
        {
            
stats.actorDestroyed(shortNameactor);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnActorDestroyed - Exception: " ex);
        }
        
#endregion
        //add your code here

    
}
    public 
override void OnAircraftKilled(int missionNumberstring shortNameAiAircraft aircraft)
    {
        
#region stats
        
base.OnAircraftKilled(missionNumbershortNameaircraft);
        try
        {
            
stats.aircraftKilled(shortNameaircraft);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnAircraftKilled - Exception: " ex);
        }
        
#endregion
        //add your code here

    
}

    public 
override void OnBattleStoped()
    {
        
#region stats
        
base.OnBattleStoped();
        try
        {
            
stats.battleStopped();
            
// Loop through list of AiActors and destroy them all
            
List<stringkeys = new List<string>(allActors.Keys);
            for (
int i 0keys.Counti++)
            {
                
AiActor a allActors[keys[i]];
                
AiAircraft aircraft as AiAircraft;
                if (
aircraft != null)
                {
                    
aircraft.Destroy();
                }
                else
                {
                    
AiGroundActor aiGroundActor as AiGroundActor;
                    if (
aiGroundActor != null)
                    {
                        
aiGroundActor.Destroy();
                    }
                    else
                    {
                        
System.Console.WriteLine("Stats.OnBattleStoped - Unknown Actor (" a.Name()+") ShortName ("+keys[i]+")");
                    }
                }
            }
           
// stats.disconnectStats();
        
}
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnBattleStoped - Exception: " ex);
        }
        
#endregion
        //add your code here
    
}
//////////////////////////////////////////////////////////////////////////////////////////////////


 

    #region InGameActors
    
    

    
internal class InGameActors
    
{

        
internal class Actor
        
{
            
internal bool destroyed false;
            
internal AiActor actor getset; }
            
internal DateTime CreationTime getset; }
            
internal int MissionNumber getset; }

            public 
Actor(AiActor actorint missionNumber)
            {
                
this.actor actor;
                
this.CreationTime DateTime.Now;
                
this.MissionNumber missionNumber;
                
this.destroyed false;
            }
        }


        
internal List<ActorActorsInGame = new List<Actor>();


        private 
bool IsActorDestroyable(AiActor actor)
        {
            
bool ActorDestroyable true;

            
//Check if actor is empty (no Player)
            
if (actor is AiCart)
            {
                if ((
actor as AiCart).ExistCabin(0))
                    for (
int i 0< (actor as AiCart).Places(); i++)
                    {
                        if ((
actor as AiCart).Player(i) != null)
                        {
                            
ActorDestroyable false;
                            break;
                        }
                    }
            }

            return 
ActorDestroyable;
        }


        private 
void destroyActor(AiActor actor)
        {
            if (
actor != null)
                if (
actor is AiCart)
                    (
actor as AiCart).Destroy();
        }


        public 
void Add(AiActor actorint missionNumber)
        {
            if (
actor != null && actor is AiCart)
                
ActorsInGame.Add(new Actor(actormissionNumber));
        }


        public 
void Removeable(AiActor actor)
        {
            if (
ActorsInGame.Exists(item => item.actor == actor))
                
ActorsInGame[ActorsInGame.FindIndex(item => item.actor == actor)].destroyed true;
        }


        public List<
AiActorGetActors()
        {
            List<
AiActortmpActors = new List<AiActor>();

            
ActorsInGame.ForEach(item => { tmpActors.Add(item.actor); });

            return 
tmpActors;
        }


        public 
void DestroyActor(AiActor actor)
        {
            if (
ActorsInGame.Exists(item => item.actor == actor))
            {
                
int i ActorsInGame.FindIndex(item => item.actor == actor);

                if (
IsActorDestroyable(ActorsInGame[i].actor))
                {
                    
destroyActor(ActorsInGame[i].actor);
                }
            }
            
ActorsInGame.RemoveAll(item => item.destroyed == true);
        }


        public 
void DestroyActors(int missionNumber)
        {

            if (
missionNumber == -1)
            {
                
ActorsInGame.ForEach(item => { if (IsActorDestroyable(item.actor)) destroyActor(item.actor); });
            }
            else if (
ActorsInGame.Exists(item => item.MissionNumber == missionNumber))
                
ActorsInGame.ForEach(item =>
                {
                    if (
item.MissionNumber == missionNumber)
                        if (
IsActorDestroyable(item.actor))
                            
destroyActor(item.actor);
                });
            
ActorsInGame.RemoveAll(item => item.destroyed == true);
        }


        public 
void DestroyActors(int missionNumberint army)
        {
            if (
ActorsInGame.Exists(item => item.MissionNumber == missionNumber && item.actor.Army() == army))
                
ActorsInGame.ForEach(item =>
                {
                    if (
item.MissionNumber == missionNumber && item.actor.Army() == army)
                        if (
IsActorDestroyable(item.actor))
                            
destroyActor(item.actor);
                });
            
ActorsInGame.RemoveAll(item => item.destroyed == true);
        }


        public 
void DestroyActors(Point3d Positiondouble Radius)
        {

            if (
ActorsInGame.Exists(item => item.actor.Pos().distance(ref Position) < Radius))
                
ActorsInGame.ForEach(item =>
                {
                    if (
item.actor.Pos().distance(ref Position) < Radius)
                        if (
IsActorDestroyable(item.actor))
                            
destroyActor(item.actor);
                });
            
ActorsInGame.RemoveAll(item => item.destroyed == true);
        }


        public 
void DestroyActors(int missionNumberPoint3d Positiondouble Radius)
        {

            if (
ActorsInGame.Exists(item => (item.MissionNumber == missionNumber && item.actor.Pos().distance(ref Position) < Radius)))
                
ActorsInGame.ForEach(item =>
                {
                    if (
item.MissionNumber == missionNumber && item.actor.Pos().distance(ref Position) < Radius)
                        if (
IsActorDestroyable(item.actor))
                            
destroyActor(item.actor);
                });
            
ActorsInGame.RemoveAll(item => item.destroyed == true);
        }


        public 
void DestroyActors(int missionNumberparams AiGroundActorType[] types)
        {
            foreach (
AiGroundActorType abat in types)
            {

                if (
ActorsInGame.Exists(item => item.MissionNumber == missionNumber && (item.actor as AiGroundActor).Type() == abat))
                    
ActorsInGame.ForEach(item =>
                    {
                        if (
item.MissionNumber == missionNumber && (item.actor as AiGroundActor).Type() == abat)
                            if (
IsActorDestroyable(item.actor))
                                
destroyActor(item.actor);
                    });
            }
            
ActorsInGame.RemoveAll(item => item.destroyed == true);
        }


        public 
void DestroyActors(TimeSpan DestroyAfterTime)
        {
            
DateTime tmpTime DateTime.Now.Subtract(DestroyAfterTime);

            if (
ActorsInGame.Exists(item => item.CreationTime <= tmpTime))
                
ActorsInGame.ForEach(item =>
                {
                    if (
item.CreationTime <= tmpTime)
                        if (
IsActorDestroyable(item.actor))
                            
destroyActor(item.actor);
                });
            
ActorsInGame.RemoveAll(item => item.destroyed == true);
        }


        public 
void DestroyActors(params AiGroundActorType[] types)
        {

            foreach (
AiGroundActorType abat in types)
            {
                if (
ActorsInGame.Exists(item => (item.actor is AiGroundActor) && (item.actor as AiGroundActor).Type() == abat))
                    
ActorsInGame.ForEach(item =>
                    {
                        if ((
item.actor is AiGroundActor) && (item.actor as AiGroundActor).Type() == abat)
                            if (
IsActorDestroyable(item.actor))
                                
destroyActor(item.actor);
                    });
            }
            
ActorsInGame.RemoveAll(item => item.destroyed == true);
        }

    }

    
#endregion


    #region Messages



    
private void sendChatMessage(string msgparams object[] args)
    {
        
GamePlay.gpLogServer(nullmsgargs);
    }


    private 
void sendChatMessage(Player playerstring msgparams object[] args)
    {
        if (
player != null)
            
GamePlay.gpLogServer(new Player[] { player }, msgargs);
    }


    private 
void sendChatMessage(int armystring msgparams object[] args)
    {
        List<
PlayerConsignees = new List<Player>();

        if (
GamePlay.gpPlayer() != null)
            
Consignees.Add(GamePlay.gpPlayer());
        if (
GamePlay.gpRemotePlayers() != null)
            
Consignees.AddRange(GamePlay.gpRemotePlayers());

        if (
army == -1)
            
GamePlay.gpLogServer(nullmsgargs);
        else if (
Consignees.Exists(item => item.Army() == army))
            
GamePlay.gpLogServer(Consignees.FindAll(item => item.Army() == army).ToArray(), msgargs);
    }


    private 
void sendScreenMessage(string msgparams object[] args)
    {
        
GamePlay.gpHUDLogCenter(nullmsgargs);
    }


    private 
void sendScreenMessage(Player playerstring msgparams object[] args)
    {
        if (
player != null)
            
GamePlay.gpHUDLogCenter(new Player[] { player }, msgargs);
    }


    private 
void sendScreenMessage(int armystring msgparams object[] args)
    {
        List<
PlayerConsignees = new List<Player>();

        if (
GamePlay.gpPlayer() != null)
            
Consignees.Add(GamePlay.gpPlayer());
        if (
GamePlay.gpRemotePlayers() != null)
            
Consignees.AddRange(GamePlay.gpRemotePlayers());

        if (
army == -1)
            
GamePlay.gpHUDLogCenter(nullmsgargs);
        else if (
Consignees.Exists(item => item.Army() == army))
            
GamePlay.gpHUDLogCenter(Consignees.FindAll(item => item.Army() == army).ToArray(), msgargs);
    }

    
#endregion

    
Stopwatch MissionTimer = new Stopwatch();


    
internal InGameActors ActorList = new InGameActors();

    public 
override void OnBattleStarted()
    {
        
base.OnBattleStarted();

        
MissionNumberListener = -1;
        
        
//GamePlay.gpPostMissionLoad("missions/Tests/DestroyTestSub1.mis");

        
MissionTimer.Start();
    }


    public 
override void OnActorCreated(int missionNumberstring shortNameAiActor actor)
    {
        
base.OnActorCreated(missionNumbershortNameactor);

        
ActorList.Add(actormissionNumber);
    }


    public 
override void OnActorDestroyed(int missionNumberstring shortNameAiActor actor)
    {
        
base.OnActorDestroyed(missionNumbershortNameactor);

        
ActorList.Removeable(actor);


    }


    
TimeSpan DestroyAfter = new TimeSpan(010); // Destroyafter set to one minute


    
public override void OnTickGame()
    {
        
base.OnTickGame();

        if (
MissionTimer.Elapsed.TotalSeconds >= 10)
        {
            
sendChatMessage("MissionNr: {0}"GamePlay.gpNextMissionNumber());


            
//Point3d test = new Point3d(40128.09, 20605.83, 0);


            
foreach (AiActor ac in ActorList.GetActors())
                
sendChatMessage("Actor: {0}"ac.Name());


            
//InGameGroundActors.DestroyActors(AiGroundActorType.Tank, AiGroundActorType.AAGun);

            
ActorList.DestroyActors(-1);

            
//InGameGroundActors.DestroyActors(1, AiGroundActorType.Artillery);

            //InGameGroundActors.DestroyActors(GamePlay.gpPlayer().Place().Pos(), 300.0);

            //if (GamePlay.gpNextMissionNumber() - 1 >0)
            //    InGameGroundActors.DestroyActors(GamePlay.gpNextMissionNumber() - 1);

            //GamePlay.gpPostMissionLoad("missions/Training/DestroyTestSub1.mis");

            
sendChatMessage("-----------------");


            foreach (
AiActor ac in ActorList.GetActors())
                
sendChatMessage("Actor: {0}"ac.Name());

            
MissionTimer.Reset();
        }
    }




_79_dev 04-02-2012 10:14 AM

So if I remove
PHP Code:


#region Messages



    
private void sendChatMessage(string msgparams object[] args)
    {
        
GamePlay.gpLogServer(nullmsgargs);
    }


    private 
void sendChatMessage(Player playerstring msgparams object[] args)
    {
        if (
player != null)
            
GamePlay.gpLogServer(new Player[] { player }, msgargs);
    }


    private 
void sendChatMessage(int armystring msgparams object[] args)
    {
        List<
PlayerConsignees = new List<Player>();

        if (
GamePlay.gpPlayer() != null)
            
Consignees.Add(GamePlay.gpPlayer());
        if (
GamePlay.gpRemotePlayers() != null)
            
Consignees.AddRange(GamePlay.gpRemotePlayers());

        if (
army == -1)
            
GamePlay.gpLogServer(nullmsgargs);
        else if (
Consignees.Exists(item => item.Army() == army))
            
GamePlay.gpLogServer(Consignees.FindAll(item => item.Army() == army).ToArray(), msgargs);
    }


    private 
void sendScreenMessage(string msgparams object[] args)
    {
        
GamePlay.gpHUDLogCenter(nullmsgargs);
    }


    private 
void sendScreenMessage(Player playerstring msgparams object[] args)
    {
        if (
player != null)
            
GamePlay.gpHUDLogCenter(new Player[] { player }, msgargs);
    }


    private 
void sendScreenMessage(int armystring msgparams object[] args)
    {
        List<
PlayerConsignees = new List<Player>();

        if (
GamePlay.gpPlayer() != null)
            
Consignees.Add(GamePlay.gpPlayer());
        if (
GamePlay.gpRemotePlayers() != null)
            
Consignees.AddRange(GamePlay.gpRemotePlayers());

        if (
army == -1)
            
GamePlay.gpHUDLogCenter(nullmsgargs);
        else if (
Consignees.Exists(item => item.Army() == army))
            
GamePlay.gpHUDLogCenter(Consignees.FindAll(item => item.Army() == army).ToArray(), msgargs);
    }

    
#endregion

    
Stopwatch MissionTimer = new Stopwatch();


    
internal InGameActors ActorList = new InGameActors();

    public 
override void OnBattleStarted()
    {
        
base.OnBattleStarted();

        
MissionNumberListener = -1;
        
        
//GamePlay.gpPostMissionLoad("missions/Tests/DestroyTestSub1.mis");

        
MissionTimer.Start();
    }


    public 
override void OnActorCreated(int missionNumberstring shortNameAiActor actor)
    {
        
base.OnActorCreated(missionNumbershortNameactor);

        
ActorList.Add(actormissionNumber);
    }


    public 
override void OnActorDestroyed(int missionNumberstring shortNameAiActor actor)
    {
        
base.OnActorDestroyed(missionNumbershortNameactor);

        
ActorList.Removeable(actor);


    }


    
TimeSpan DestroyAfter = new TimeSpan(010); // Destroyafter set to one minute


    
public override void OnTickGame()
    {
        
base.OnTickGame();

        if (
MissionTimer.Elapsed.TotalSeconds >= 10)
        {
            
sendChatMessage("MissionNr: {0}"GamePlay.gpNextMissionNumber());


            
//Point3d test = new Point3d(40128.09, 20605.83, 0);


            
foreach (AiActor ac in ActorList.GetActors())
                
sendChatMessage("Actor: {0}"ac.Name());


            
//InGameGroundActors.DestroyActors(AiGroundActorType.Tank, AiGroundActorType.AAGun);

            
ActorList.DestroyActors(-1);

            
//InGameGroundActors.DestroyActors(1, AiGroundActorType.Artillery);

            //InGameGroundActors.DestroyActors(GamePlay.gpPlayer().Place().Pos(), 300.0);

            //if (GamePlay.gpNextMissionNumber() - 1 >0)
            //    InGameGroundActors.DestroyActors(GamePlay.gpNextMissionNumber() - 1);

            //GamePlay.gpPostMissionLoad("missions/Training/DestroyTestSub1.mis");

            
sendChatMessage("-----------------");


            foreach (
AiActor ac in ActorList.GetActors())
                
sendChatMessage("Actor: {0}"ac.Name());

            
MissionTimer.Reset();
        }
    } 

everything seems to be ok

Smokeynz 04-02-2012 10:21 AM

Just a note regarding Burmuda Triangle planes vanishing.

If you use OnTaskComplete as trigger to despawn or other function.

If then another actor crosses the final path of another actor(between the 2nd last point and last point) or is near final point, the actor crossing will trigger the OnTaskComplete for itself and the result of that trigger or function assigned to the path complete.

I have been making sure I set a short final path which is off to the side if that actor is triggering a despawning.


All times are GMT. The time now is 05:37 AM.

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