How do you make a password?

tomany2
11 Apr 2011, 17:37
I would like to insert a few passwords in my adventure, but i have no clue on how to go about doing it...

I have it set so it is like this...

When player types "Use Override Controlls" :

If the player answers "yes" to "Would you like to enter a code?" Then

And i dont know what to do after this...

Also how do i make the timers work, because every time i set a timer than turn it on, there is no waiting period.

Redsun
11 Apr 2011, 18:45
I'm sure there are several ways to do this, maybe you should then turn a flag on and ask the player for the password which will be a verb, once the player types that verb then turn the flag off and give them access to whatever it is.

The verb is the password.

tomany2
11 Apr 2011, 21:55
okay im really bad with quest...

So disregard my first post...

can someone walk me through step by step on how to make a password?

i want the computer to have a menu..
Choice one in the menu should be "Unlock Door"

Choice two should be "Emails"

If they pick Unlock, they need to enter a password.
If they pick emails i need a submenu of "Inbox" and "OutBox"

if the password is incorrect, i just want it to be like "Incorrect password, locking system" and they need to reset the computer to try again (by just typing "Use computer" again)

If it is correct i would like it to say "Correct" and the door unlocks....

I know i am asking alot... but im just so confused... i dont know how to set flags, turn a flag on or off, or use the timers...

Redsun
12 Apr 2011, 01:25
This is doable, I could do it but explaining it step by step I couldn't, I totally suck at writing tutorials or Instructions.
Quest comes with a built in menu thing but I never use the built in one that pops up, I usually write my own.

Maybe someone else who is better writing Instructions can explain it for you, knowing me I'd skip allot and you'd be like huh? LOL :)

RedTulip
12 Apr 2011, 05:28
I don't know what you mean, but I think this is what you want:

First, make a menu (for the computer). Under 'Game', click 'Menus'. On the side, click the 'Add...' button. Name it whatever you want, for now, I'll name it computer menu.

The Menu Editor will open. On the right side, there are 5 buttons. Click 'Add...' and under 'Please enter the text to display for this menu choice:', type 'Unlock door'.

After that, the Script Editor will pop up. Click the '+' button beside 'Other'. Now, click 'Enter next command into string variable'.

Under 'String variable', type the name of the variable. I'll name it 'password' for now. We're not yet done, though.

Add a Select Case (You can add one by clicking the 'Script' menu on the top-left and clicking 'Add Select Case'). Next to 'Select Case:', type the name of the variable from earlier (password) in the center of '#'. You can also click '#' the button on the top right of the text bar beside 'Select Case' and pick the 'password' string under 'Insert a string variable:'.

On the right, click the 'Add' button. Type the correct password beside 'Case:'. The script editor opens, revealing the Print a message script. Type correct then press the 'Add more' button on the bottom. For this, I'm going to set a flag on (under 'Variables'). Call the flag 'unlocked' for now.

Add another case, this time set it to 'Else:' and type 'Incorrect password, locking system.' and set a flag on (call the flag 'system_locked', for now).

Click 'Ok.'

Now, add another menu item. Name it emails. Add a information prompt if you haven't yet (It is on the bottom). Click the 'Close' button.

Add another menu and call it 'emails'. The information prompts is 'Emails'. Add a menu item called 'Inbox'. Here, you can add another menu with a list of emails.

Add another menu item called 'Outbox'. You can also add some emails here, if you want.

I've added new menus called 'inbox' and 'outbox' with the information prompt 'Inbox' and 'Outbox'.

On the emails menu, edit the script of both menu options and choose 'show a menu' from under 'Run script'. For inbox, run the 'inbox' menu. For outbox, run the 'outbox' menu.

Click 'Close' and edit the 'computer menu'. Click the 'Emails' menu options and click 'Edit...'. Choose the 'Show a menu' script and select the 'emails' menu.

Add a room (if you haven't already), then add an object. Name it 'computer'. Set the prefix to 'a'. Change the type to Scenery.

Change the 'look' action script to:
If the flag "on" is set  Then Print "The computer is on." Else Print "The computer is off." 

(This is what the script looks like. You can't just copy and paste, you'd have to do it yourself with the script editor, or is there a way to copy and paste it into the script editor?)

Add a turn off verb and change the action script to:
If the flag "on" is set  Then { 
Print "Turned off."
Set the flag "on" to off } Else Print "It's already turned off."


Add a turn on verb and change the action script to:
If the flag "on" is set  Then Print "It's already turned on." Else { 
Print "Turned on."
Set the flag "on" to on }


Add a use verb and change the action script to:
If the flag "on" is set  and the flag "system_locked" is not set  Then Show the "computer menu" menu Else { 
If the flag "on" is not set Then Print "Turn it on, first."
If the flag "system_locked" is set Then Print "You have to restart it." }


Add a restart verb and change the action script to:
If the flag "system_locked" is set  Then { 
Print "Restarted."
Set the flag "system_locked" to off } Else {
If the flag "on" is not set Then Print "It's turned off." Else Print "Why bother?" }


Add an exit to the computer room. Make it locked. Type 'It's locked.' below the 'When locked, display this message...'.

Go back to the 'Menus' and edit the 'computer menu'. Edit the 'Unlock door' menu item.

Edit the script of the correct password case. Add a unlock an exit script by clicking the '+' button beside 'Exits' and clicking 'Unlock an exit'. Click the exit that's locked.

Add another script. This time, click the '+' button beside 'Modify' and click 'Action script'. Type 'computer' under Object or Room name. Type 'use' under 'Action name:'. Click 'Edit Script'.

On the new Script Editor, add a 'Show a menu' script and type 'emails' under 'Menu name:'.

I hope it works. If you don't understand, check out the .asl. The .asl might have some changes, so I do recommend you check it out.

tomany2
12 Apr 2011, 07:18
That almost worked perfectly, all but the flag "unlocked" was never used again, so when the password is correct, it would say

"Correct!
incorrect password, locking system"

Atleast when i did it following your tutorial thats what it did, so im not sure what to do still... everything else works fine, it unlocks the door, just, that comes up like that.

Hammock
12 Apr 2011, 12:24
Commands would be a really simple way to set up passwords for players to use. First set up a menu called "code list", In this menu add a list of words with all the wrong answers giving an "incorrect choice" text (you can also penalize players points in your status variables here) and the correct choice runs the scrpt "unlock doors" and sets the flag "code correct" to on. Next set up a command called "code" that runs the "code list" menu. When the player answers "yes" to your question 'Would you like to use a code?" then run the command "code". This will bring up the "code list" menu and present the player with choices. By setting te flag when they choose the correct code you can put an ELSE script in that tells the player they have already completed the action (the whole thing would be a conditional script).

IF -Player types "yes" to "Would you like to use a code?"
THEN -[IF] - flag "code correct" is set
[THEN] - You have already used the correct code here
[ELSE] - run command "code"
ELSE - you will not be able to proceed without the correct code

I wrote this half awake over too little coffee but it should work basically like this. You may have to tweek the placement of the menu and its call up command but it is basically striaght forward once you get the jist of how Quest orders its scripts. Hope it helps.

RedTulip
13 Apr 2011, 02:48
tomany2 wrote:That almost worked perfectly, all but the flag "unlocked" was never used again, so when the password is correct, it would say

"Correct!
incorrect password, locking system"

Atleast when i did it following your tutorial thats what it did, so im not sure what to do still... everything else works fine, it unlocks the door, just, that comes up like that.


I knew there was a mistake... Try the .asl file, it worked perfectly for me, if you don't get the .asl, I'll be editing the tutorial a bit.

RedTulip
13 Apr 2011, 04:21
I'm going to edit the tutorial a bit now, and I hope this one's going to work.

First, make a menu (for the computer). Under 'Game', click 'Menus'. On the side, click the 'Add...' button. Name it whatever you want, for now, I'll name it computer menu.

The Menu Editor will open. On the right side, there are 5 buttons. Click 'Add...' and under 'Please enter the text to display for this menu choice:', type 'Unlock door'.

After that, the Script Editor will pop up. Click the '+' button beside 'Other'. Now, click 'Enter next command into string variable'.

Under 'String variable', type the name of the variable. I'll name it 'password' for now. We're not yet done, though.

Add a Select Case (You can add one by clicking the 'Script' menu on the top-left and clicking 'Add Select Case'). Next to 'Select Case:', type the name of the variable from earlier (password) in the center of '#'. You can also click '#' the button on the top right of the text bar beside 'Select Case' and pick the 'password' string under 'Insert a string variable:'.

On the right, click the 'Add' button. Type the correct password beside 'Case:'. The script editor opens, revealing the Print a message script. Type correct then press the 'Add more' button on the bottom. For this, I'm going to unlock an exit (the door!)

The script for the correct password should look something like this:
Print "Correct." 
Unlock the exit from "Computer room" to "east"
Modify "computer"'s "use" action to ... Show the "emails" menu


Add another case, this time set it to 'Else:' and type 'Incorrect password, locking system.' and set a flag on (call the flag 'system_locked', for now).

The script for the 'Else' case should look like this:
Print "Incorrect password, locking system." 
Set the flag "system_locked" to on


Click 'Ok.'

Now, add another menu item. Name it emails. Add a information prompt if you haven't yet (It is on the bottom). Click the 'Close' button.

Add another menu and call it 'emails'. The information prompts is 'Emails'. Add a menu item called 'Inbox'. Here, you can add another menu with a list of emails.

Add another menu item called 'Outbox'. You can also add some emails here, if you want.

I've added new menus called 'inbox' and 'outbox' with the information prompt 'Inbox' and 'Outbox'.

On the emails menu, edit the script of both menu options and choose 'show a menu' from under 'Run script'. For inbox, run the 'inbox' menu. For outbox, run the 'outbox' menu.

Click 'Close' and edit the 'computer menu'. Click the 'Emails' menu options and click 'Edit...'. Choose the 'Show a menu' script and select the 'emails' menu.

Add a room (if you haven't already), then add an object. Name it 'computer'. Set the prefix to 'a'.

The 'look' action script should look like this after editing it:
If the flag "on" is set  Then Print "The computer is on." Else Print "The computer is off." 


Add a turn off verb and change the action script to:
If the flag "on" is set  Then { 
Print "Turned off."
Set the flag "on" to off } Else Print "It's already turned off."


Add a turn on verb and change the action script to:
If the flag "on" is set  Then Print "It's already turned on." Else { 
Print "Turned on."
Set the flag "on" to on }


Add a use verb and change the action script to:
If the flag "on" is set  and the flag "system_locked" is not set  Then Show the "computer menu" menu Else { 
If the flag "on" is not set Then Print "Turn it on, first."
If the flag "system_locked" is set Then Print "You have to restart it." }


Add a restart verb and set the action script to:
If the flag "system_locked" is set  Then { 
Print "Restarted."
Set the flag "system_locked" to off } Else {
If the flag "on" is not set Then Print "It's turned off." Else Print "Why bother?" }



Add another room. Call it 'Exit'. Edit the 'Exit' room a bit, set the 'Alias:' (maybe) to 'exit' and the prefix to 'the'.

Go back to the 'Computer room' then click the 'Exits' tab. On the 'East' arrow, set the 'To:' to 'Exit'. Check 'Locked' and under 'When locked, display this message when the player tries to use this exit...', type 'It's locked.'.

Go back to the 'Computer menu' under 'Menus' and edit the 'Unlock door' menu item. Click the select case script and edit the script of the correct password case.

Add a script to modify the use property of the computer object. To do that, click the '+' button beside 'Modify' and click 'Action script' under 'Modify'.

Type 'computer' under 'Object or Room name:', then under 'Action name:', type 'use'.

Click the 'Edit Script' button.

Another Script Editor will pop up. Add a script to show the 'emails' menu.

The correct password case should now look like this:
Print "Correct." 
Unlock the exit from "Computer room" to "east"
Modify "computer"'s "use" action to ... Show the "emails" menu


I hope this one works now. Found out you didn't need the 'unlocked' flag.

Optional:
The player might not know that they can type 'restart computer', so he/she might, instead, type 'turn off computer', then 'turn on computer'. But when they try using the computer again, it's still locked.

To allow the player to do this, go to the computer object. Click the 'turn off' verb then click the 'Edit...' button.

Edit the 'Then:' script. Add a script that will turn off a flag. Below 'Flag name:', type 'system_locked'. Click OK, then click OK again.

I updated the .asl file.