Create for example a door, and make a hotspot over the door knob. Don't forget to add also a hotspot that the player can click to leave the screen.
Open the Frame Properties and go to the Advanced Tab. Enter the script:
- Code: Select all
LoadControl TextBoxObject(1)
TextBoxObject(1).Move 240*15,300*15,300*15,30*15
TextBoxObject(1).Visible = True
To change the position and size of the textbox, replace the values in the above code according to LEFT*15,TOP*15,WIDTH*15,HEIGHT*15. To figure out the correct values may take some playing around.
Then open the Hotspot Properties of the hotspot over the doorknob, go to the Advanced tab and enter (in this example "Guard" is the correct password):
- Code: Select all
If TextBoxObject(1).Text <> "Guard" Then
Message "The password seems to be wrong."
Else
Action.GoToFrame "FrameName"
End If
Please note that you need to unload the textbox object on all screens where the player can go after that (for example the screen where the player goes after entering the correct password; and the screen where the player goes when he/she leaves the screen without entering the correct password), otherwise the textbox will be displayed on all the following screens.
So for each screen where the player might go next, open the Advanced Tab of the Frame Properties (or the Advanced Tab of the Hotspot Properties of the hotspot that the player clicks to leave the screen), and enter:
- Code: Select all
UnloadControl TextBoxObject(1)
To add more similar puzzles, just change the number of your TextBoxObjet. The next one would be TextBoxObject(2).
Let me know if anything is not clear