Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Skio

#121
Thanks for your help. Your suggestions have been very useful.
I have managed however to solve the problem (actually go around it) with the following code:

In the repeatedly_execute function I put:

if (mouse.y>184) {                        // this checks if the cursor is over the inventory GUI
 
   if (GetGlobalInt(499)==0) { // this ensures that the mode change happens only once
       SetGlobalInt (499, 1);
       SetCursorMode (MODE_USE);
       SetMouseCursor (6);
       }
 }

 if ((mouse.y<184) && (GetCursorMode()!=MODE_USEINV) && (GetGlobalInt(499)==1)) {      // this reverts the cursor back to walk mode after leaving the inventory unless an item is selected
 SetCursorMode (MODE_WALK);
 SetGlobalInt(499, 0);
 }

This goes in the on_mouse_click function:

   if (button == RIGHTINV) {
     RunInventoryInteraction (game.inv_activated, MODE_LOOK);
     }


The script works fine, but the "Handle inventory clicks in script" must NOT be ticked.
I know this solution is a bit akward but it works.

I wait for your opinions.
#122
  I am designing an inventory GUI that is constantly visible on the bottom of the screen (resembling the one from "The Uncertainty Machine" [great game]).
 I tick "handle inventory clicks in script" and I use to following code in on_mouse_click function :

   if (button == LEFTINV) {
     RunInventoryInteraction (game.inv_activated, MODE_USE);
     }
   if (button == RIGHTINV) {
     RunInventoryInteraction (game.inv_activated, MODE_LOOK);
     }

The RIGHTINV part works normally, but I cannot make the cursor pick up the item with the LEFTINV.
I actually take no responce.
Putting MODE_USEINV instead of MODE_USE only interacts with the item and doesn't pick it up.

Any suggestions? I'm a begginer.

Thanks
SMF spam blocked by CleanTalk