I'm trying to figure out how to use locks to make an object only open when certain things are done to it. In this case, an envelope with a wax seal. It is "locked" until you hold a candle up to the wax seal. I want to use the candle as the "key" and have it be triggered by the player typing something other than "unlock with". I'd be ok with "use candle on", but "hold candle up to wax seal" followed by "the wax melts away", and then being able to open it, would be nice. "So far it isn't working at all. I can't get any command to unlock it. Any ideas? This is my first game.
I would 100% use a command for this.
I'll give more details when I get home if you need them.
For the "fancy" command pattern, you can type stuff like this in a command box:
^(use|hold|put|heat) (the |)(candle|flame|heat) (on|over|into|onto|near|toward) (the |)(wax|envelope|letter)
That way, you do not need to worry about a library worth of typing.
As for 3b., the first thing that comes to me is a bit of a cheat. =) I would initially consider making a room that contains "altered" objects. I have rooms in my games where I basically store items. This room has no exits or entrances. It simply is for storage. After melting the wax on the envelope, I would remove the 'envelope with wax' from the game (using 'remove object' script (or if you want to reseal the envelope, you can move the sealed envelope into the storage room)), and move the stained envelope (or whatever you want to call it) into the players inventory (using the 'move object' script). It is the illusion that the sealed envelope and the stained one are the same when in fact they are two different objects. You can put an 'open' verb on each and run scripts accordingly.
Let me know if this is the avenue you want to pursue. If not, there are alternatives to 'locking' and 'unlocking' objects. I use this ALL the time as I find it easier. Good luck!
Sorry to muscle in on this thread. Thanks for that imformation about fancy commands. Xanmag. That's handy. I use long winded commands all the time and did not know you could use brackets like that.
Will the command still work if the player puts in one or more words you didn't think of,.
As for the closed store room trick, I often put the changed object in the same room instead, but invisible. Provided of course the object will be changed in that room. You vanish one and show the other when needed.
You could get Quest to respond to words you did not think of, a pattern can be matched to any string of letters. I am not sure that would be a good thing.
A better way to do complex commands is to match the objects, and put the synonyms in the other names list of the object (so in XanMag's example, wax, envelope and letter would be other names for the object. That way all your commands will use the same set of synonyms.