Help me perfectionize my custom inventory screen

Started by HillBilly, Mon 26/12/2005 18:28:36

Previous topic - Next topic

HillBilly

Hello,

In my new game, I wanted a custom inventory screen. Nothing fancy, just a normal inventory GUI so I could change the graphics, instead of using the default grey box. So, now I got a button GUI on the bottom-right side of the screen that opens GUI 2, which is the inventory GUI you get if you open up a new "default template game". Now, here's the problems:

When you move your mouse over the button GUI, I want the cursor to change to cursor mode 6. I've tried placing SetMouseCursor (6); right under if (interface == INVENTORY) { with no success. I'm not a good coder, but I think I'm totally off track here, and I have no idea what to do next. So in short, I want cursor mode to change when you roll over the inventory button GUI.

Now for my second problem, which is much more severe. When I look at or use an inventory item with another, I want the inventory GUI to go off, let the player character say/do something, and then go on again. Just like a good inventory screen should. Unfortunately, it don't. The screen is still on when the character comments in "Look at" mode, and when it tries to play an animation, the game just stops. And by stop, I mean that it's in waiting mode, and the first frame of the animation stands still, behind the inventory screen GUI.

I hope I explained this clearly enough, because I'm clueless. GUI's has NEVER been a strong point of mine.

Just in case, here's the code for the inventory GUI:

Code: ags
  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;
}
}


And here's the code for the inventory button GUI:

Code: ags
   if (interface == 4) {
    if (button == 0) {  // show inventory
      GUIOn(2);
  } 
  }


Thank you.

Elliott Hird

repeateadly execute, add a check

if (GetGUIAt(mouse.x, mouse.y) == YOURGUI) {
  Blah blah blah cursor mode blahdi blahblah
}

Look up in the manual for GetGUIAt, i plucked that off top of my head, probably doesnt exist

Mordalles

with the 2nd problem, maybe i can help, though i dont know if i will.

on the interactions page of an inventory item, u will do in the following:

say for example you look at the item, then in the look at iventory option you add a run script and then edit the script and then just say:

"ginventorygui.visible = false;
ccharacter.say("that looks nice");
ginventorygui.visible = true;
"

or if you under use inv option:

"ginventorygui.visible = false;
ccharacter.say("i think ill use these to items 2gether");
ccharacter.lockview(5);
ccharacter.animate(0,6,eblock,forwards . . .);
ccharacter.unlockview();
ginventorygui.visible = true;
"

im not sure if i helped.  ;D

creator of Duty and Beyond

SMF spam blocked by CleanTalk