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
  #1  
Old 05-19-2011, 09:30 AM
MadTommy MadTommy is offline
Approved Member
 
Join Date: Jan 2011
Posts: 493
Default

Great thread.. very helpful. Personally not really interested in any capture the flag kind of gameplay, just not my thing, but i am playing with the random mission selection.

To this i have a question.

How do i alter ths code to add a case? I could guesses and i'm sure i would get there through trial & error, but i'm sure someone here can show me

Can someone add a case to the below script so i can see how it is done? Thanks!

Code:
 // randomly selects 1 of several submissions excluding the recent one

            Random RandomIncident = new Random();
            int CurrentMissionSelected;

            do
                {
                CurrentMissionSelected = RandomIncident.Next(1, 4);
                }
            while (LastMissionLoaded == CurrentMissionSelected);

            LastMissionLoaded = CurrentMissionSelected;

            switch (CurrentMissionSelected)

            {
            case 1:
                GamePlay.gpPostMissionLoad("missions/Multi/15Sept1940/15Sept1940_R1.mis");
                /*
                GamePlay.gpHUDLogCenter("mission objectives updated.");
                    //600
                initTime = 0.0;
                Timeout(initTime += 600, () =>
                {
                    GamePlay.gpHUDLogCenter("Attention! Enemy activity is expected at E3!");
                });
                Timeout(initTime += 600, () =>
                {
                    GamePlay.gpHUDLogCenter("Attention! Help is needed at E3/D4!");
                })*/
                ;
                 
                break;
            case 2:
                GamePlay.gpPostMissionLoad("missions/Multi/15Sept1940/15Sept1940_R2.mis");
                /*
                GamePlay.gpHUDLogCenter("mission objectives updated..");
                    //500
                initTime = 0.0;
                Timeout(initTime += 500, () =>
                {
                    GamePlay.gpHUDLogCenter("Attention! Cover your shipping at C4!");
                });

                Timeout(initTime += 300, () =>
                {
                    GamePlay.gpHUDLogCenter("Attention! Ships are under attack at C4!");
                })*/
                ;
                
                break;
            case 3:
                GamePlay.gpPostMissionLoad("missions/Multi/15Sept1940/15Sept1940_R3.mis");
                /*
                GamePlay.gpHUDLogCenter("mission objectives updated...");
                    //600
                initTime = 0.0;
                Timeout(initTime += 600, () =>
                {
                    GamePlay.gpHUDLogCenter("Attention! Enemy activity is expected at E2!");
                });
                Timeout(initTime += 300, () =>
                {
                    GamePlay.gpHUDLogCenter("Attention! All airgroups please proceed to E2/D3!");
                })*/
                ;
                
                break;
        }
(i'm not using the message system presently)

Last edited by MadTommy; 05-19-2011 at 09:32 AM.
Reply With Quote
  #2  
Old 05-19-2011, 10:22 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

it is easy

Code:
          switch (CurrentMissionSelected)

            {
            case 1:
                GamePlay.gpPostMissionLoad("missions/Multi/15Sept1940/15Sept1940_R1.mis");
                /*
                GamePlay.gpHUDLogCenter("mission objectives updated.");
                    //600
                initTime = 0.0;
                Timeout(initTime += 600, () =>
                {
                    GamePlay.gpHUDLogCenter("Attention! Enemy activity is expected at E3!");
                });
                Timeout(initTime += 600, () =>
                {
                    GamePlay.gpHUDLogCenter("Attention! Help is needed at E3/D4!");
                })*/
                ;
                 
                break;
            case 2:
                GamePlay.gpPostMissionLoad("missions/Multi/15Sept1940/15Sept1940_R2.mis");
                /*
                GamePlay.gpHUDLogCenter("mission objectives updated..");
                    //500
                initTime = 0.0;
                Timeout(initTime += 500, () =>
                {
                    GamePlay.gpHUDLogCenter("Attention! Cover your shipping at C4!");
                });

                Timeout(initTime += 300, () =>
                {
                    GamePlay.gpHUDLogCenter("Attention! Ships are under attack at C4!");
                })*/
                ;
                
                break;
            case 3:
                GamePlay.gpPostMissionLoad("missions/Multi/15Sept1940/15Sept1940_R3.mis");
                /*
                GamePlay.gpHUDLogCenter("mission objectives updated...");
                    //600
                initTime = 0.0;
                Timeout(initTime += 600, () =>
                {
                    GamePlay.gpHUDLogCenter("Attention! Enemy activity is expected at E2!");
                });
                Timeout(initTime += 300, () =>
                {
                    GamePlay.gpHUDLogCenter("Attention! All airgroups please proceed to E2/D3!");
                })*/
                ;
                
                break;
       
   case 4:
            //your code
   break;

   case 5:
            //your code
   break;

     
}
Reply With Quote
  #3  
Old 05-19-2011, 10:54 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

And in this line you put number of your cases+1

Code:
            do
                {
                CurrentMissionSelected = RandomIncident.Next(1, 4);
                }
4 for 3 cases
5 for 4 cases
etc
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 08:53 PM.


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