question for better inventory system in bgt
hello all,
In your_adventure we make use of a inventory system, but right now are all the items that can be obtained in the current version listed in this system.below is a part of the code i use with a question afterwards:
void inventory()
{
show_game_window("your inventory");
while(true)
{
dynamic_menu inven;
inven.add_item_tts("resources");
inven.add_item_tts("tools");
inven.add_item_tts("combat usables");
inven.add_item_tts("food");
inven.add_item_tts("miscelanious");
inven.add_item_tts("turn back");
menu_result=inven.run("this is your inventory. select a category to acces the items you have.", true);
if(menu_result == 1)
{
show_game_window("resource inventory");
dynamic_menu res;
res.add_item_tts("fishes ... you own "+fish+" hit enter to examine");
res.add_item
_tts("salmons ... you own "+salmon+" hit enter to examine");
res.add_item_tts("grane ... you own "+grane+" hit enter to examine");
res.add_item_tts("flour ... you own "+flour+" hit enter to examine");
res.add_item_tts("turn back");
menu_result=res.run("this is your inventory of resources.", true);
if(menu_result == 1)
{
v.stop();
v.speak_wait("a small silver coloured fish, ready for cooking.");
inventory();
}
if(menu_result == 2)
{
v.stop();
v.speak_wait("a middle-sized pink coloured salmon. ready for cooking");
inventory();
}
if(menu_result == 3)
{
v.stop();
v.speak_wait("a bush of tall granes tied up together");
inventory();
}
if(menu_result == 4)
{
v.stop();
v.speak_wait("a sack filled with flour to bake delicious loafs of bread");inventory();
}
if(menu_result == 5)
{
v.stop();
v.speak_wait("alright. leaving the resource inventory.");
break;
}
}
As you may notice,quite clunky isn't it? but what i want to know, how can i edit this code so it doesn't display the items you don't have? and only will display the items you do have?
Please an example, since i learn the most from examples.
thanks in advance.
Hope to hear from you soon.
greetz mike
_______________________________________________ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector