![]() |
|
#1
|
|||
|
|||
![]()
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; } Last edited by MadTommy; 05-19-2011 at 09:32 AM. |
#2
|
|||
|
|||
![]()
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; } |
#3
|
|||
|
|||
![]()
And in this line you put number of your cases+1
Code:
do { CurrentMissionSelected = RandomIncident.Next(1, 4); } 5 for 4 cases etc |
![]() |
Thread Tools | |
Display Modes | |
|
|