How to Require Certain Actions

techwith
08 Oct 2015, 12:21
Hello, all. I'm new to this scene and not very script-savvy. I'd like to require the player to use a certain item (pipe) with two other objects (lock and light), then when they use a 4th object (ice) with the light, a door is unlocked.

I know it sounds odd, but it seems like it should be simple enough to set some sort of variable to 1 each time the prerequisites are met, then check those variables when you combine the last 2 objects. Can someone please tell me how I should set this up? I'm experimenting with variables, but not really sure what I'm doing.

Thanks in advance

techwith
08 Oct 2015, 12:48
Never mind... I figured something out. Upon each prerequisite action, I turned those objects "on". Then with the third action, I used "if" checks to see that they were both "on", then unlocked the door.
Better ideas?

XanMag
08 Oct 2015, 14:31
Interesting method! lol Sounds like something I would do!!

If those objects needed to be used in a specific order, it is very easy. I would just create a new object when you use them together. For example, if "use light with pipe" is the first step in the process (and I'm assuming it is a tobacco pipe, not a plumbing pipe =) it gives the response "You have lit the pipe". Then move the pipe and the light source into an 'inventory room' and move an object called 'lit pipe' into the players inventory. If the player types "use light with lock", you simple add a response like "That makes no sense at this time." Then you can repeat the procedure with the next item. Use lit pipe on lock. Repeat with ice.

If the objects can be used on each other in any order, this becomes more difficult. I have lengthy thread where I had help solving this problem. I'll edit this post and reference that thread when I find it.

EDIT: Here is the thread I stumbled through with some excellent helpers solving the more difficult version of multiple item usage.

viewtopic.php?f=10&t=5411&p=37579#p37579

Let me know if any of this is helpful. Thanks and good luck.

XanMag