Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: ------ on Sat 25/10/2008 13:39:43

Title: --------
Post by: ------ on Sat 25/10/2008 13:39:43
----
Title: Re: Problem with interactions between inventory items
Post by: Khris on Sat 25/10/2008 16:15:11
This line
  player.ActiveInventory = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
in the LeftInv code changes the player's ActiveInventory to the clicked one, and since RunInteraction is queued afaik, every item is always used on itself.
Removing it should be all you need to do.
Title: -----------
Post by: ------ on Sun 26/10/2008 01:35:56
--------
Title: Re: Problem with interactions between inventory items
Post by: Trent R on Sun 26/10/2008 03:28:30
The AGS default for selecting an inventory item uses the eModeInteract.

[Edit]:Side note: I personally would switch your inventory action to if == iVinagre, and use the else for "I can't". I think it makes more sense, and then you can add other interactions (which many games do for comedy or immersion purposes) if you so choose.

~Trent
Title: Re: Problem with interactions between inventory items
Post by: Khris on Sun 26/10/2008 08:36:34
Something must have happened to me lately, I can't think straight anymore...

  else if (button == eMouseLeftInv) {
    if (player.ActiveInventory != null) inventory[game.inv_activated].RunInteraction(mouse.Mode);
    else player.ActiveInventory = inventory[game.inv_activated];
  }
Title: ---
Post by: ------ on Wed 29/10/2008 01:16:18
--