Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: dikla on Fri 07/05/2004 00:11:49

Title: inventory size - only 8 items?
Post by: dikla on Fri 07/05/2004 00:11:49
i tried my game and there is only 8 items in my inventory althou i have more but they dont show up. (i saw that they are exist when i tried it with 2 items).
i serach for some facts here but from what i read it seems that there is nothing to do about it.
is it true? you can see only 8 items shown in the inventory???????? (not even up and down arrows?)
dikla
Title: Re: inventory size - only 8 items?
Post by: Ashen on Fri 07/05/2004 00:25:30
Are you asking whether you can have more than 8 items in your inventory, or whether it's possible to see more than 8 items at once? Either way, the answer is that you can. What inventory GUI are you using? If it's a custom one, you might need to play around with the inventory window size, or the button coding.
Title: Re: inventory size - only 8 items?
Post by: Moox on Fri 07/05/2004 03:33:17
Look at the bottom 2 buttons script in this gui, They scroll the inventory up and down


if (interface == INVENTORY) {
    // They clicked a button on the Inventory GUI
   
    if (button == 1) {
      // They pressed SELECT, so switch to the Get cursor
      SetCursorMode (MODE_USE);
      // But, override the appearance to look like the arrow
      SetMouseCursor (6);
    }
   
    if (button == 2) {
      // They pressed LOOK, so switch to that mode
      SetActiveInventory(-1);
      SetCursorMode(MODE_LOOK); 
    }
    if (button == 3) {
      // They pressed the OK button, close the GUI
      GUIOff (INVENTORY);
      SetDefaultCursor();
    }

    if ((button == 4) && (game.top_inv_item < game.num_inv_items - game.num_inv_displayed)) {
      // scroll down
      game.top_inv_item = game.top_inv_item + game.items_per_line;
    }
    if ((button == 5) && (game.top_inv_item > 0)){
      // scroll up
      game.top_inv_item = game.top_inv_item - game.items_per_line;
    }
  }
Title: Re: inventory size - only 8 items?
Post by: Proskrito on Fri 07/05/2004 10:01:52
if i remember correctly, there is a 'game.' variable called game.inv_items_displayed or something like that (i dont have ags here) that lets you define how many items are displayed in the inventory.
However, your inventory window must be big enough, of course ; ).
There were also a game.items_per_line or so variable, look them up in the manual, in the game. variables part.
I hope im right and not confusing you : )
Title: Re: inventory size - only 8 items?
Post by: Ashen on Fri 07/05/2004 12:23:37
game.items_per_line and game.num_inv_displayed are listed as read only variables, so I don't think you can use them to set anything.
Title: Re: inventory size - only 8 items?
Post by: Skio on Fri 07/05/2004 21:31:08
 You can also reduce the size of your item placeholders putting the command

SetInvDimensions(x, y);

in the game_start() function in the global script.

Ofcourse the items themeshelves should be drawn smaller.