Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: x_traveler_x on Fri 28/01/2005 07:27:08

Title: "No Items" global message 996 doesn't appear [SOLVED]
Post by: x_traveler_x on Fri 28/01/2005 07:27:08
 ???  Okay, I feel stupid because I can't figure this out:

As we all know, AGS has a built-in Inventory GUI by default.  When enabled, global message 996 is displayed to indicate that you currently have no items in your inventory. 

Well, after I created a custom GUI, the message no longer appears, but I'd really like for the message to be displayed instead of the GUI until the first item is picked up.

I know I must be overlooking some kind of minor setting or a variable of some kind.  :-\

Thanks
Title: Re: "No Items" global message 996 doesn't appear
Post by: Radiant on Fri 28/01/2005 09:57:41
In the code that pops up your inventorywindow (GUIOn), add something like this,

if (game.num_inv_carried == 0) Display ("You don't have anything!");
else GUIOn (INVENTORY);


(not sure if I spelled that var correctly, so check the manual)
Title: Re: "No Items" global message 996 doesn't appear
Post by: Ishmael on Fri 28/01/2005 13:10:17
Direct copypaste from the Manual (Text Script Global Variables reference) (with the addition of the bold tags):

game.num_inv_itemsÃ,  Number of different inventory items which the current player is carrying.

This one, I reckon, is the one you were looking for.
Title: Done!
Post by: x_traveler_x on Fri 28/01/2005 17:58:01
Yes, that's it!

Thanks for pointing it out to me, I don't know how I missed it.