inventory scrolling

Started by Dave Gilbert, Sat 05/07/2003 21:13:57

Previous topic - Next topic

Dave Gilbert

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;
 }



Scorpiorus

Are the buttons assigned correct (run script etc)... just to be sure :)

Dave Gilbert

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...

Dave Gilbert

Never mind.  I'm a dope.  I didn't have "run script" enabled for the buttons.   :-X

It's always something simple...

Scorpiorus

#4
how about adding Display("hi"); just after the if (interface==3) {... :P

EDIT: ok :)

TerranRich

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
Status: Trying to come up with some ideas...

SMF spam blocked by CleanTalk