Getting an object from an object by looking at it

Started by blueplain, Tue 23/09/2014 09:32:44

Previous topic - Next topic

blueplain

I have created an object in my game which is a parcel. I want to be able to look at this parcel in the inventory, for the charecter to say what he has found inside and then for the objects to appear in the inventory. I have looked about but not spotted information on how to do this yet.

Thanks in advance.

Khris

There are two separate issues here:

1. Did you add an inventory item representing the parcel yet? If not, do so, then add the "interact with" event to the object, and in there, turn it invisible and add the parcel's inventory item to the player's inventory.
(AGS has no internal way of picking up an object; if something in a room is supposed to be portable, you have to create two representations of it: a room object to display it inside the room, and an inventory object, used in the player's inventory.)

2. Select the parcel's inv item, and in the events pane, add a "look at inv" event. In there, display the text, remove the parcel item and add the content item(s).

blueplain

Thanks Khris

I had the object in the world and I got the object into my inventory but did not know how to get it to replace itself with another object. I followed your advice using - Use the Character.LoseInventory(InventoryItem *item) function with what I already knew and it did the trick. Thanks for your time to help me.

SMF spam blocked by CleanTalk