Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Sukotto on Thu 19/05/2005 02:47:00

Title: In my game, i cannot get my "safe" idea to work.
Post by: Sukotto on Thu 19/05/2005 02:47:00
Ok. So i've got a safe, thats hidden under a painting. The painting comes off with a single interaction, right. But you have to find a certain key to open the safe. I can't figure out how to make it only open for a certain key. But, after it opens, there should be a bag of money there. And there isn't, because even thought the object is off, it picks it up when i click on the painting. The painting area is a hotspot. would it help if it was an object?
-Scotty
Title: Re: In my game, i cannot get my "safe" idea to work.
Post by: strazer on Thu 19/05/2005 03:30:26
I would probably do it like this:

Painting (object 0)
Safe door (object 1)
Money bag (object 2)
(Open safe: Part of room background)

Set their baselines accordingly so that the painting is in front of the safe door, and the safe door in front of the money bag.

- Interact with object 0 -> Move object 0 to the side, for example, or change graphic to a tilted painting, whatever
- Use inventory on object 1 -> If inventory item was used (key) -> Change object 1's graphic to an open door
- Interact with object 2 -> Turn off object 2 -> Add money item to inventory
Title: Re: In my game, i cannot get my "safe" idea to work.
Post by: Sukotto on Thu 19/05/2005 04:58:37
well, i have this other key, and i can't get it so that that key won't open the safe. but the rest is figured out. thanks for that, strazer. But, can anyone help me make it so that the other key the character has won't open it?
Title: Re: In my game, i cannot get my "safe" idea to work.
Post by: strazer on Thu 19/05/2005 05:08:44
Could you post the script you're using?

If you use the interaction editor, be sure to make the door opening a child action of the conditional:

Use inventory on object 1
- If inventory item was used (key)
-- Change object 1's graphic to an open door

If you do it like this

Use inventory on object 1
- If inventory item was used (key)
- Change object 1's graphic to an open door

, the action will be performed regardless of whether the conditional is true or not.