Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Sam. on Sat 26/03/2005 16:58:40

Title: Process Click for inventory
Post by: Sam. on Sat 26/03/2005 16:58:40
For my gui, i want inventory items to be used automatically when clicked, and only combined if a button is pressed. I want my inventory window to be opened up, then , when you click on an inventory item, it is used on the selected hotpot (selecting the hotspot is already done). I tried using the "runhotspotinteraction" but this doesn't allow for conditionals and such. Is there a way to simulate selecting an inventory ieam and running its interaction without moving it from your inventory and only clicking once?
Title: Re: Process Click for inventory
Post by: Ishmael on Sat 26/03/2005 18:19:11
You can do it with RunHotspotInteraction. Just in the on_mouse_click:


  if (button == LEFTINV) {
    RunHotspotInteraction(HOTSPOTNUM, 4);
  }


And replace HOTSPOTNUM with a variable which defines the hotspot it's used with. In the hotspot interactions, set up your interaction for the "Inventory used with hotspot" interaction as usual.
Title: Re: Process Click for inventory
Post by: Sam. on Sat 26/03/2005 18:56:16
no, that doesn't work, because you can't set it to specific inventory items.
Title: Re: Process Click for inventory
Post by: Ishmael on Sat 26/03/2005 20:09:34
if (game.inv_activated == 1)
Title: Re: Process Click for inventory
Post by: Pumaman on Tue 29/03/2005 14:33:56
You can use SetActiveInventory to change the active inv item before you call RunHotspotInteraction, then change it back afterwards if you like.