Page 1 of 1

User input riddle?

Posted: Fri Jan 18, 2013 10:47 pm
by Treybor
I was reviewing the useful scripts thread and found a script for a two word password door.
viewtopic.php?p=32097#p32097

This script looks like a multiple choice for user input.
Is there a way to enable to user to type in a complete word as a password?
I know how to enable user input, but how would I do it for say "Password"?
I'm thinking something like this, but I was hoping someone with more scripting experience might help.
Is there something like this available in the current engine?

Code: Select all

function passwordCheck()
a = "question"
if x == nil then
x = password
text1:setWallText(a.."--")

enableUserInput()
i = "userkeyboardinput"
if x == i then
passdoor:open()
else end
end
end
Can anyone help?

Re: User input riddle?

Posted: Fri Jan 18, 2013 11:18 pm
by Komag
I know the gui hooks can detect key presses, so theoretically it should be possible to do this completely, but I think the setup might be complex

Re: User input riddle?

Posted: Fri Jan 18, 2013 11:32 pm
by Treybor
Well I'm still learning lua scripting so something really complex is beyond my skill level at this point.

What I'm trying to accomplish is either a wall text or GUI text which provides a riddle, the script functuction to provide an answer, and a funtion to check user input to see if it matches. Enabling User input allows for a mouse click is easily done, but not really capturing text typed.

I can work around it with different scripts and functions that are simpler, but that involves a bunch of switches being added to a wall, and then setting up a multiple choice.