1C Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official 1C Company forum > 1C Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 06-15-2012, 10:03 AM
moggel moggel is offline
Approved Member
 
Join Date: Mar 2011
Posts: 70
Default Mission menu

Hi again,

I'm currently fiddling with the mission menu and most if what I need works fine but I have a couple of questions:

1. Is there a way to "persist" a player's menu state?
2. How do I close the menu (from code)?

Guess the first question needs some explaining: If I call the gpSetOrderMissionMenu() method the whole menu seems to be replaced. I assume I'd need to make sure any state related to the pilot needs to be tracked by my own script but, before I spend time writing that code, is there any support for this built in?

The seconds question is hopefully a bit clearer: When the pilot selects one of the options I've presented to him/her the menu should disappear. I've tried sending in empty arrays and null values to the gpSetOrderMissionMenu() method but that actually makes the whole sim take a dive.

Thanks,
Mog
__________________
Core i7 3930K @ 4.8GHz; 16Gb DDR3 (Vengeance); nVidia GTX580; OS disk: 150Gb 10000rpm; SIM disk: 300Gb 10000rpm; Windows 7 x64 Ultimate
Reply With Quote
  #2  
Old 06-16-2012, 03:40 PM
moggel moggel is offline
Approved Member
 
Join Date: Mar 2011
Posts: 70
Default

Hm. No replies in two days? Guess I need to try and figure this out myself then ...
__________________
Core i7 3930K @ 4.8GHz; 16Gb DDR3 (Vengeance); nVidia GTX580; OS disk: 150Gb 10000rpm; SIM disk: 300Gb 10000rpm; Windows 7 x64 Ultimate
Reply With Quote
  #3  
Old 06-17-2012, 12:59 AM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Default

Some of us just busy. Many have decided not to read this forum till the patch comes.
__________________
__________________
Win7, 64bit Ultra
Asus P8P67Pro MB
Intel i7-2600K
Coursair 16GB (4x 4GB), DDR3-1600MHz
Gainward Nvidia 580GTX 3GB DDR5
850-Watt Modular Power Supply
WIN7 and COD on Gskill SSD 240GB
40" Panasonic LCD
TrackIR5 +
Thrustmaster Warthog stick, throttle & pedals
Reply With Quote
  #4  
Old 06-17-2012, 01:13 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Construct a pilot-specific mission menu using SetMainMenu & OnOrderMissionMenuSelected calls. Here's an example:

Code:
public override void OnOrderMissionMenuSelected(Player player, int ID, int menuItemIndex)
    #region custom menu actions
    {
        if (ID == 0)    // main menu
        {

        }

        if (ID == 2)    // blue army mission menu
        {
            switch (menuItemIndex)
            {
                case 0:
                    SetMainMenu(player);
                    break;
                case 1: // Spawn Ju87 flight to Dover
                    BlueMissionTimer.Restart();
                    NextBlueMission = m_random.Next(20, 25 + 1);
                    // blue missions
                    switch (m_random.Next(1, 2 + 1))
                    {
                        case 1: // stuka staffel
                            #region stuka staffel
                            GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/aus3/blue/Ju87_a.mis");
                            sendScreenMessageTo(2, "Stuka staffel activated", null);
                            break;
                            #endregion
                        case 2: //stuka staffel
                            #region Stuka staffel
                            GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/aus3/blue/Ju87_c.mis");
                            sendScreenMessageTo(2, "Stuka staffel activated", null);
                            break;
                            #endregion
                        default: // stuka staffel
                            #region Stuka staffel
                            GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/aus3/blue/Ju87_c.mis");
                            sendScreenMessageTo(2, "Stuka staffel activated", null);
                            break;
                            #endregion
                    }
                    sayMessageTo(2, "Stukas");
                    sayMessageTo(2, "Takeoff");
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.Write(player.Name() + " ordered 'Spawn Ju87 flight to Dover' flight (OnOrderMissionMenuSelected)" + "\r\n");
                    Console.ResetColor();
                    Timeout(15 * 60, () =>      // reset menu in 15 minutes
                    {
                        SetMainMenu(player);
                    }
                    );
                    break;
                case 2:
                    #region Heinkel staffel
                    GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/aus3/blue/Heinkels_c.mis");
                    sendScreenMessageTo(2, "Heinkel staffel activated", null);
                    sayMessageTo(2, "Heinkel");
                    sayMessageTo(2, "Takeoff");
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.Write(player.Name() + " ordered 'Heinkel staffel' flight (OnOrderMissionMenuSelected)" + "\r\n");
                    Console.ResetColor();
                    Timeout(15 * 60, () =>      // reset menu in 15 minutes
                    {
                        SetMainMenu(player);
                    }
                    );
                    break;
                    #endregion
                case 3: // Spawn Ju87 flight to Hawkinge
                    #region Stuka staffel
                    GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/aus3/blue/Ju87_hawkinge.mis");
                    sendScreenMessageTo(2, "Stuka staffel activated", null);
                    sayMessageTo(2, "Stukas");
                    sayMessageTo(2, "Takeoff");
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.Write(player.Name() + " ordered 'Spawn Ju87 flight to Hawkinge' flight (OnOrderMissionMenuSelected)" + "\r\n");
                    Console.ResetColor();
                    Timeout(15 * 60, () =>      // reset menu in 15 minutes
                    {
                        SetMainMenu(player);
                    }
                    );
                    break;
                    #endregion
                case 4: // FW200 recon Dover & Ramsgate
                    #region FW200 recon 
                    GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/aus3/blue/FW200_recon.mis");
                    sendScreenMessageTo(2, "FW200 Condor reconnaissance flight activated", null);
                    sayMessageTo(2, "Condor");
                    sayMessageTo(2, "Takeoff");
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.Write(player.Name() + " ordered 'FW200 recon Dover & Ramsgate' flight (OnOrderMissionMenuSelected)" + "\r\n");
                    Console.ResetColor();
                    Timeout(15 * 60, () =>      // reset menu in 15 minutes
                    {
                        SetMainMenu(player);
                    }
                    );
                    break;
                    #endregion
                case 5: // Dorniers bomb Manston airfield
                    #region Dorniers bomb Manston airfield
                    GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/aus3/blue/Do17_Manston.mis");
                    sendScreenMessageTo(2, "Dornier staffel activated", null);
                    sayMessageTo(2, "Dornier");
                    sayMessageTo(2, "Takeoff");
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.Write(player.Name() + " ordered 'Dorniers bomb Manston airfield' flight (OnOrderMissionMenuSelected)" + "\r\n");
                    Console.ResetColor();
                    Timeout(15 * 60, () =>      // reset menu in 15 minutes
                    {
                        SetMainMenu(player);
                    }
                    );
                    break;
                    #endregion
                case 6:
                    PrintIndexAndKeysAndValues(KilledAircraft);

                    break;
                default:

                    break;
            }
        }

        if (ID == 1)    // red army mission menu
        {
            switch (menuItemIndex)
            {
                case 1: // spawn hurricane squadron
                    RedMissionTimer.Restart();
                    NextRedMission = m_random.Next(20, 25 + 1);
                    switch (m_random.Next(1, 2 + 1))
                    {
                        case 1: // hurricane squadron
                            #region hurricane squadron
                        GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/aus3/red/hurricane_a.mis");
                        sendScreenMessageTo(1, "Hurricane squadron activated", null);
                        

                        //                    sayMessageTo(1, "Prepare_For_Takeoff");
                        //                    //sayMessageTo(1, "Dover_Control_this_is_Villa_Leader_We_are_taking_off_to_intercept_now");
                        //                    Timeout(5, () =>      // wait 5 seconds
                        //                    {
                        //                        sayMessageTo(1, "Prepare_For_Takeoff");
                        //                        //sayMessageTo(1, "Understood_Villa_Leader_Hostiles_continue_approaching_your_sector");
                        //                    }
                        //                    );

                        break;
                        #endregion
                        case 2: // hurricane squadron
                            #region hurricane squadron
                            GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/aus3/red/hurricane_b.mis");
                            sendScreenMessageTo(1, "Hurricane squadron activated", null);
                            break;
                            #endregion
                        default: // hurricane squadron
                            #region hurricane squadron
                            GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/aus3/red/hurricane_b.mis");
                            sendScreenMessageTo(1, "Hurricane squadron activated", null);
                            break;
                    }
                        #endregion
                    //GamePlay.gpPostMissionLoad(CreateAIHurricaneFlight(player));
                    sayMessageTo(1, "Hurricane");
                    sayMessageTo(1, "Takeoff");
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.Write(player.Name() + " ordered 'hurricane squadron' flight (OnOrderMissionMenuSelected)" + "\r\n");
                    Console.ResetColor();
                    Timeout(15 * 60, () =>      // reset menu in 15 minutes
                    {
                        SetMainMenu(player);
                    }
                    );
                    break;
                case 2: // send bombers to Calais France
                    #region Blenheim squadron
                    GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/aus3/red/Blenheim_Mk1.mis");
                    sendScreenMessageTo(1, "Blenheim squadron activated at Canterbury", null);
                    sayMessageTo(1, "Blenheims");
                    sayMessageTo(1, "Takeoff");
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.Write(player.Name() + " ordered 'send bombers to Calais France' flight (OnOrderMissionMenuSelected)" + "\r\n");
                    Console.ResetColor();
                    Timeout(15 * 60, () =>      // reset menu in 15 minutes
                    {
                        SetMainMenu(player);
                    }
                    );
                    break;
                    #endregion
                case 3:
                    PrintIndexAndKeysAndValues(KilledAircraft);

                    break;
                case 4:
                    PrintIndexAndKeysAndValues(KilledAircraft);

                    break;
                case 5: // number of red AI planes in battle
                    {
                        AiAircraft a = player as AiAircraft;
                        if (a != null)
                        {
                            sendScreenMessageToPilot(a, " red aircraft in the battle", null);
                        }
                        break;
                    }

                case 0:
                    SetMainMenu(player);
                    break;
                default:
                    SetMainMenu(player);
                    break;
            }
        }
    }
    #endregion

    public void SetMainMenu(Player player)
    #region create custom menu for player
    {
        if (player.Army() == 2) // blue side
            GamePlay.gpSetOrderMissionMenu(player, true, 2, new string[] 
            { 
                "Order Ju87 staffel to bomb Dover",
                "Order Heinkel staffel to bomb Dover",
                "Order Ju87 staffel to bomb Hawkinge airfield",
                "Order FW200 to recon Dover & Ramsgate",
                "Order Dorniers to bomb Marston airfield",
                "."
            }, new bool[] { true, true, true, true, true, true });
        else  // red side
            GamePlay.gpSetOrderMissionMenu(player, true, 1, new string[] 
            { 
                "Order hurricane sqdn to patrol Dover", 
                "Order blenheim sqdn to bomb Calais",
                "."
                //"Show number of allied planes in battle"
            },
                new bool[] { true, true, true });
        
    }
    #endregion
__________________
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; 06-17-2012 at 01:17 AM.
Reply With Quote
  #5  
Old 06-17-2012, 04:48 AM
FG28_Kodiak FG28_Kodiak is offline
Senior Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

to 2: seems not possible, i am found no trick to do that, also. But feel free to correct me.
Reply With Quote
Reply

Thread Tools
Display Modes

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 09:06 AM.

Based on a design by: Miner Skinz.com

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2007 1C Company. All rights reserved.