Re: BGT confusion

Ok, I've come across a bit of a problem with the menus I'm working on. When the user starts up my game, they're plopped down in a list of the ships they're able to command, 5 in total. When the player arrows down and hits enter on the ship, it then brings up the correct captain menu thus far. However, when a person hits escape or the return to fleet (admiral's) menu item, it kicks them clean out of the game, and I can't figure out why. Here's the two functions:
void fleetmenu()
{
dynamic_menu admiral_menu;
admiral_menu.add_click_sound("sounds/menuclick.wav");
admiral_menu.add_enter_sound("sounds/federation_computer2.ogg");
admiral_menu.allow_escape = true;
admiral_menu.wrap = true;
admiral_menu.add_item_tts("Command Enterprise");
admiral_menu.add_item_tts("Command Lexington");
admiral_menu.add_item_tts("Command Defiant");
admiral_menu.add_item _tts("Command Hood");
admiral_menu.add_item_tts("Command Intrepid");
admiral_menu.add_item_tts("Quit game");
int shipchoice=admiral_menu.run_extended("Fleet Menu",true,1,true);
switch(shipchoice) {
case 1:
shipvalue=0;
commandmenu();
break;

case 2:
shipvalue=1;
commandmenu();
break;

case 3:
shipvalue=2;
commandmenu();
break;

case 4:
shipvalue=3;
commandmenu();
break;

case 5:
shipvalue=4;
commandmenu();
break;

case 6:
voice.speak_wait("Thank you for playing.");
exit();
}}

void commandmenu()
{
dynamic_menu captain_menu;
captain_menu.add_click_sound("sounds/menuclick.wav");
captain_menu.add_enter_sound("sounds/federation_computer2.ogg");
captain_menu.allow_escape = true;
captain_menu.wrap = true;
captain_menu.add_item_tts("Course ");
captain_menu.add_item_tts("Warp Drive");
captain_menu.add_item_tts("Short-range scan");
captain_menu.add_item_tts("Long-range scan");
captain_menu.add_item_tts("Phasers");
captain_menu.add_item_tts("Photon Torpedos");
captain_menu.add_item_tts("Briefing");
captain_menu.add_item_tts("Return to Fleet Menu");
int orderchoice;
do
{
orderchoice = captain_menu.run(fed_shipname[shipvalue] + "Captain Menu", true);
if(orderchoice==1) {
voice.speak("not implemented");
//coursemenu(shipvalue);
}

else if(orderchoice==2) {
voice.speak("not implemented");
//speedmenu(shipvalue);
}

else if(orderchoice==3) {
voice.speak("not implemented");
//shortscan(shipvalue);
}

else if(orderchoice==4) {
voice.speak("not implemented");
//longscan(shipvalu e);
}

else if(orderchoice==5) {
voice.speak("not implemented");
//phaserlock(shipvalue);
}

else if(orderchoice==6) {
voice.speak("not implemented");
//photonlock(shipvalue);
}

else if(orderchoice==7) {
voice.speak("not implemented");
//briefing(shipvalue);
}

else if(orderchoice==8) {
return;
}

}
while(orderchoice!=0 and orderchoice!=9);
return;
}
Afraid I'm not a very good programmer in any language. sad

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : jsymes via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : jsymes via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : jsymes via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : stewie via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : jsymes via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Alan via Audiogames-reflector

Reply via email to