spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links

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:

  1. In RoomEdit, go to the GAME tab, and select the INVENTORY button on the left of the screen.
  2. Click the "New item..." button in the bottom half of the screen.
  3. Type in "Hamburger" or a name describing your inventory item, and press return.
  4. In the top-middle of the screen will be a picture of a blue cup. Click on it, and the Sprite Manager appears.
  5. 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.
  6. 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.
  7. Go to the ROOM tab, and load Room 2 (or whichever room contains the object).
  8. Click the OBJECTS button on the left of the screen, and cycle through so that your hamburger object is selected. Click the INTERACTION button.
  9. Add a "Interact with object" event, and set it to "REMV OBJ %d, ADD INV".
  10. You are asked to type in a number. Type the number of the room object (probably 0).
  11. Click the Data column, and type in the Inventory item number (that is, the number you noted down earlier).
  12. 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)