Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: BockerAlex on Thu 12/06/2008 15:51:11

Title: Is it possible to interact with an object, then that object be deleted?
Post by: BockerAlex on Thu 12/06/2008 15:51:11
I was wondering if it was possible for an item (in this case a sign) to be interacted with, so that the display text function will tell the user that they have done something to change it, thus either deleting said item, and putting a different item in their inventory.

So basically; the guy walks up to a sign, the user tells him to interact with the sign, bending off the bars, so that he will only have the sign in his backpack.

I looked through the script dropdown menu thing, but can't find anything that says delete, or remove or anything.
Is there any other function that could do that?

Thanks.
Title: Re: Is it possible to interact with an object, then that object be deleted?
Post by: TwinMoon on Thu 12/06/2008 16:39:00
It's Visible you need.

You need to be aware that objects on the screen are different from inventory items.

The solution to your problem would be to make an inventory item which is only the sign.
When the user interacts with the sign you remove the sign and add the sign to his/her inventory:

oSign.Visible = false;
player.AddInventory(iSign);


oSign is the object in the room and iSign is the inventory item.