Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: McMonsterBrothers on Tue 31/05/2011 06:06:46

Title: Inventory items used on things help?
Post by: McMonsterBrothers on Tue 31/05/2011 06:06:46
Ok, i need help lol.

My problem is, I want to make it so a certain thing happens if the player uses a specific inventory item on a hotspot.
And I want something else to happen if the player uses anything other than that inventory item on that hotspot.

Can you please help?
I cant seem to figure out how to set it up so it will work properly, I know that it is probably easy, but this is my first game XD and I need all the help I can.
Title: Re: Inventory items used on things help?
Post by: Khris on Tue 31/05/2011 06:48:12
Asked and answered countless times. Please use the forum search first.

function hDoor_UseInv() {

  if (player.ActiveInventory == iKey) {
    Display("You unlock the door.");
    ...
  }
  else {
    Display("That doesn't work.");
  }
}
Title: Re: Inventory items used on things help?
Post by: selmiak on Mon 06/06/2011 00:05:04
I was also desperately searching for this in the basic AGS Tutorial on the main website. Maybe adding this there will reduce the frequency this question is asked ;)