![]() |
#41
|
|||
|
|||
![]()
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. |
#42
|
||||
|
||||
![]()
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. |
#43
|
|||
|
|||
![]()
No, fighters could not communicate with bombers and niether will we, as most if not all will be AI.
|
#44
|
|||
|
|||
![]()
Argh sometimes i could the devs ...
![]() Callsigns work, the oggs are called callsign1 .. etc. but you must write CallSign1 in code ![]() |
#45
|
||||
|
||||
![]()
You can't use a variable or parameter?
|
#46
|
|||
|
|||
![]()
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. |
#47
|
||||
|
||||
![]()
Oooo you're working ahead of me
![]() |
#48
|
|||
|
|||
![]()
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. |
#49
|
||||
|
||||
![]()
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 ![]() |
#50
|
|||
|
|||
![]()
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 |
![]() |
|
|