Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: BorisZ on Tue 14/09/2004 06:47:39

Title: copies of items
Post by: BorisZ on Tue 14/09/2004 06:47:39
I just noticed that when same item is put into inventory several times, it shows just one icon, but it keeps track of number of items; and when you lose one of the items, rest of (same) items still stay in inventory. Is there an easy solution (I want item to dissapear even when there are multiple copies of that item in inventory), or do I have to code conditions for each object?
Title: Re: copies of items
Post by: Scummbuddy on Tue 14/09/2004 08:26:35
in the general settings pane, on the right side "Use multiple inventory items, multiple times"
tick that box
Title: Re: copies of items
Post by: Gilbert on Tue 14/09/2004 08:31:07
I think what he meaned was he really want the items to disappear immediately when they're used. In that case, he may really need to design the game so the player won't get copies of an item.
Title: Re: copies of items
Post by: BorisZ on Tue 14/09/2004 09:22:21
Quote from: Gilbot V7000a on Tue 14/09/2004 08:31:07
I think what he meaned was he really want the items to disappear immediately when they're used. In that case, he may really need to design the game so the player won't get copies of an item.
Yes, that's the case. So, there is no way of doing it automaticaly (considering any number of same objects represented by same icon- one object). Never mind, it's just a few hours more work.
Title: Re: copies of items
Post by: Ashen on Tue 14/09/2004 11:53:38
If it's something you're likely to need a lot, you could create a custom function. I think the LoseInventory command is equivalent to character[GetPlayerCharacter()].inv[item] -= 1;, so you'd just need something like:

function LoseInvAll (int item) {
  character[GetPlayerCharacter()].inv[item] = 0;
  UpdateInventory();
}
Title: Re: copies of items
Post by: BorisZ on Tue 14/09/2004 14:43:11
Are you telling me that:

character[GetPlayerCharacter()].inv[item] = 0;

means that all of the same [item] items will dissapear? If I understood it right, that the complete solution!
Title: Re: copies of items
Post by: TerranRich on Tue 14/09/2004 15:55:03
Yep, that's it. Inventory items are treated like variables.
Title: Re: copies of items
Post by: Gilbert on Wed 15/09/2004 02:53:43
Yes, but things gonna change in the newest version (still in beta phrase), let's see how this would be settled eventually.
Title: Re: copies of items
Post by: Sam. on Wed 15/09/2004 21:06:39
instead of having the items added in the first place, could the object not be removed fromt he room but not added to the inventory? or have multiple items, one for each amount of individuals and have the items swapped when a new item is "picked up".


yeah, i heard it.
Title: Re: copies of items
Post by: BorisZ on Thu 16/09/2004 15:22:00
Yes, on the end I decided that not giving additionnal items would be the best solution.