Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: simulacra on Mon 09/08/2004 13:40:55

Title: How do I know which inventory item was used in unhandled_event?
Post by: simulacra on Mon 09/08/2004 13:40:55
I the unhandled_event function, I want to create a default event when a certain inventory item is used. But how do I know which one the player used?
Title: Re: How do I know which inventory item was used in unhandled_event?
Post by: Ashen on Mon 09/08/2004 15:33:32
I think you'd use the character[CHARID].activeinv variable, so something like:

    if (character[GetPlayerCharacter()].activeinv == 1) {
      Display ("That doesn't need unlocking.");
    }
Title: Re: How do I know which inventory item was used in unhandled_event?
Post by: Proskrito on Mon 09/08/2004 17:18:44
or also, from the manual:

game.inv_activated : Inventory item that the player last clicked on. Useful for unhandled_event.