ProcessClick freezing game

Started by Theme, Sat 13/08/2005 21:25:31

Previous topic - Next topic

Theme

when i use ProcessClick(x,y)
and at x,y there is a invetory item
the game is pauses it self and the interaction don't run

o/

Ashen

1. It should be ProcessClick(x.y.mode) - but that might just be how you've typed it here and not how it is in script, so it doesn't overly matter.

2.
Quote from: The Manual
NOTE: This function ignores all interfaces and acts as though the point is directly visible. In other words, if the co-ordinates you pass happen to lie on a button on an interface, what actually happens will be as if the user clicked behind the interface onto the actual screen.

So, since the inventory item is on a GUI, it won't run the interaction you want (unless I've misunderstood something). Not sure why it freezes, though - what is on screen at the co-ords, under the GUI?

What are you trying to do, and what (exact) script have you got? There may be another way.
I know what you're thinking ... Don't think that.

Theme

the game is actually paused
on pause mode level 1
i dont know why it pauses

so i changed to inventory[guicoinitemcatch.ID].RunInteraction(mouse.Mode);
and it worked look and talk modes but interaction it didnt work.

then I made the mouse.mode change to interact when you press to show up the inventory gui, like this:

if (keycode==73) {
      gInventory.Visible = true;      
      Mouse.Mode = eModeInteract;
      Mouse.UseModeGraphic(eModeWalkto);
      }

the gui shows up and the mouse is in interaction mode

if I left click a item, it becomes the active mouse cursor
if I use the item on another inv item the game pauses again >(

I noticed too that when I right click the item it runs the look event of the item:

#sectionstart inventory1_c  // DO NOT EDIT OR REMOVE THIS LINE
function inventory1_c() {
  // script for Inventory item 1 (Noobsh Tool): Look at inventory item
ShakeScreen(1);
gInventory.Visible = false;
}

and that is strange because I only have this

function on_mouse_click(MouseButton button) // called when a mouse button is clicked. button is either LEFT or RIGHT  {
  if (IsGamePaused() == 1) // Game is paused, so do nothing (ie. don't allow mouse click)    {    }
  else if (button == eMouseLeft) ProcessClick(mouse.x,mouse.y, mouse.Mode);
  else // right-click, so cycle cursor  {  }
  }

o/

Ashen

What's the 'Visibility:' type of the Inventory GUI? If it's 'Popup Modal', that would explain why the game is pausing.

I'm still not sure what you're trying to do - just get it to Interact with an item, and not set it as active, I guess?

IIRC, AGS handles Inventory clicks a little differently than other clicks. By default, using 'Interact' on an inventory item sets it as active - if you want it to do something else you need to check the Handle Inventory clicks in script (or however it's worded now) box on the 'General Settings' window and do a bit of other fiddling about with the script (to include eMouseLeftInv and eMouseRightInv conditions). The easier way is to put what you want to happen under a different mode, e.g. eModePickup, and use that on the item, instead of eModeInteract.

I'm fairly sure the 'Right Click = Look' thing is part of the default behaviour too, and you need to do the Handle Inventory clicks in script thing if you want to get rid of it.

Also, and this has nothing to do with the problem, couldn't you use guicoinitemcatch.RunInteraction(mouse.Mode), in place of inventory[guicoinitemcatch.ID].RunInteraction(mouse.Mode)? I'm still a little shaky on 2.7.
I know what you're thinking ... Don't think that.

Theme

Everything is working now

The handles Inventory clicks was checked, so I unchecked and made some modifications in the script and now it is working.
but i still have that Right Click == Look (when mouse mode is Useitem) problem
Is there any other way to solve that problem without marking the handles Inventory clicks? Or it only works the way you mentioned  ???

o/

SMF spam blocked by CleanTalk