How to count inventory items (SOLVED)

Started by Mugs, Tue 17/01/2006 04:37:33

Previous topic - Next topic

Mugs

How can I count the number of inventory items in a "inventory window"?
I'm looking for something that would act like: "if (whatever.ItemCount > 0)", but for inventory items.


How would I do that?
Cool stuff I found out: Men are four times more likely to be struck by lightning than women.  Wow, really? [dirty joke] Maybe this has to do with the fact that us men have "lightning rods"? [/dirty joke]

Gilbert

I don't quite understand your problem.

Items in an inventory window are the procession of a character's inventory, so you can always check their numbers via something like:

if (player.InventoryQuantity[iBalls.ID]==5) {...

Ashen

InvWindow.ItemCount perhaps? However, that'll return the total number of items in that window (i.e. those held by the owning character), not just the amount displayed. For that you'd need InvWindow.ItemsPerRow and InvWindow.RowCount (both linked from te ItemCount page).

Depends on what exactly you're trying to do.
I know what you're thinking ... Don't think that.

Mugs

I tried ItemCount before and it didn't work.Ã,  I tried it again, and now it's fine(I must have done something wrong, I guess).

Anyways, thanks for the help.
Cool stuff I found out: Men are four times more likely to be struck by lightning than women.  Wow, really? [dirty joke] Maybe this has to do with the fact that us men have "lightning rods"? [/dirty joke]

SMF spam blocked by CleanTalk