Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Sam. on Mon 18/04/2005 20:14:47

Title: GetInventory (SOLVED)
Post by: Sam. on Mon 18/04/2005 20:14:47
On my interface, i have a small box which displays one inventory item at a time, with arrows to change the item. Is there a way to get the inventory number of the item which is being shown at any time. I had thought that a varialble incremented byt the arrows would work, but this would be uselss as soon as an item was lost or added to the middle. Any suggestions?


Just in case you are wondering, this is so i can setctiveinv and then process_click(MODE_inv) on another part of my gui.
Title: Re: GetInventory
Post by: Pumaman on Mon 18/04/2005 20:23:28
This is difficult to do in 2.62; you might want to hang on for 2.7 because then you can just do this:

int theItem = invWindow.ItemAtIndex[invWindow.TopItem].ID;
Title: Re: GetInventory
Post by: Sam. on Mon 18/04/2005 20:29:37
but..

but...

Does it do this in the beta?

If not, when is 2.7 releasified?
Title: Re: GetInventory
Post by: Ashen on Wed 20/04/2005 20:48:32
It does do it in the beta, yes.

However, if you've used 2.62 and don't want to re-write all your code, you could maybe use GetInvAt (x, y) and fill in the co-ords of the inventory window.
Title: Re: GetInventory
Post by: Sam. on Wed 20/04/2005 20:55:46
hehe, mind reader, thats what i just wrote into my code!