Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 04-08-2012, 03:19 PM
Osprey's Avatar
Osprey Osprey is offline
Approved Member
 
Join Date: Jan 2010
Location: Gloucestershire, England
Posts: 1,264
Default

Now this stuff looks very promising.

I'm going to crack open VS express and have a bigger look. I can't write the stuff but adapting it may be easier.
Reply With Quote
  #12  
Old 04-08-2012, 04:36 PM
5./JG27.Farber 5./JG27.Farber is offline
Approved Member
 
Join Date: Aug 2011
Posts: 1,958
Default

Kodiak thats great. Were gonna give it a whirl on our server today. I have some ideas for expansion. Could there be some kind of delay between requesting the information and recieving it, say 4 mins? This would simulate the request going to and from the lines of communication. Also. What if some radars are knocked out or damaged? Can this be simulated also?

P.S. I know how you feel with the renovation, Ive been doing it for 4 months now. It will be finished this week. What a grind.
Reply With Quote
  #13  
Old 04-08-2012, 06:00 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

you wanna ask the operators with the mission menu? and than after 4min you will get the response? This is possible without problem.
Okay for clearance, when we use "radars" will you give the messages to the Airgroups in range of a spezific radarstation or to all. So if you hit the 'radarbutton' then you get Information of all Enemies Airgoups in range of any available radarstation or only from this you are in Range?
Reply With Quote
  #14  
Old 04-08-2012, 06:40 PM
_79_dev _79_dev is offline
Approved Member
 
Join Date: Sep 2010
Location: Dublin
Posts: 242
Default

i gave it a go : this is my script

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./JG27 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;
    
    
    
////////////////setting chat 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);
    }
    
////////////////testing voice messages
    
     
public void sendMessagesToAirgroup(AiAirGroup fromdouble maxDistance)
    {

        
AiAirGroup[] EnemyAirgroups;
        
Point3d StartPos = new Point3d(from.Pos().xfrom.Pos().y1.0);

        
EnemyAirgroups GamePlay.gpAirGroups((from.Army() == 1) ? 1);

        
int i 0;

        foreach (
AiAirGroup aag in EnemyAirgroups)
        {
            
Point3d enemyPosition = new Point3d(aag.Pos().xaag.Pos().y1.0);

            if (
from.Pos().distance(ref enemyPosition) < maxDistance)
            {
                
                
string sectorName GamePlay.gpSectorName(aag.Pos().xaag.Pos().y);

                
string[] splittet sectorName.Split(',');
                
string alpha splittet[0];
                
string number "n" splittet[1];

                
AiAircraft LeaderPlane = (from.GetItems()[0] as AiAircraft);

                
Timeout(i, () =>
                {
                    (
LeaderPlane as AiAircraft).SayToGroup(from as AiAirGroup"Enemy_planes");
                });


                
Timeout(+= 2, () =>
                {
                    
LeaderPlane.SayToGroup(from"In_square");
                });

                
Timeout(+= 2, () =>
                {
                    
LeaderPlane.SayToGroup(fromalpha);
                });
                
Timeout(+= 2, () =>
                {
                    
LeaderPlane.SayToGroup(fromnumber);
                });

                
+= 2;
            }
        }
    }


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

        if (
Time.tickCounter() % 600 == 299)
        {
            foreach(
AiAirGroup aag in GamePlay.gpAirGroups(1))
                
sendMessagesToAirgroup(aag100000.0);
        
        }
    


    
// loading sub-missions
    
    
          #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
    ///////////////////////
    // server info every 5 min
    
     
if (Time.tickCounter() % 9000 == 1800)  
       
       {

       
sendChatMessage((-1), "PLEAS VISIT www.5jg27.net TO CHECK STATS");

        }
    
    
    
// load ground objects
       
if (Time.tickCounter() % 2592000 == 300)  
       {
           
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/kanalkampf/kanalkampf_ground.mis");
    
       }

// loads Mission1
       
if (Time.tickCounter() % 2592000 == 12600)  
       {
           
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/kanalkampf/kanalkampf_Air1Red1Blue1.mis");
                      
       }

// loads Rescue
       
if (Time.tickCounter() % 2592000 == 95000)  
       {
           
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/kanalkampf/kanalkampf_Airsearescue.mis");
                      
       }
    

// loads Mission2
       
if (Time.tickCounter() % 2592000 == 66600)  
       {
           
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/kanalkampf/kanalkampf_Air2Red2.mis");
           
           
       }

// loads Mission3
       
if (Time.tickCounter() % 2592000 == 144000)  
       {
           
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/kanalkampf/kanalkampf_Air3Blue2.mis");
          
           
       }
       


    }
 
////////////////////////////////////////////////////////////////////////////////////////////////////

//

// 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
    
}
          
    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 OnAircraftLimbDamaged(int missionNumberstring shortNameAiAircraft aircraftAiLimbDamage limbDamage)
    {
        
#region stats
        
base.OnAircraftLimbDamaged(missionNumbershortNameaircraftlimbDamage);
        try
        {
            
stats.aircraftLimbDamaged(shortNameaircraftlimbDamage);
        }
        catch (
Exception ex)
        {
            
System.Console.WriteLine("Stats.OnAircraftLimbDamaged - 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
    
}
//////////////////////////////////////////////////////////////////////////////////////////////////


 

console gives that every 20-30sec

PHP Code:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsgIMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageDatamsgDataInt32 type)
at maddox.game.IBattle.OnTickGame()
at maddox.game.GameDef.tickGame()
at uRQMLX6vlhrpBgfbWjC.eBu9gE6TS67VJSjj97t.Hwe9ADXhn0AxpFMw7lv0(Object )
at uRQMLX6vlhrpBgfbWjC.eBu9gE6TS67VJSjj97t.8An9qLaqwNd()
at 93bAC3gAbOoH4F4mw53.Pljjc2gU48bdLjaViwW.Af3oASrUh27g1Z9hCmya(Object )
at 93bAC3gAbOoH4F4mw53.Pljjc2gU48bdLjaViwW.9B8JM8x755B(Boolean Boolean )
=================================================
=================================================
System.NullReferenceExceptionObject reference not set to an instance of an object.
Server stack trace:
at Mission.sendMessagesToAirgroup(AiAirGroup fromDouble maxDistance)
at Mission.OnTickGame()
at maddox.game.ABattle.OnTickGame()
at maddox.game.world.Strategy.OnTickGame()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr mdObject[] argsObject serverInt32 methodPtrBoolean fExecuteInContextObject[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msgInt32 methodPtrBoolean fExecuteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsgIMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageDatamsgDataInt32 type)
at maddox.game.IBattle.OnTickGame()
at maddox.game.GameDef.tickGame()
at uRQMLX6vlhrpBgfbWjC.eBu9gE6TS67VJSjj97t.Hwe9ADXhn0AxpFMw7lv0(Object )
at uRQMLX6vlhrpBgfbWjC.eBu9gE6TS67VJSjj97t.8An9qLaqwNd()
at 93bAC3gAbOoH4F4mw53.Pljjc2gU48bdLjaViwW.Af3oASrUh27g1Z9hCmya(Object )
at 93bAC3gAbOoH4F4mw53.Pljjc2gU48bdLjaViwW.9B8JM8x755B(Boolean Boolean )
================================================= 
is that because there is no airgroups loaded yet?
__________________

Asus P6T V2 Deluxe, I7 930, 3x2 GB RAM XMS3 Corsair1333 Mhz, Nvidia Leadtek GTX 470, Acer 1260p screen projector, Track IR 4 OS ver5, Saitek Pro Flight Rudder, Saitek X52, Win 7 x64 ultimate
Reply With Quote
  #15  
Old 04-08-2012, 07:26 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Quote:
Originally Posted by _79_dev View Post
is that because there is no airgroups loaded yet?
Yepp:
Added
if (EnemyAirgroups == null) return;
to method sendMessagesToAirgroup
and
if (GamePlay.gpAirGroups(1) != null)
in OnTickGame
to avoid exception

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;
using maddox.GP;


public class Mission : AMission
{

    public void sendMessagesToAirgroup(AiAirGroup from, double maxDistance)
    {

        AiAirGroup[] EnemyAirgroups;
        Point3d StartPos = new Point3d(from.Pos().x, from.Pos().y, 1.0);

        EnemyAirgroups = GamePlay.gpAirGroups((from.Army() == 1) ? 2 : 1);
        if (EnemyAirgroups == null) return;

        int i = 0;

        foreach (AiAirGroup aag in EnemyAirgroups)
        {
            Point3d enemyPosition = new Point3d(aag.Pos().x, aag.Pos().y, 1.0);

            if (from.Pos().distance(ref enemyPosition) < maxDistance)
            {
                
                string sectorName = GamePlay.gpSectorName(aag.Pos().x, aag.Pos().y);

                string[] splittet = sectorName.Split(',');
                string alpha = splittet[0];
                string number = "n" + splittet[1];

                AiAircraft LeaderPlane = (from.GetItems()[0] as AiAircraft);

                Timeout(i, () =>
                {
                    (LeaderPlane as AiAircraft).SayToGroup(from as AiAirGroup, "Enemy_planes");
                });


                Timeout(i += 2, () =>
                {
                    LeaderPlane.SayToGroup(from, "In_square");
                });

                Timeout(i += 2, () =>
                {
                    LeaderPlane.SayToGroup(from, alpha);
                });
                Timeout(i += 2, () =>
                {
                    LeaderPlane.SayToGroup(from, number);
                });

                i += 2;
            }
        }
    }


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

        if (Time.tickCounter() % 600 == 299)
        {
            if (GamePlay.gpAirGroups(1) != null)
                foreach(AiAirGroup aag in GamePlay.gpAirGroups(1))
                    sendMessagesToAirgroup(aag, 100000.0);
        
        }
    }
}

Last edited by FG28_Kodiak; 04-08-2012 at 07:28 PM.
Reply With Quote
  #16  
Old 04-08-2012, 11:26 PM
5./JG27.Farber 5./JG27.Farber is offline
Approved Member
 
Join Date: Aug 2011
Posts: 1,958
Default

Quote:
Originally Posted by FG28_Kodiak View Post
you wanna ask the operators with the mission menu? and than after 4min you will get the response? This is possible without problem.
Okay for clearance, when we use "radars" will you give the messages to the Airgroups in range of a spezific radarstation or to all. So if you hit the 'radarbutton' then you get Information of all Enemies Airgoups in range of any available radarstation or only from this you are in Range?
Hmm if the radar closest gave the information that would be good otherwise it is as if the aircraft has the radar, or maybe not?

How would you ask the radar?
Reply With Quote
  #17  
Old 04-09-2012, 03:54 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

via MissionMenu.
Reply With Quote
  #18  
Old 04-09-2012, 07:55 AM
csThor csThor is offline
Approved Member
 
Join Date: Oct 2007
Location: somewhere in Germany
Posts: 1,213
Default

If my input is allowed. I agree with Kodiak about the menu thing. Think of it as a Squadron Leader "registering" with a certain Sector Station Ops Room to receive RADAR information. That could be easily done either by making this selection available in the menu (i.e. Select Sector -> Biggin Hill, Kenley, Tangmere etc - if you want more structure and accept a slightly higher workload for the squadron leader) or simply via a distance check for the airgroup (if it's supposed to be easier).

I do, however, suggest to take a look at how the Squad Select Series at Warbirds and the Friday Squad Ops at Aces High II operate. They appoint a CO prior to a run and he has to devise a general plan. Since we lack the numbers they can (theoretically) operate with there would, of course, be some adaptations necessary. My suggestion would be:

1.) Select one squad for CO duty prior to the run. Rotate this position within the squad pool after each run.
2.) Give the CO a number of targets he can choose from. For example a mission set in August 1940 would give the Luftwaffe CO a list of primary airfields of which he has to hit a certain number (depending on number of players, I guess no more than two for CloD) plus a list of secondary targets which may give the LW additional points. This way you create a more realistic Fog of War situation in which the RAF doesn't know which targets will be hit by the LW in advance.

For the RAF this CO duty is, of course, not that important. Later it will certainly become more important once we move to theaters which include offensive ops by both sides.
Reply With Quote
  #19  
Old 04-09-2012, 08:22 AM
_79_dev _79_dev is offline
Approved Member
 
Join Date: Sep 2010
Location: Dublin
Posts: 242
Default

Kodiak, Your script for generating voice messages due to distance from blue Airgroup seems to be working fine on server console, however I can't test it physically my self cause I am on holidays and using IPod at the moment (can't run Cliffs of Dover on iPod...yet). If someone can give us a hand pleas go to 5jg27.net there is direct connect button to server.

Just one more question, by the look at the script It supose to give radio messages every x amount of seconds or do I have to go to TAB menu to ask for message? (just getting confused here)
__________________

Asus P6T V2 Deluxe, I7 930, 3x2 GB RAM XMS3 Corsair1333 Mhz, Nvidia Leadtek GTX 470, Acer 1260p screen projector, Track IR 4 OS ver5, Saitek Pro Flight Rudder, Saitek X52, Win 7 x64 ultimate
Reply With Quote
  #20  
Old 04-09-2012, 09:19 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

At the moment with time amount, but it's no problem doing this via menu. But at the moment there is the problem with the missionmenu for the red side on dediserver, so it's better to wait for the patch, and hope the patch solving this problem.
How many of this Sector Station Ops Room where available at BoB? How many radars and other observers was attached to one station?

Last edited by FG28_Kodiak; 04-09-2012 at 09:23 AM.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:51 PM.


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