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

#21
Hello everyone! I've recently started using AGS and I'm working on a project which uses a single mouse format rather than the multiple verb style a lot of adventure games go for. I've  read a few threads on the subject and found this one which seemed to give me the best luck so far: http://www.adventuregamestudio.co.uk/forums/index.php?topic=46511.0

I've tried using the code Khris posted there, however I'm having an issue.
The movement works perfectly, and the interaction works perfectly, however I'm finding that left clicking on inventory items isn't setting them to my active inventory. Is this because my Inventory is always on screen?
And lastly, I'd like to change what the mouse looks like based on what is under it. Is this something I should do in repeatedly execute? If so, how would I go about it?

Here's the function I'm currently handling this in.

Code: ags

int lt = GetLocationType(mouse.x, mouse.y);
  InventoryItem*ai = player.ActiveInventory, ia = inventory[game.inv_activated];
 
  if (button == eMouseLeft) {
    if (lt == eLocationNothing) ProcessClick(mouse.x, mouse.y, eModeWalkto);
    else if (ai) ProcessClick(mouse.x, mouse.y, eModeUseinv);
    else ProcessClick(mouse.x, mouse.y, eModeInteract);
  }
  else if (button == eMouseRight) {
    if (ai) player.ActiveInventory = null;
    else ProcessClick(mouse.x, mouse.y, eModeLookat);
  }
  else if (button == eMouseLeftInv) {
    if (ai) ia.RunInteraction(eModeUseinv);
    else player.ActiveInventory = ia;
  }
  else if (button == eMouseRightInv) {
    if (ai) player.ActiveInventory = null;
    else ia.RunInteraction(eModeLookat);
  }int lt = GetLocationType(mouse.x, mouse.y);
  InventoryItem*ai = player.ActiveInventory, ia = inventory[game.inv_activated];
 
  if (button == eMouseLeft) {
    if (lt == eLocationNothing) ProcessClick(mouse.x, mouse.y, eModeWalkto);
    else if (ai) ProcessClick(mouse.x, mouse.y, eModeUseinv);
    else ProcessClick(mouse.x, mouse.y, eModeInteract);
  }
  else if (button == eMouseRight) {
    if (ai) player.ActiveInventory = null;
    else ProcessClick(mouse.x, mouse.y, eModeLookat);
  }
  else if (button == eMouseLeftInv) {
    if (ai) ia.RunInteraction(eModeUseinv);
    else player.ActiveInventory = ia;
  }
  else if (button == eMouseRightInv) {
    if (ai) player.ActiveInventory = null;
    else ia.RunInteraction(eModeLookat);
  }


Any help would be very much appreciated!


[EDIT]
As for the not being able to select inventory items, I've solved the issue. I feel a bit foolish, but all I had to do was set "Override built-in inventory window click handling" in general settings.
I am still trying to make the cursor graphic change when hovering over a hotspot, object, or inventory object though, so I've changed the title of the thread, but I'll leave the previous stuff just in case anyone else has the same issue. Any help would again be very appreciated.
SMF spam blocked by CleanTalk