calling open/ close container code when switching object on/off

Still working on setting up this smartphone project.

It is much easier for me to work in the code view than use the scripting prompts.

When the player tries to open the phone, I would like the engine to call the open container scripts.

potential goal (I may hide the passcode in a puzzle somewhere eventually, but to learn how to play with the engine, this is my current task

when the play types
turn on the phone

I would like it to call the container functions checking whether the phone is open, if it is locked, etc. The phone, being a container, will contain apps. When the phone is closed, the power can be on, but the phone will be locked. Turning on the phone will begin the boot up sequence, and then try to open the phone. On first attempt to open the phone, request a passcode from the player. On any later attempt, require the passcode from the player. (There may be reasons later to change the passcode, prevent hacking, etc.)

when player tries to turn on phone:
call native container open/close code
firsttime {
// phone is locked
msg ("Please enter a 6 digit passcode")
// error check for numbers only
GetInput (set this.passCode = result)
msg ("Please re-enter the 6 digit passcode")
}
otherwise {
msg ("Enter passcode to unlock phone")
GetInput ( if (result = phone_.passCode) {unlock and open the phone}
// open the phone and display the apps as verb links,
//if player doens't do something with the phone for ## turns, close and lock the phone, clear screen
}

hopefully that makes sense


Log in to post a reply.

Support

Forums