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
  #24  
Old 09-10-2011, 06:00 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

So another Script, Player Plane Memory function.
actual its a early 'alpha'
it's shows the playername after shootdown, even if the enemy player leaved the plane via esc or bailed out.
then a short message will shown playername1 shoot down by playername2.
the message is only shown if a human shoot down a human, the others are in work.
Knows anybody how to disable the gamemessages in chat or override them?
I actually hoped we get this possibility with the beta patch, so we can change the game messages against our own messages, but i don't find anything. But i look deeper in it

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


public class Mission : AMission
{

    public class AirplanePlayerName
    {
        public AiAircraft PlayerAirplane{ get; set; }
        public string PilotName { get; set; }
        public bool Removable { get; set; }
    }

    public List<AirplanePlayerName> UsedAirplanes = new List<AirplanePlayerName>();
    
    
    public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceEnter(player, actor, placeIndex);

        // Player enter Aircraft as Pilot
        if (actor != null && (actor is AiAircraft) && placeIndex == 0)
        {

            foreach (AirplanePlayerName actplane in UsedAirplanes)
            {
                if (actplane.PlayerAirplane == (actor as AiAircraft))  // plane is already in list
                {
                    actplane.PilotName = player.Name(); // change the pilot name
                    return;
                }
               
            }
        
            AirplanePlayerName NewAircraft = new AirplanePlayerName();
            NewAircraft.PilotName = player.Name();
            NewAircraft.PlayerAirplane = (actor as AiAircraft);

            UsedAirplanes.Add(NewAircraft);
        }
    }


    public override void OnActorDead(int missionNumber, string shortName, AiActor actor, System.Collections.Generic.List<DamagerScore> damages)
    {
        base.OnActorDead(missionNumber, shortName, actor, damages);

        

        if (actor is AiAircraft)
        {
            foreach (DamagerScore ds in damages)
            {
                if (ds.initiator.Player != null && (actor as AiAircraft).InternalTypeName() != null)
                {
                    foreach (AirplanePlayerName actPlane in UsedAirplanes)
                    {
                        if (actPlane.PlayerAirplane == (actor as AiAircraft) && !actPlane.Removable)
                        {

                            Timeout(1.0, () =>
                            {
                                GamePlay.gpLogServer(null, "\n\n===> Player: {0} was shoot down by {1} <===\n\n", new object[] { actPlane.PilotName, ds.initiator.Player.Name() });
                            });
                                                        
                            actPlane.Removable = true;
                        }
                    }
                }
            }
        }
        UsedAirplanes.RemoveAll(item => item.Removable == true);
    }


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

        if (actor is AiAircraft)
        {
            foreach (AirplanePlayerName actPlane in UsedAirplanes)
            {
                if (actPlane.PlayerAirplane == (actor as AiAircraft))
                {
                    actPlane.Removable = true;
                }
            }
        }
        UsedAirplanes.RemoveAll(item => item.Removable == true);
    }

}

Last edited by FG28_Kodiak; 09-10-2011 at 07:18 PM.
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 01:10 AM.


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