Create new verb to unlock an object.

I’m sorry if I’m being stupid... very new to this!
I’m trying to create a new verb to unlock something.

I have a locked cupboard that I want to open with a spell.

So I have set up the verb ‘Alohomora’ and a text response ‘there is a click and the door swings open’
But it remains locked and I can’t see how to make this happen. Any ideas?

Thanks in advance!

Make sure you go into the cupboard and run the unlock script. I’ve had to do that many times! If that doesn’t work, let us know!

Sorry, but complete novice. What’s the unlock script? Would you mind explaining a little more for me? For dummies 😂

Ugh. Sorry. I went off of memory and that definitely wasn't very clear.

I have always hated the way quest handles containers and found that I was better off just creating my own, but... here is what I just did and it seems to work fine.

  1. Create cabinet.
  2. Under the "look at" description on the setup tab, I chose to "Run script".
  3. Select an 'If' script and choose 'if object has flag', select cabinet and type in isopen in the flag name box.
  4. Choose to print message in the 'Then' dropdown. Print your message. I chose this: "It's an open cabinet."
  5. In the 'Else If' box, choose 'if object does not have flag' (or I suppose you could put this in the 'Else' box...), cabinet, isopen
  6. Choose print message in the 'Then' dropdown just below the Else If. I chose this: "Scrawled across its surface is the word Alohomora.

It is closed with no apparent way to open it."

  1. Go to the Features tab of the cabinet. Here is where I cannot stand the way Quest handles containers. But, whatever, I'm probably using them wrong.

  2. Under container type, I chose 'closed container'. I'm not even sure why based on the other options, but after fiddling with it, it seemed to work the best.

  3. I left can be open and can be closed ticked.

  4. I typed in the message to print when trying to open and close containers the following:
    "Apparently you need a magic word to open the cabinet..." and
    "No need to close it."

  5. Also, I did not use a verb, although I am sure that would have worked to. I added a command to the room that had a cabinet in it and type the following in the box just below 'Command pattern'
    say alohomora; yell alohomora; cast alohomora; alohomora
    ^this will take care of anything that matches the above input. The downside is, it has to directly match. You can't misspell or abbreviate alohomora. There are lots of ways to handle this situation. Commands, verbs, clickable verb 'say' or 'cast' under an object called alohomora in a spell book. etc...
    I like commands better than using verbs ESPECIALLY in this case where the cabinet is not leaving the room. I always ran into verb conflicts. If you are placing instruction on an object that is traveling around, then I'd use verbs. Just my opinion.
    12a. I ran a script under this command. Print message "You utter the magic word alohomora. You hear a click and look toward the cabinet to see it swinging open."
    12b. You must also add another script - set flag on object cabinet flag name isopen

Anyway... I hate containers but this works. If you need more help, please ask.

And... I have a feeling that someone will come around with advice that makes mine sound ignorant but... that's how my brain works!!

Happy gaming!

Thanks so much for that explanation. I will have another go!

Log in to post a reply.