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

#1
New morning, fresh head.

For found item under cursor (in 'repeatedly_execute()'):
Code: ags

InventoryItem * item;

function repeatedly_execute()
{
    item = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
}


Need setting 'Inventory: Override built-in inventory window click handling = True.
For pickup item from inventory (by left click) and release (by right click):
Code: ags
function on_mouse_click(MouseButton button)
{
  if (button == eMouseLeftInv) {
    player.ActiveInventory = item;
    mouse.ChangeModeGraphic(eModeUseinv, item.CursorGraphic);
  }
  if (button == eMouseRight)
  {
    if (player.ActiveInventory != null) {
      mouse.Mode = eModePointer;
      player.ActiveInventory = null;
    }
  }
}


For using item on object in room-script:
Code: ags
function UseBook()
{
  InventoryItem * item = player.ActiveInventory;
  Object * obj = Object.GetAtScreenXY(mouse.x, mouse.y);
  // compare item and object
  // ...
}
#2
Hello.

I have a problem with scripting.
I cannot pick up item from inventory gui when left-clicking on them. But in default demo game is worked.
Code: ags
mouse.Mode = eModeInteract;
, not helped me.



When i click on book in inventory-gui, cursor changed to 'pointer' and not change back to 'pick up' icon.

Global script is here(AGS 3.3.2.0).

In searching i find much deprecated code, what not work in my version AGS.
SMF spam blocked by CleanTalk