View Single Post
  #3  
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