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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 04-02-2012, 08:18 AM
_79_dev _79_dev is offline
Approved Member
 
Join Date: Sep 2010
Location: Dublin
Posts: 242
Default

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?
__________________

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

Last edited by _79_dev; 04-02-2012 at 08:21 AM.
Reply With Quote
 


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 02:04 AM.


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