![]() |
#51
|
|||
|
|||
![]()
A great help would be looking what oggs (and sequence) are usefull for communication. So i can 'translate' it direct in code.
|
#52
|
|||
|
|||
![]()
Kodiak,
Here's the speech file (text) with all the ogg phrases in various languages. http://www.freefilehosting.net/speech I'm trying to concatonate various phrases into sentences, without success at the moment. There must be a way, since the inj-game radar speech uses almost complete sentences from the ogg phrases.
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash. Get the latest COD Team Fusion patch info HERE Last edited by salmo; 04-12-2012 at 06:20 AM. |
#53
|
|||
|
|||
![]() Quote:
![]() |
#54
|
||||
|
||||
![]() Quote:
Really sorry I did nothing yesterday. I am changing ISP and since I told them I have been getting cut off every night ![]() I have been looking at these and have some ideas on what needs to be said by the radio operator. For instance, I'm interested in the Point3D position of both aircraft, therefore for example if(pilot.height < aiairgroup.height) { //use "climb.ogg" & "2.ogg" angels i; } else { //use "descend.ogg & "2.ogg" angels i; } There are also direction oggs such as "turn right.ogg" but I don't know how sophisticated this can be. Unless it is easy to work out interception vectors then that is probably too much work or a longer term project. It is not needed for now I would like to know more about the sectors and how you intend to have this working. I have some input for this. There are a few important behaviour requirements for this if possible, briefly: 1. No aircraft reported under 600m (Chain Home Low min operating height) 2. RDF range as far as the French coast (and into France some 50 miles in the Pas De Calais area) A range map is available on Wikipedia I have an idea for a 4 minute delay but it's probably complicated and not the first thing to implement. It would involve the radar constantly working behind in the script and storing 4 minute old data in variables, then releasing that to the user on request instead of current data. Perhaps if the RDF event fired every minute transparently and the resulting information string stored and passed on every minute into a new variable until the 4th minute, then this was accessed and played to the player. (hope that makes sense) Speak later ~S~ |
#55
|
|||
|
|||
![]() Quote:
By this one could write a function that takes a array/list of strings that contains the names of the ogg files that should be played in a row. |
#56
|
|||
|
|||
![]() Quote:
Ok to sectors how i will use them. If a Battle Area is available you get the sector of a Actor with: GamePlay.gpSectorName(x, y) for exampe i get "D,1" as a string. Then i look if there is a HQ which is ' responsible' for this sector, each HQ gets a List with Sectors (its the job of the missionbuilder which sectors are stored in the Lists). If the player is connected to this HQ he became a response like "Mason Leader Enemy Bombers are in sector D 1", the rest depends on what is possible like Angels 12, Heading 320 etc. if he is not connected to that HQ he get no message, or "Mason Leader no enemy in sectors". To which 'HQ' the player can connect depens of the range to the next HQs. On German side may be i introduce a "Fliegerleitoffizier" which give targets to german stukas or bombers. Like "ship convoi in sector D,1 destroy.." |
#57
|
|||
|
|||
![]()
Nice.
![]() |
#58
|
|||
|
|||
![]()
Good idea will try it.
|
#59
|
|||
|
|||
![]()
So added sectors to headquarters, for testing i use a simple chat message, at the moment.
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; } private List<string> AttachedSectors = new List<string>(); public LocalHeadquarters(string name, string callsign, double x, double y, params string[] sectors) { this.Name = name; this.Callsign = callsign; this.LocationCoords = new Point2d(x, y); if (sectors != null) AttachedSectors.AddRange(sectors); } public bool observeSector(string sectorName) { if (AttachedSectors.Exists(item => item.Equals(sectorName))) return true; else return false; } } List<LocalHeadquarters> Headquarters = new List<LocalHeadquarters>{ {new LocalHeadquarters("Luton", "CallSign24", 100.0, 100.0, "A,1","A,2","A,3","B,1","B,2","B,3")}, {new LocalHeadquarters("RadPoe", "CallSign32", 200.0, 200.0, "C,1","C,2","C,3","D,1","D,2","D,3")}, {new LocalHeadquarters("Forest", "CallSign15", 300.0, 300.0, "E,1","E,2","E,3","F,1","F,2","F,3")}, {new LocalHeadquarters("Bearskin", "CallSign5", 400.0, 400.0, "G,1","G,2","G,3")}}; public void checkSectors(Player player) { if (PilotsInGame.Exists(item => item.player == player)) { int i = PilotsInGame.FindIndex(item => item.player == player); if (PilotsInGame[i].connectedHeadquarter != null) { if (Headquarters.Exists(hq => hq == PilotsInGame[i].connectedHeadquarter)) { LocalHeadquarters localHQ = PilotsInGame[i].connectedHeadquarter; AiAirGroup[] EnemyAirgroups = GamePlay.gpAirGroups((player.Army() == 1) ? 2 : 1); if (EnemyAirgroups != null) { bool foundEnemy = false; foreach (AiAirGroup aag in EnemyAirgroups) { string sectorName = GamePlay.gpSectorName(aag.Pos().x, aag.Pos().y); if (localHQ.observeSector(sectorName) && aag.Pos().z > 600.00) { foundEnemy = true; string type = ""; if (aag.isAircraftType(AircraftType.Bomber) || aag.isAircraftType(AircraftType.DiveBomber)) type = "Bombers"; else if (aag.isAircraftType(AircraftType.Fighter)) type = "Fighters"; GamePlay.gpLogServer(new[] { player }, "Enemy {0} in Sector: {1}", new[] { type, sectorName }); } } if(!foundEnemy) GamePlay.gpLogServer(new[] { player }, "No Enemy in Range", null); } } } } } 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)); } 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) { checkSectors(player); SetMainMenu(player); } if (menuItemIndex == 0) SetMainMenu(player); } if (ID == 101) { //Radar Menu if (menuItemIndex == 0) SetRadarMenu(player); else { SetHeadQuarter(player, menuItemIndex); SetRadarMenu(player); } } } } Three planes in sectors (at beginning all in sectors from RadPoe) one figther, one Bomber and a Bf110 below 600m (this should not be 'found' at the beginning) Code:
[PARTS] core.100 bob.100 [MAIN] MAP Land$Online_Cobra_(8x8) BattleArea 8704 14465 64640 59199 10000 TIME 12 WeatherIndex 0 CloudsHeight 1000 BreezeActivity 10 ThermalActivity 10 player BoB_RAF_F_FatCat_Early.000 [GlobalWind_0] Power 3.000 0.000 0.000 BottomBound 0.00 TopBound 1500.00 GustPower 5 GustAngle 45 [splines] [AirGroups] BoB_RAF_F_FatCat_Early.01 BoB_LW_LG2_I.02 BoB_LW_LG2_I.04 BoB_LW_LG2_I.11 [BoB_RAF_F_FatCat_Early.01] Flight0 1 Class Aircraft.SpitfireMkIIa Formation VIC3 CallSign 26 Fuel 100 Weapons 1 Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 Person0_0 0 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 1 [BoB_RAF_F_FatCat_Early.01_Way] TAKEOFF 40128.00 20864.00 0 0 [BoB_LW_LG2_I.02] Flight1 11 Class Aircraft.Bf-109E-4 Formation FINGERFOUR CallSign 26 Fuel 100 Weapons 1 Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 [BoB_LW_LG2_I.02_Way] NORMFLY 31360.00 43456.00 1000.00 300.00 NORMFLY 31360.00 21696.00 1000.00 300.00 NORMFLY 22464.00 21440.00 1000.00 300.00 NORMFLY 22272.00 43008.00 1000.00 300.00 [BoB_LW_LG2_I.04] Flight2 21 Class Aircraft.He-111H-2 Formation FINGERFOUR CallSign 26 Fuel 100 Weapons 1 Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 [BoB_LW_LG2_I.04_Way] NORMFLY 33536.56 29249.82 2500.00 300.00 NORMFLY 45119.69 29953.77 2500.00 300.00 NORMFLY 54143.01 37825.18 2500.00 300.00 NORMFLY 61502.45 49920.27 2500.00 300.00 [BoB_LW_LG2_I.11] Flight0 1 Class Aircraft.Bf-110C-4 Formation FINGERFOUR CallSign 26 Fuel 100 Weapons 1 Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 [BoB_LW_LG2_I.11_Way] NORMFLY 40448.00 44097.40 500.00 300.00 NORMFLY 32960.00 32129.40 500.00 300.00 NORMFLY 27008.00 26817.40 1000.00 300.00 NORMFLY 17664.00 22529.40 1000.00 300.00 [CustomChiefs] [Stationary] [Buildings] [BuildingsLinks] Last edited by FG28_Kodiak; 04-12-2012 at 09:45 AM. |
#60
|
|||
|
|||
![]()
I tested your mission. It works fine. However its like the aircraft has radar.
Could the command sectors be tied to an ingame object? Then it could take its readings from there instead of mesuring from the aircraft. Also this means radar can be destroyed. Could radar tell the difference between fighters and bombers? Last edited by 5./JG27.Farber; 04-12-2012 at 05:50 PM. |
![]() |
|
|