Safes/vaults
Tyrannobear
19 Feb 2017, 23:15I feel like an idiot, but I was having trouble making a safe with a password for the player to type in (I could have used a piece of paper with the code as a "key" using the basic container function, but didn't want to resort to that). I thought I'd check the forums and found nothing, so since I've solved the issue, I thought I'd create this post for anyone else struggling.
First, you need two objects: The safe (complete with whatever item/s you wish to hide in it) and a keypad.
Step 1: Go to the features tab of the safe, then select container.
Step 2: Go to the container tab, select closed container, then set it as lockable, with no keys.
Step 3: Go to the keypad object, go to features and set it as use/give.
Step 4: Go to the use/give tab and set it to run a script when used on its own.
Step 5: Print the message "Please enter the password:", or something to that effect.
Step 6: Run the script "Get input".
Step 7: Add an "If" script to that and select expression.
Step 8: If your password is 1111, the expression will look like this: result="1111"
If your password is password, the expression should be: result="password"
Step 9: Print a message. Something like "correct. The safe unlocks", or something like that.
Step 10: This is the bit I missed and made me feel like an idiot. I chose "open object". You don't want to do this. It will open the object, but it won't let you take the items or open/close the safe. Instead, run the script "set variable". The variable is safe.locked (if your safe is named "safe", anyway.)
Step 11: Expression should already be selected from the dropdown box, but if not, select that. In the final box, type "false".
Step 12: For the else, just print a message like "It doesn't open".
The safe should now work. That's how I made mine :)
hegemonkhan
20 Feb 2017, 00:17the quest doc has guides on this stuff:
http://docs.textadventures.co.uk/quest/
http://docs.textadventures.co.uk/quest/guides/ (make sure you scroll all the way down too, as there's more guides at the bottom)
http://docs.textadventures.co.uk/quest/libraries.html