User input riddle?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Treybor
Posts: 93
Joined: Wed Jun 06, 2012 3:13 am

User input riddle?

Post 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?
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: User input riddle?

Post 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
Finished Dungeons - complete mods to play
Treybor
Posts: 93
Joined: Wed Jun 06, 2012 3:13 am

Re: User input riddle?

Post 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.
Post Reply