Taking this a little bit further I built a simple framework to test the concept and get the same result, could the problem be that I am using an attached script or perhaps my installation of WME has become corrupted ! I have also test the script with a "clean " project, of course it may be I have an error in my coding !!
#include "scripts\base.inc"
////////////////////////////////////////////////////////////////////////////////
//on "event"
//{
// ...
//}
var options;
options[0] = "this is top level option 1";
options[1] = "this is top level option 2";
options[2] =" this is top level option 3";
var selected;
while(selected !=2)
{
Game.AddResponseOnce(0,options[0]);
Game.AddResponseOnce(1,options[1]);
Game.AddResponseOnce(2,options[2]);
Game.Interactive = true;
selected = Game.GetResponse();
switch (selected)
{
case 0:
Game.Msg("this is top level case 0");
testb();
break;
case 1:
Game.Msg("this is top level case 1");
break;
case 2:
Game.Msg("this is top level case 2");
break;
}
}
function testb()
{
Game.StartDlgBranch();
var options;
options[0] = "this is testbline1";
options[1] ="this test line 2";
options[2] ="bye";
var selected;
while (selected !=2)
{
Game.AddResponseOnce(0,options[0]);
Game.AddResponseOnce(1,options[1]);
Game.AddResponseOnce(2,options[2]);
selected = Game.GetResponse();
switch (selected)
{
case 0:
Game.Msg("this is case 0");
break;
case 1:
Game.Msg("this is case 1");
break;
case 2:
Game.Msg("this is the last case");
break;
}
}
Game.EndDlgBranch();
}