Disabling input

OurJud
This is the script I run when a player types 'use epad'

msg ("{command:log off:Log off}")
play sound ("epad_beep.mp3", false, false)
TextFX_Typewriter ("System booting", 5)
SetTimeout (2) {
TextFX_Typewriter ("Command parametre enabled", 5)
SetTimeout (2) {
TextFX_Typewriter ("Memory check", 5)
SetTimeout (2) {
TextFX_Typewriter (".System", 5)
SetTimeout (1) {
TextFX_Typewriter ("User ID", 5)
get input {
if (result="test" or result="Test") {
ClearScreen
TextFX_Typewriter ("Logging in. Please wait.<br/>", 1)
SetTimeout (3) {
TextFX_Typewriter ("Pear ePad4 | User ID: Lance Matthews | Session log: 2334#4", 5)
SetTimeout (3) {
msg ("{command:log off:Log off}<br/><br/>{command:contacts:Contacts}")
}
}
}
else if (result="log off") {
TextFX_Typewriter ("Logging off. Please wait.", 1)
SetTimeout (2) {
msg ("<br/>Logged off.<br/>")
}
SetTimeout (3) {
ShowRoomDescription
}
}
else {
TextFX_Typewriter ("Error. Incorrect User ID", 1)
SetTimeout (3) {
msg ("<br/>")
do (EpadCommand, "script")
}
}
}
}
}
}
}


This handles an incorrect and correct password the way it should, and also the 'Log off' link, but when play testing just now I discovered that if a player types a command (not knowing that the 'Log off' link (top of script) is how they return to the game, that link is then killed and the player may be left wondering what to do. It just so happens that an input (after successfully 'logging in') returns the player to the game (allowing any available exits and normal commands as usual) but I don't think it's clear enough.

I need some rule that throws up a computer type error (such as 'Input error. Please click 'Log off' to end the session') if the player tries to type anything once they have logged into the system.

Failing that, or maybe better still, can I remove the option to input once the player has logged in to the game's device?

Silver
If the player simply has to enter a password and it being right does one thing and wrong does another couldn't you set up a turn script that removes the parser once something has been entered? Then if the password is correct they can continue as normal but if it's incorrect they're forced to click the log off link.

Silver
Ignore that. This should work...

msg ("{command:log off:Log off}")
play sound ("epad_beep.mp3", false, false)
TextFX_Typewriter ("System booting", 5)
SetTimeout (2) {
TextFX_Typewriter ("Command parametre enabled", 5)
SetTimeout (2) {
TextFX_Typewriter ("Memory check", 5)
SetTimeout (2) {
TextFX_Typewriter (".System", 5)
SetTimeout (1) {
TextFX_Typewriter ("User ID", 5)
get input {
if (result="test" or result="Test") {
ClearScreen
request (Hide, "Command")
TextFX_Typewriter ("Logging in. Please wait.<br/>", 1)
SetTimeout (3) {
TextFX_Typewriter ("Pear ePad4 | User ID: Lance Matthews | Session log: 2334#4", 5)
SetTimeout (3) {
msg ("{command:log off:Log off}<br/><br/>{command:contacts:Contacts}")
}
}
}
else if (result="log off") {
TextFX_Typewriter ("Logging off. Please wait.", 1)
SetTimeout (2) {
msg ("<br/>Logged off.<br/>")
}
SetTimeout (3) {
ShowRoomDescription
request (Show, "Command")
}
}
else {
TextFX_Typewriter ("Error. Incorrect User ID", 1)
request (Hide, "Command")
SetTimeout (3) {
msg ("<br/>")
do (EpadCommand, "script")
}
}
}
}
}

OurJud
Thanks, Silver. Just about to have my tea, but I shall try this later and let you know how I get on :)

Silver
I simply added: request (Hide, "Command") to where the input could be right or wrong, and reinstated it with: request (Show, "Command") when the room description is printed again in the else if.

It should work. Obviously I had an error but that's because I don't have the commands set up at this end.

OurJud
Thanks, Silver - it works! (Hide / Show, "Command") is just another rule I never even knew existed.

I did have to change the final (Hide, Command) to (Show, Command), as an incorrect password entry ran the log-in as it should, but then hid the command prompt once it had finished.

Thanks again :)

Silver
No worries. Woo - I helped with actual code lol.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums