"Say password"

Mosh
I'm trying to create a simple locked door puzzle. The player finds a piece of paper with a codeword on it, walks up to a door with a microphone and has to say the password.

Ideally I'd like the solution to be along the lines of "SAY BLAH", but I can't work out how to do that. Is there a way of using a verb without an object?

The only other solution I've found is similar to the kaypad ones given on other threads ("USE MICROPHONE" leading to a script which asks "What do you want to say?"), but I'd prefer a more elegant solution.

Apologies if this has been answered elsewhere. I did have a dig on here and couldn't find anything.

OurJud
You could set up a command pattern for 'say blah' and then run a script which open the door.

Mosh
I'd spotted "command pattern" in the verb section. Just looked it up in the documentation and this could be just what I'm after - thank you!

http://docs.textadventures.co.uk/quest/ ... mands.html

OurJud
You're welcome. I hope it solves your problem :)

HegemonKhan
here's a useful link, that is easy to miss:

http://docs.textadventures.co.uk/quest/
http://docs.textadventures.co.uk/quest/guides/ (don't forget to scroll down too, as there's a bottom section of more guides)

COMMANDS (or the simplier: 'get input' Script) are good for typed-in inputs by the user playing the game.

http://docs.textadventures.co.uk/quest/ ... mmand.html
http://docs.textadventures.co.uk/quest/ ... input.html

hope these help, ask more if you got questions or need help with anything.

The Pixie
I would set up a command pattern:
say #text#

Then in the command script, something like this:
if (LCase(text) = "blah") {
msg("You say \"Blah!\" and the door magically opens.")
door.locked = false
}
else {
msg("You say \"" + text + "!\". Were you expecting something to happen?")
}

The variable "text" there will contain anything matched by the command.

The advantage of this method is that saying the wrong password is handled neatly.

Silver
You might want to think about whether you'll be using the say command again if doing it that way and/or code it to be room specific.

Mosh
I'd actually used the "get input" method for entering a code on a keypad - that was the solution offered for a similar problem elsewhere on the forum.

It is a matter of weighing up usage, complication and so on. I have yet to come across a problem in Quest that can't be resolved, even if it means digging down to code level. I'm currently using Quest with S2 (12-ish year old) pupils so trying to keep things within the menu system, but often you get a "How do you...?" question and the answer involved some coding.

In honesty, the pupils who ask this are normally the ones who'll enjoy getting their hands dirty so it's a good introduction to "proper" coding.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums