Hi again,
it seems there is some little problem with the quite new "switch()" command when using it nested... the game interpreter freezes!
Example:
switch(Command.Verb)
{
case "Use":
ran = Random(0,3);
switch(ran)
{
case 0: actor.Talk("That doesn't work!"); break;
case 1: actor.Talk("That makes no sense at all!"); break;
case 2: actor.Talk("What ?!"); break;
case 3: actor.Talk("No! Get serious!"); break;
}
break;
}
In that example, the actor talks his sentence and then the game freezes. When using if/else in the case block, it works as expected.
Oh, and another little one: I can't set the default value somewhere else than at the top. I guess this is just "as it is" and correct, but I want to mention it in case this is NOT wanted.
For example:
switch(number)
{
case 1:
actor.Talk("Number ONE!");
break;
case 2:
default :
actor.Talk("Oh, TWO again. Seems to be the default value!");
break;
case 3:
actor.Talk("AH! THREE!");
break;
}
This throws a syntax error on the "case 3:" line. It works without problem by moving the "case 2:/default:" block to the bottom.
Thanks for helping.