LockExit (locked design studio)
msg ("What is the latest version of html?")
get input {
msg ("Your answer is " + result)
if (result="html5") {
UnlockExit (locked design studio)
}
else {
msg ("You're locked in the room")
}
}
jaynabonne wrote:Your usage of "result" needs to be within the { } following the get input.LockExit (locked design studio)
msg ("What is the latest version of html?")
get input {
msg ("Your answer is " + result)
if (result="html5") {
UnlockExit (locked design studio)
}
else {
msg ("You're locked in the room")
}
}
You have it outside the get input, which means "result" is not set. (Did it give you an error about "result" being unknown?)
LockExit (lockedlivingroom)
msg ("What is the latest version of html?")
get input {
msg ("The door swings open")
if (result="html5") {
UnlockExit (lockedlivingroom)
MakeExitVisible (lockedlivingroom)
}
else {
msg ("You're locked in the room")
}
}
Silver wrote:The answer will only be correct until html6 comes out; assuming you are actually using that question in the game.
Silver wrote:The answer will only be correct until html6 comes out; assuming you are actually using that question in the game.
jaynabonne wrote:First, the game you posted still has the double "get input" in it. When I click the "living room door" and select "unlock", it echoes "unlock living room door", and then enters your first get input. At this point, you can't click on the link because it's executing a "get input". After you input *something* into that input field (which it swallows), it gives you the HTML question. At that point, you still can't click on the link because it's still in a "get input". After you enter the answer, you can then click on the link and get the menu. I hope that's what you were referring to.
As far as the south link, once you're past answering the question and the door is unlocked, if you type "l", you'll see that it shows the south link as being available. There is nothing to automatically show the exits again. If you want to reshow the room description, you can call the function ShowRoomDescription after you unlock the exit and make it visible.
The Pixie wrote:"Silver"
The answer will only be correct until html6 comes out; assuming you are actually using that question in the game.
A solution to that is to make it clear that the game is set in a specific year when 5 is the current version. In game the answer will always be right.
result = LCase(result)
if (result = "html5") {
if (ListContains(game.htmlanswers, result)) {
jaynabonne wrote:To lowercase your result, use:result = LCase(result)
To check for a list of possible answers, you can create a string list attribute on some object (wherever it makes sense: could be on the game object or could even be on the room in question) and put the answers there. Then in your code, instead ofif (result = "html5") {
you can do:if (ListContains(game.htmlanswers, result)) {
(That's assuming you have a string list called "htmlanswers" on the "game" object. Adjust accordingly. )