I almost hesitate to throw this out, because it's a bit of an abomination, but I can't help myself...
When you have a switch/case statement, Quest will run down the list of case statements and see which match the value in the switch part. The first one that matches is executed. Quest is different from other languages I've used in that the values in the case expressions don't need to be constant, and they don't need to be unique. So you can use strings, expressions (e.g. 3+4), etc.
When I say "don't need to be unique", I must qualify that. You can not have two values that literally look alike. For example, you can't have:
switch (sum) {
case(7) {
msg("first 7")
}
case(7) {
msg("second 7")
}
}
Quest will complain about duplicate keys. However, you *can* have this:
switch (sum) {
case(7) {
msg("first 7")
}
case(3+4) {
msg("second 7")
}
}
And that will execute properly. Of course, there's no point, as the first 7 means that 3+4 will never evaluated. But it does mean there is a way to do what you want, which is a sort of "obscured if". You almost had it with your statement about Boolean values. The trick is that Boolean values only have two values, true and false. So if you want to have "truthy" values in your cases, then you need to have "truthy" values in your switch - in other words, either true or false.
This is bizarre, but it works:
number = GetRandomInt(0, 10)
switch (true) {
case (number < 5) {
msg ("Foooooo")
}
case (number > 4) {
msg ("Barrrrrr")
}
}
What it does differently is that the switch value is simply "true". This means the switch statement will search for the first case statement that evaluates to true. It's really non-standard, in terms of what I suspect Alex intended, but it does work!