2014-11-07 23:31:08

Hey all, I have the menuX class
. I am trying to use it with the following code:
#include"menuX.bgt"
void main() {
show_game_window("menux test");
dynamic_menu menu;
menu.add_click_sound("menux/click.wav");
menu.add_enter_sound("menux/enter.wav");
menu.add_item_tts("choice 1.2.1.3.1.2.1");
menu.add_item_tts("xb4");
menu.add_item_tts("quit menux");
menu.allow_escape=true;
int menuc=menu.run("select a choice",true);
if(menuc==0) {
exit();
}
}
And I get the following error:

File: C:\Program Files (x86)\BGT\include\menuX.bgt
On line: 151 (1)
Information: Compiling double dynamic_menu::run_extended(string, bool, double, bool)

File: C:\Program Files (x86)\BGT\include\menuX.bgt
On line: 202 (1)
Line: loadsound();
Error: No matching signatures to 'loadsound()'


What am I doing wrong, What else do I need to use this thing?

I post sounds I record to freesound. Click here to visit my freesound page
I usually post game recordings to anyaudio. Click here to visit my anyaudio page

2014-11-07 23:32:03

That class is really really old.  would suggested using enhanced_menu, you can find it in the bgt code up for grabs forum,

I like to sleep, Sleep is good,
This is how I do it: Lie on a nice warm cozy bed, and dream dreams about how to rule the world!
Follow @TheGreatAthlon5 on twitter for humorous facts and game updates!
If you like my posts, thumb me up!

2014-11-07 23:33:10

The one that aaron created? It doesn't have support for added sounds etc.

I post sounds I record to freesound. Click here to visit my freesound page
I usually post game recordings to anyaudio. Click here to visit my anyaudio page

2014-11-08 17:15:47

Yes, downloaded the class and confirmed that.

I post sounds I record to freesound. Click here to visit my freesound page
I usually post game recordings to anyaudio. Click here to visit my anyaudio page

2014-11-09 01:53:49

Yeah, but this one just doesn't look like it's going to work any more. :-) You can always use a callback for the sounds, although it's a bit more involved.
Lukas

I won't be using this account any more or participating in the forum activity through other childish means like creating an alternate account. I've asked for the account to be removed but I'm not sure if that's actually technically possible here. Just writing this for people to know that I won't be replying, posting new topics or checking private messages until the account is potentially removed.

2014-11-09 02:20:18

I was talking about the henahced_menu class that Jason SW made

I like to sleep, Sleep is good,
This is how I do it: Lie on a nice warm cozy bed, and dream dreams about how to rule the world!
Follow @TheGreatAthlon5 on twitter for humorous facts and game updates!
If you like my posts, thumb me up!

2014-11-09 09:51:52

Oh, where is it? I wonder? going to look at the up for grabs forum again.

I post sounds I record to freesound. Click here to visit my freesound page
I usually post game recordings to anyaudio. Click here to visit my anyaudio page

2014-11-09 10:01:46

Nope, couldn't find it. Plz can someone give me a class like that? I don't know how to make enter, escape and Wrap sounds with callback so Im interested. Thx.

I post sounds I record to freesound. Click here to visit my freesound page
I usually post game recordings to anyaudio. Click here to visit my anyaudio page

2014-11-10 04:52:51

http://www.blastbay.com/forum/viewtopic.php?id=1557

2014-11-10 17:06:51

Hi Jason, thank you a lot for your help. Maybe I'm being too ungreatful here, but can you give me an example about how to use the menü? Since naming is no longer optionel, I don't know how to use it with naming. thanks a lot again.

I post sounds I record to freesound. Click here to visit my freesound page
I usually post game recordings to anyaudio. Click here to visit my anyaudio page

2014-11-11 04:40:32 (edited by Jason SW 2014-11-11 04:42:13)

Excerpts from the Gotcha source, with some extra comments added:

In include/init.bgt:

void game_init()
{
...
menu.allow_escape = true;
menu.wrap_x = true;
menu.wrap_y = false;
menu.max_pan = 10;
menu.set_callback(menu_checks, "");
menu.open_path = lib.sound_path + "/menu_open." + lib.default_extension;
menu.close_path = lib.sound_path + "/menu_close." + lib.default_extension;
menu.move_path = lib.sound_path + "/step1." + lib.default_extension;
menu.wrap_path = lib.sound_path + "/step2." + lib.default_extension;
...
menu.set_tts_object(speech.sapi);
menu.set_speech_mode(speech.mode);
...
} // game_init

In include/menus.bgt:

void main_menu()
{
string menu_position="start";

...
while (true)
{
...
menu.reset(false);
menu.resize(5,1); // Five menu options along the X axis (Horizontal menu.)
/*
Note here that add_item_2d and add_item_tts_2d can take x and y coordinates after the option name, though they are optional. If left out, the methods will use the next available option object.
If you're not going to use horizontal menus, you don't need to call resize.
*/
menu.add_item_tts_2d("Start game", "start");
menu.add_item_tts_2d("Load game", "load");
menu.add_item_tts_2d("Test speakers", "test");
menu.add_item_tts_2d("Options", "options");
menu.add_item_tts_2d("Exit", "exit");
menu_position = menu.run_extended("Main menu. Use left/right arrow keys to select an option, enter to activate.", true, menu_position, true);
// run/run_extended return "err" if an error occurs, or "esc" if the escape key is pressed.
speech.stop();
if (menu_position == "err")
{
log.fatal("main_menu", "Failed to run menu.");
} // if
else if (menu_position == "start")
{
start_game();
} // else if
else if (menu_position == "load")
{
load_game();
} // else if
else if (menu_position == "test")
{
test_speakers();
} // else if
else if (menu_position == "options")
{
options_menu();
} // else if
else
{
exit_game();
} // else
} // while
} // main_menu

Excerpts from the Giftanum source (So far unreleased version):

In include/menus.bgt:

void main_menu()
{
string menu_position;

menu.open_path = "s/023";
menu.close_path = "s/022";
menu.move_path = "s/006";
menu_position = "start";
...
while (true)
{
...
menu.reset(false);
menu.add_item_tts_1d("Start game", "start");
menu.add_item_tts_1d("Load game", "load");
menu.add_item_tts_1d("View scoreboards", "view");
menu.add_item_tts_1d("Test speakers", "test");
menu.add_item_tts_1d("Options", "options");
menu.add_item_tts_1d("Exit", "exit");
menu_position = menu.run_extended("Main menu. Use arrow keys to select an option, enter to activate.", true, menu_position, true);
speech.stop();
if (menu_position == "err")
{
log.fatal("main_menu", "Failed to run menu.");
} // if
else if (menu_position == "start")
{
difficulty_menu();
} // else if
else if (menu_position == "load")
{
load_game();
} // else if
else if (menu_position == "view")
{
scoreboard_menu();
} // else if
else if (menu_position == "test")
{
test_speakers();
} // else if
else if (menu_position == "options")
{
options_menu();
} // else if
else
{
exit_game();
} // else
} // while
} // main_menu

I hope these examples help you.

2014-11-11 17:09:00

Thanks a lot.

I post sounds I record to freesound. Click here to visit my freesound page
I usually post game recordings to anyaudio. Click here to visit my anyaudio page