Q12: PROBLEM: Object turns into blue cup when player picks it up The information in this article applies to:- Adventure Game Studio v2.12 and later versions
- Operating System: DOS & Windows
PROBLEM
When the player picks up an object in your room, it shows up as a blue cup in the
player's inventory window.
CAUSE
This problem is caused by either:
- Not selecting an inventory item to add, or
- Not setting a graphic for the inventory item
It is not a bug in AGS.
MORE INFORMATION
You need to bear in mind that an Object is not the same thing as an
inventory item:
Objects are room-based, where each room may have up to 10 objects, and you set
the object interactions in the Rooms, Objects tab of RoomEdit. For example,
object 0 in room 1 is completely different to object 0 in room 5.
Inventory items are game-based, where each inventory item remains the same for
the whole game, so inventory item 3 is the same everywhere in the game.
Suppose you have a hamburger, set as object 0 in room 2, which you want the
player to be able to pick up. You need to follow these steps to make sure it is
available as an inventory item:
- In RoomEdit, go to the GAME tab, and select the INVENTORY button on the left
of the screen.
- Click the "New item..." button in the bottom half of the
screen.
- Type in "Hamburger" or a name describing your inventory item, and
press return.
- In the top-middle of the screen will be a picture of a blue cup. Click on it,
and the Sprite Manager appears.
- Select the graphic that you want to use instead of the blue cup by clicking
on it. You will be returned to the Inventory screen and your new picture should
be displayed instead of the cup.
- Note down the number of this inventory item. The number is displayed on the
left hand side of the screen in the item list beside the name you typed in.
- Go to the ROOM tab, and load Room 2 (or whichever room contains the
object).
- Click the OBJECTS button on the left of the screen, and cycle through so that
your hamburger object is selected. Click the INTERACTION button.
- Add a "Interact with object" event, and set it to "REMV OBJ
%d, ADD INV".
- You are asked to type in a number. Type the number of the room object
(probably 0).
- Click the Data column, and type in the Inventory item number (that is, the
number you noted down earlier).
- Save the room, then save the game and try it out. Now, when the player clicks
the hand on the room object you should find a hamburger added to the
inventory.
List all articles - Edit this article (admin only)
|