the 'switch' Script is just a different and arguably easier design method of doing multiple 'if~else if' Scripts (but more limited in functionality):
http://docs.textadventures.co.uk/quest/scripts/if.html
http://docs.textadventures.co.uk/quest/scripts/switch.html
an example (in code, hopefully this doesn't scare you too much):
<function name="sex_function">
msg ("Sex?")
msg ("(1) male or (2) female")
get input {
// the quest engine automatically (hidden from you) sets: result = your_typed_in_input
if (result = "1") {
player.sex="male"
} else if (result = "2") {
player.sex="female"
} else {
sex_function
}
}
</function>
vs
<function name="sex_function">
msg ("Sex?")
msg ("(1) male or (2) female")
get input {
// the quest engine automatically (hidden from you) sets: result = your_typed_in_input
switch (result) {
case ("1") {
player.sex="male"
}
case ("2") {
player.sex="female"
}
// if the person types in anything other than '1' or '2', then you got a problem.
}
}
</function>
as for what you want to do:
the easiest would be using the 'Got' Function:
http://docs.textadventures.co.uk/quest/functions/corelibrary/got.html
player.parent = room
if (Got(key1)) {
player.parent = room2
} else if (Got(key1) and Got (key2)) {
player.parent = room3
} else if (Got (key1) and Got (key2) and Got (key3)) {
player.parent = room4
}
// etc etc etc
else {
msg ("You need keys to open up this door.")
}
otherwise, you got to work with lists:
http://docs.textadventures.co.uk/quest/guides/using_lists.html
http://docs.textadventures.co.uk/quest/functions/corelibrary/scopeinventory.html
http://forum.textadventures.co.uk/viewtopic.php?f=18&t=5137 (my guide on using lists and dictionaries)
using either:
ListCount ( http://docs.textadventures.co.uk/quest/functions/listcount.html )
~OR~
ListContains ( http://docs.textadventures.co.uk/quest/functions/listcontains.html )
// this is actually what the 'got' Function does for you (using ScopeInventory list, anyways).
if you want to use lists, let me know, and I'll help you in using them.