Keeping an object in a container

Lance Thrak
15 Feb 2014, 01:05
In my game, there's an object called "jar" and an object called "potion". The jar is a container that is always open and the potion is in the jar. I need the jar to always be open so that the player can use the potion at any time. I didn't want it to be possible to take the potion out of the jar, so I made it impossible to take or drop the potion. When the player takes the jar, the jar and the potion in it go into the inventory.

Here's my problem: When the player has the potion and enters the command "put potion in [any other container]" the potion will leave the jar and go into the container that the player said.

How can I keep the potion in the jar and keep the jar open?

george
15 Feb 2014, 04:17
What if for the jar you just make it 'is transparent', but not open? Then you can use the potion but not take it. You'll probably want to customize the messages on the jar for opening/closing and for taking the potion, but if you'll never put anything else in the jar I think this might be the simple solution.