Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Meny on Sun 06/01/2008 11:56:35

Title: How to know if character has the object?
Post by: Meny on Sun 06/01/2008 11:56:35
I remember that I saw the option to make - if the character have object one do that and that, I search the manual and didn't find. It is exist? Could you direct me where in the manual it written?

Thanks!
Title: Re: How to know if character has the object?
Post by: Galen on Sun 06/01/2008 14:18:32
Use:

if(player.InventoryQuantity[iwhateveritemyouwanttouse.ID]==1)
{
code to execute
}

The .ID may be redundant, but it should work.
Title: Re: How to know if character has the object?
Post by: Dualnames on Sun 06/01/2008 16:11:10
Quote from: Meny on Sun 06/01/2008 11:56:35
I remember that I saw the option to make - if the character have object one do that and that, I search the manual and didn't find. It is exist? Could you direct me where in the manual it written?

Thanks!

This makes little sense... if someone understands tell me.
Title: Re: How to know if character has the object?
Post by: Galen on Sun 06/01/2008 16:33:52
He wants an action to be performed if the player has a specific item. Hence the code I provided.