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
  #41  
Old 04-11-2012, 02:32 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Ok Problem, there are callsighn?? ogg present, but if i try to play them via SayToGroup nothing happens.
So it seems it's better to wait for the next patch, hope the problem is solved.
Reply With Quote
  #42  
Old 04-11-2012, 03:45 PM
Osprey's Avatar
Osprey Osprey is offline
Approved Member
 
Join Date: Jan 2010
Location: Gloucestershire, England
Posts: 1,264
Default

I think that customising sounds to individuals may be a step too far for now, the existing sounds seem to have most of the comments needed to piece together a decent instruction. I'll write up some design/requirements and example scenarios in which existing logic could be used to create those instructions. I think we could start with some basic vocal instruction and extend the logic in pieces to improve the description as that is proven out.

I need a chat with Farber about his requirements from a German pilot perspective. We need to be careful here, and I'm not trying to gain advantage for the RAF BUT it should be noted that in 1940 it was not possible for German fighter pilots to talk on radios to German bomber crews because they had completely different sets and 'crystals'. This is explained in Ulrich Stienhilpers book "Spitfire on my Tail" who was responsible for radio comms for his squadron. Of course I am open to correction on this, and I'm keen to learn about any use of German radar in directing fighter squadrons - again I don't think there was any, they used radar for attack eg finding ships to target in the Channel.
Reply With Quote
  #43  
Old 04-11-2012, 03:51 PM
5./JG27.Farber 5./JG27.Farber is offline
Approved Member
 
Join Date: Aug 2011
Posts: 1,958
Default

No, fighters could not communicate with bombers and niether will we, as most if not all will be AI.
Reply With Quote
  #44  
Old 04-11-2012, 04:23 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Argh sometimes i could the devs ...

Callsigns work, the oggs are called callsign1 .. etc. but you must write CallSign1 in code
Reply With Quote
  #45  
Old 04-11-2012, 04:36 PM
Osprey's Avatar
Osprey Osprey is offline
Approved Member
 
Join Date: Jan 2010
Location: Gloucestershire, England
Posts: 1,264
Default

You can't use a variable or parameter?
Reply With Quote
  #46  
Old 04-11-2012, 04:49 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Yes i can, but i must it 'translate' it somewhere.

Ok try of a 'connect' - communication (use the mission-menu ):

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


public class Mission : AMission
{
    #region class Menu
    
    internal class Menu
    {
        internal class MenuEntry
        {
            internal string MenuName { get; set; }
            internal bool active { get; set; }
        }

        internal List<MenuEntry> menuEntries = new List<MenuEntry>();

        public void AddMenuEntry(string description, bool active)
        {
            MenuEntry NewMenuEntry = new MenuEntry();

            NewMenuEntry.MenuName = description;
            NewMenuEntry.active = active;

            menuEntries.Add(NewMenuEntry);
        }

        public string[] GetMenuDescriptions()
        {
            List<string> Descriptions = new List<string>();

            menuEntries.ForEach(item =>
            {
                Descriptions.Add(item.MenuName);
            });

            return Descriptions.ToArray();
        }

        public bool[] GetActives()
        {
            List<bool> Actives = new List<bool>();

            menuEntries.ForEach(item =>
            {
                Actives.Add(item.active);
            });

            return Actives.ToArray();
        }

        public bool IsValid()
        {
            if (menuEntries == null || menuEntries.Count < 1)
                return false;
            else
                return true;

        }

    }

    #endregion


    internal class Pilot
    {
        public Player player { get; set; }
        public LocalHeadquarters connectedHeadquarter;

        public Pilot(Player player)
        {
            this.player = player;
        }
    }


    internal List<Pilot> PilotsInGame = new List<Pilot>();


    internal class LocalHeadquarters
    {
        public string Name { get; set; }
        public Point2d LocationCoords { get; set; }
        public string Callsign { get; set; }
        public List<string> AttachedSectors = new List<string>();

        public LocalHeadquarters(string name, string callsign, double x, double y)
        {
            this.Name = name;
            this.Callsign = callsign;
            this.LocationCoords = new Point2d(x, y);
        }
    }


    List<LocalHeadquarters> Headquarters = new List<LocalHeadquarters>{
        {new LocalHeadquarters("Luton", "CallSign24", 100.0, 100.0)},
        {new LocalHeadquarters("RadPoe", "CallSign32", 200.0, 200.0)},
        {new LocalHeadquarters("Forest", "CallSign15", 300.0, 300.0)},
        {new LocalHeadquarters("Bearskin", "CallSign5", 400.0, 400.0)}};



    public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceEnter(player, actor, placeIndex);


        if (!PilotsInGame.Exists(item => item.player == player))
        {
            PilotsInGame.Add(new Pilot(player));
        }

        GamePlay.gpLogServer(null, "Callsign: {0}", new[] { (actor as AiAircraft).CallSign() });

        SetMainMenu(player);
    }


    private void connectToHeadquarterSpeech(AiAircraft aircraft, LocalHeadquarters localHQ)
    {
        double initTime = 0.0;

        aircraft.SayToGroup(aircraft.AirGroup(), "Hello_guys");

        Timeout(initTime += 2, () =>
            {
                aircraft.SayToGroup(aircraft.AirGroup(), "This_is");
            });

        Timeout(initTime += 2, () =>
        {
            aircraft.SayToGroup(aircraft.AirGroup(), localHQ.Callsign);
        });

        
        // to is missing as ogg


        Timeout(initTime += 2, () =>
        {
            aircraft.SayToGroup(aircraft.AirGroup(), aircraft.CallSign());
        });

        

        Timeout(initTime += 2, () =>
        {
            aircraft.SayToGroup(aircraft.AirGroup(), "leader__");
        });


    }


    
    public void SetMainMenu(Player player)
    {
        if (player.Army() == 1) // red Side
            GamePlay.gpSetOrderMissionMenu(player, false, 0, new string[] { "Radaroperations" }, new bool[] { true });
        else
            GamePlay.gpSetOrderMissionMenu(player, false, 0, new string[] { "Not Available" }, new bool[] { true });
    }


    public void SetRadarMenu(Player player)
    {
        string headQuarter = "Select Headquarter";
        string connectedTo = "";

        if (PilotsInGame.Exists(item => item.player == player))
        {
            int i = PilotsInGame.FindIndex(item => item.player == player);

            if (PilotsInGame[i].connectedHeadquarter != null)
                connectedTo = string.Format(" (connected: {0})", PilotsInGame[i].connectedHeadquarter.Name);
        }
        headQuarter += connectedTo;

        GamePlay.gpSetOrderMissionMenu(player, true, 100, new string[] { headQuarter, "Get Radar Information" }, new bool[] { true, true });

    }


    public void SetConnectToHeadquarterMenu(Player player)
    {
        Menu NewMenu = new Menu();
        LocalHeadquarters headQuarter = null;

        if (PilotsInGame.Exists(item => item.player == player))
        {
            int i = PilotsInGame.FindIndex(item => item.player == player);
            headQuarter = PilotsInGame[i].connectedHeadquarter;
        }

        Headquarters.ForEach(item =>
        {
            if (headQuarter != null && item == headQuarter)
            {
                NewMenu.AddMenuEntry(item.Name + " *", true);
            }
            else
                NewMenu.AddMenuEntry(item.Name, true);
        });

        if (NewMenu.IsValid())
            GamePlay.gpSetOrderMissionMenu(player, true, 101, NewMenu.GetMenuDescriptions() , NewMenu.GetActives());
        else
            GamePlay.gpSetOrderMissionMenu(player, true, 101, new string[]{ "Not available" }, new bool[]{true});
    }


    public void SetHeadQuarter(Player player, int menuItemIndex)
    {
        if (PilotsInGame.Exists(item => item.player == player))
        {
            int i = PilotsInGame.FindIndex(item => item.player == player);
            PilotsInGame[i].connectedHeadquarter = Headquarters[menuItemIndex-1];
            if (player.Place() != null)
                connectToHeadquarterSpeech((player.Place() as AiAircraft), PilotsInGame[i].connectedHeadquarter);
        }

    }


    public override void OnOrderMissionMenuSelected(Player player, int ID, int menuItemIndex)
    {


        if (ID == 0)
        { // main menu
            if (menuItemIndex == 1)
            {
                SetRadarMenu(player);
            }
            //if (menuItemIndex == 2)
            //{


            //}
            //if (menuItemIndex == 3)
            //{


            //}
        }


        if (ID == 100)
        {
            //Radar Menu
            if (menuItemIndex == 1)
            {
                SetConnectToHeadquarterMenu(player);
            }

            if (menuItemIndex == 2)
            {
                SetMainMenu(player);
            }


            if (menuItemIndex == 0)
                SetMainMenu(player);
        }

        if (ID == 101)
        {
            //Radar Menu
            if (menuItemIndex == 0)
                SetRadarMenu(player);
            else
            {
                SetHeadQuarter(player, menuItemIndex);
                SetRadarMenu(player);
            }
        }
    }
}

Last edited by FG28_Kodiak; 04-11-2012 at 04:51 PM.
Reply With Quote
  #47  
Old 04-11-2012, 04:54 PM
Osprey's Avatar
Osprey Osprey is offline
Approved Member
 
Join Date: Jan 2010
Location: Gloucestershire, England
Posts: 1,264
Default

Oooo you're working ahead of me This looks interesting, when I get back from football I'll run it up in VS and try it in a dedicated server. Do I need any special map set up so it knows about the sectors?
Reply With Quote
  #48  
Old 04-11-2012, 04:57 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Do you will script this by your own? - No problem i 've some other scriptwork to do.
At the moment it's only a test for communication, nor other features like sectors implemented.
Reply With Quote
  #49  
Old 04-11-2012, 07:05 PM
Osprey's Avatar
Osprey Osprey is offline
Approved Member
 
Join Date: Jan 2010
Location: Gloucestershire, England
Posts: 1,264
Default

No no, I am rubbish at writing the code myself because I am not trained properly. I can only read it and understand it usually, and write basic logic.

I would just like to offer help with getting this working, I think a lot of people would find 'realistic radar' quite useful
Reply With Quote
  #50  
Old 04-11-2012, 08:15 PM
_79_dev _79_dev is offline
Approved Member
 
Join Date: Sep 2010
Location: Dublin
Posts: 242
Default

Latest script for menu is up on server, ready to be tested... thanks Kodiak... Conect here http://www.5jg27.net/
__________________

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
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 08:27 AM.


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