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.