Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Dave Gilbert on Sat 05/07/2003 21:13:57

Title: inventory scrolling
Post by: Dave Gilbert on Sat 05/07/2003 21:13:57
Hi all,

Try as I might, I can't get this to work.  I have a "broken sword" type of inventory screen at the top and I can't get my game to register the button click.  Any tips?

Here's my code:

if (interface==3) // INVENTORY GUI
 {
     if ((button == 2) && (game.top_inv_item < game.num_inv_items - game.num_inv_displayed))      
     {
   
   game.top_inv_item = game.top_inv_item + game.items_per_line; // scroll up
   
     }
   if ((button == 1) && (game.top_inv_item > 0)) // scroll down      
     game.top_inv_item = game.top_inv_item - game.items_per_line;
 }


Title: Re:inventory scrolling
Post by: Scorpiorus on Sat 05/07/2003 21:47:30
Are the buttons assigned correct (run script etc)... just to be sure :)
Title: Re:inventory scrolling
Post by: Dave Gilbert on Sat 05/07/2003 21:51:41
Yeah, that's all correct.

I even added a bit of code to check if the game registered even REGISTERED the button click (I had the character say "hi") and that didn't even work, so I'm totally confuzzled...
Title: Re:inventory scrolling
Post by: Dave Gilbert on Sat 05/07/2003 22:02:01
Never mind.  I'm a dope.  I didn't have "run script" enabled for the buttons.   :-X

It's always something simple...
Title: Re:inventory scrolling
Post by: Scorpiorus on Sat 05/07/2003 22:03:07
how about adding Display("hi"); just after the if (interface==3) {... :P

EDIT: ok :)
Title: Re:inventory scrolling
Post by: TerranRich on Sat 05/07/2003 23:28:34
This might be in the Beginners' FAQ, the bit about making sure "Run Script" is set. HAH! N00B!! :P

Don't worry, I went for a week trying to figure out what the hell was wrong with my demo before i realized I didn't have that set for the buttons in my GUI. :D