Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Game Creator on Mon 19/12/2011 05:55:20

Title: Want Only One Inventory Item To Work On Object
Post by: Game Creator on Mon 19/12/2011 05:55:20
Hi

I've Searched Through The Manual In The Section's I Thought Would Have It.
Now My Character Has Many Inventory Item's That Need To Be Used On Many Different Objects.
While Testing The Game I Realised That I Could Use Any Inventory Item On Them.
So What I'm Asking Is How Can I Make It So That Only One Specific Inventory Item Will Work On The Specific Object.
I Have been Through Many Pages On The Forum And Also Searched, I Couldn't Find Anything So I'm Asking If Anyone Could Help Please.

Thanks

Also I'm Aware That This Is My Second Topic in Two Day's. Sorry :)
Title: Re: Want Only One Inventory Item To Work On Object
Post by: Gudforby on Mon 19/12/2011 06:26:18
You need to check which inventory item is the active one.


if (player.ActiveInventory==iItem)
{
 //do stuff
}
else
{
  //do some other stuff
}
Title: Re: Want Only One Inventory Item To Work On Object
Post by: Game Creator on Mon 19/12/2011 06:28:22

Thank You I Will Give It a Try, Hopefully It Works.
Title: Re: Want Only One Inventory Item To Work On Object
Post by: Khris on Mon 19/12/2011 11:42:29
Are there going to be lots of these questions?
Because as you might imagine, all of those have been asked and answered a few hundred times already.
Please exhaust the available resources first, most importantly Densming's video tutorials: http://www.youtube.com/densming#p/c/0/1Ml_DR76Cl4

(Which you should have found if you had bothered to read the READ FIRST *BEFORE* POSTING thread.
Also, you're again capitalizing every single fucking word. If this is a severe case of OCD or something, ok, but if it isn't, please stop; it's really annoying. And I don't buy the GTA excuse. Really?)
Title: Re: Want Only One Inventory Item To Work On Object
Post by: Calin Leafshade on Mon 19/12/2011 17:07:13
yea stop with the caps, that angers me.
Title: Re: Want Only One Inventory Item To Work On Object
Post by: Game Creator on Mon 19/12/2011 22:52:41
Hi

i'll post when i get around to fixing the problem, i'll let you know if there are problems. aslo.

well i'm sorry about not thinking of using the video tutorial, also i do not have ocd. every game i play my pinky in always over the shift key and it a habit not OCD. by the way i'm not angry i'm just saying.