I'd like to write something like this:
if (cCharacter.HasInventory(iItem) && this item we've been talking about is iItem and iItem.Graphic==123) {
...
If I just say this, the second part of the expression is not necessarily associated with a item actually in your inventory -- in fact, does it just mean 'the graphic of the general item', and not the one you may/may not have?
Confused :/
Basically, do I have to invoke Inventory* or somesuch thing?
Quote from: bx83 on Sat 03/03/2018 04:22:35
If I just say this, the second part of the expression is not necessarily associated with a item actually in your inventory -- in fact, does it just mean 'the graphic of the general item', and not the one you may/may not have?
In AGS there is no difference between "general item" and item in someones inventory. Multiple characters may "have" same item, and it works like they have "references" to that item in their inventories, because if you modify a "general item" in any way (like change its graphic), it will be modified for every owner too.
For that reason items have only one graphic, and only one.
if (iItem.Graphic==123)
This is working code, regardless of whether iItem is in character's inventory or not.
PS. This is really not an "advanced technical" question.
Okay, I'm elucidated.
PS sorry, was complex to me :p