Switch script not returning case?

XanMag
So... I have this script in my game... and, guess what?!?

Yep... There's a problem with it. Go figure.

switch (LCase(result)) {
case ("L26FNP") {
msg ("You wonder around the maze of crates and boxes looking for L26FNP. Eventually you recognize a pattern in the coded numbers and find what you are looking for.<br/><br/>There is a pallet of large metal cylinders here on the ground.")
MoveObject (Xanadu, maze 1)
}
case ("H37DJK") {
msg ("You wonder around the maze of crates and boxes looking for H37DJK. Eventually you recognize a pattern in the coded numbers and find what you are looking for.<br/><br/>There is shelf here with several thick plastic bottles on them. Based on the card, this is what you were looking for.")
MoveObject (Xanadu, maze 2)
}
case ("J89TTY") {
msg ("You wonder around the maze of crates and boxes looking for J89TTY. Eventually you recognize a pattern in the coded numbers and find what you are looking for.<br/><br/>There are a few small cylinders here that must be what you were searching for.")
MoveObject (Xanadu, maze 3)
}
case ("H11ZWA") {
msg ("You wonder around the maze of crates and boxes looking for H11ZWA. Eventually you recognize a pattern in the coded numbers and find what you are looking for.<br/><br/>The air here is dry. From glancing at the various items in this section of the warehouse, it appears several of the chemicals here are hydrophobic (or water sensitive). The small bottles you were searching for are here on a shelf.")
MoveObject (Xanadu, maze 4)
}
case ("K91DMD") {
msg ("You wonder around the maze of crates and boxes looking for K91DMD. Eventually you recognize a pattern in the coded numbers and find what you are looking for.<br/><br/>Based on the numbers on the bottles here on a shelf, you have found what you were looking for.")
MoveObject (Xanadu, maze 5)
}
case ("W22YUG") {
msg ("You wonder around the maze of crates and boxes looking for W22YUG. Eventually you recognize a pattern in the coded numbers and find what you are looking for.<br/><br/>Ummm... you have found a water fountain stuffed here in the corner of the maze of boxes and crates. What did you expect I guess...?")
MoveObject (Xanadu, maze 1)
}
case ("079FUT") {
msg ("You wonder around the maze of crates and boxes looking for 079FUT. Eventually you recognize a pattern in the coded numbers and find what you are looking for.<br/><br/>On one of the nice, clean shelves here you see some bags of sugar.")
MoveObject (Xanadu, maze 7)
}
case ("X43GBT") {
msg ("You wonder around the maze of crates and boxes looking for X43GBT. Eventually you recognize a pattern in the coded numbers and find what you are looking for.<br/><br/>There is a large box here with the code that matches what you were searching for.")
MoveObject (Xanadu, maze 8)
}
case ("Q01QWD") {
msg ("You wonder around the maze of crates and boxes looking for L26FNP. Eventually you recognize a pattern in the coded numbers and find what you are looking for.<br/>")
MoveObject (Xanadu, maze 9)
if (GetBoolean(isopropyl alcohol, "taken")) {
msg ("There is nothing here on the shelf. Some thief must have already taken it!")
}
else {
msg ("You see a bottle of isopropyl alcohol here on one of the shelves.")
}
}
case ("G55VBH") {
msg ("You wonder around the maze of crates and boxes looking for G55VBH. Eventually you recognize a pattern in the coded numbers and find what you are looking for.<br/><br/>There is a skid here with several large boxes containing bottles of household vinegar.")
MoveObject (Xanadu, maze 10)
}
case ("N47NED") {
msg ("You wonder around the maze of crates and boxes looking for N47NED. Eventually you recognize a pattern in the coded numbers and find what you are looking for.<br/><br/>Here on a shelf you spot many canisters of iodized salt.")
MoveObject (Xanadu, maze 11)
}
case ("D08PLO") {
msg ("You wonder around the maze of crates and boxes looking for D08PLO. Eventually you recognize a pattern in the coded numbers and find what you are looking for.<br/><br/>There is a crate here that has several ominous warnings printed on it, all of which indicates that whatever is inside is highly explosive.")
MoveObject (Xanadu, maze 12)
}
case ("S53HHE") {
msg ("You wonder around the maze of crates and boxes looking for S53HHE. Eventually you recognize a pattern in the coded numbers and find what you are looking for.<br/><br/>On one of the nearby shelves you see a pallet loaded with boxes of Borax.")
MoveObject (Xanadu, maze 13)
}
case ("A66RMP") {
msg ("You wonder around the maze of crates and boxes looking for A66RMP. Eventually you recognize a pattern in the coded numbers and find what you are looking for.<br/><br/>There is a skid here that is shrink wrapped. Beneath the shrink wrap, you can make out sontainers of antifreeze. It must be used on the vehicles here at the compound.")
MoveObject (Xanadu, maze 14)
}
case ("E90TNA") {
msg ("You wonder around the maze of crates and boxes looking for L26FNP. Eventually you recognize a pattern in the coded numbers and find what you are looking for.<br/><br/>Here there is a shelf that has some small bottles of zinc on them.")
MoveObject (Xanadu, maze 15)
}
default {
msg ("You wonder around for what feels like hours and find nothing relavent. You do not have time to waste like this. You return to the front of the warehouse.")
}
}


I tried actual words instead of the code you see above... actually, it was quite a vulgar suggestion as I am currently frustrated... and it returned the "msg" I wanted. Does it have something to do with the letter/number combo?

The Pixie
This line here:
switch (LCase(result)) {

... means that the value of result gets converted tolower case. So if the player types "L26FNP", the switch command will see "l26fnp", which will not match any case statement. Try this instead:
switch (UCase(result)) {

XanMag
lol. Yep! That did it. I'm an idiot. Thanks again, Pixie!

I misunderstood the LCase code... I thought it looked at EVERYTHING in lowercase.

R2T1
You may also want to amend your use of 'wonder' to WANDER as in all your messages in each case - msg ("You wonder around ...)
The word you have used means an emotion of awe - WONDER, whereas I believe you mean to move aimlessly about - WANDER.

XanMag
You are 100% correct, sir. Thanks much! :oops:

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

Support

Forums