Wintermute Engine Forum

Wintermute Engine => Bug reports => Topic started by: Dionysius on August 12, 2008, 04:57:06 PM

Title: Bug: Dialogue() function inside LeftClick and LeftDoubleClick events
Post by: Dionysius on August 12, 2008, 04:57:06 PM
I have some secondary actor which has such script
Code: [Select]
on "LeftClick" {
    LeftClick();
}

on "LeftDoubleClick" {
    LeftClick();
}

function LeftClick() {
    //some code with actor.GoTo method which depends on the type of click

    Dialogue();
}

function Dialogue() {
  Game.StartDlgBranch("NewDialogue");

  var EndBranch = false;

  while(!EndBranch) { 
    Game.AddResponseOnceGame(0, "/speech0404/");
    //more responses
   
    var Res = Game.GetResponse(true);
   
    switch(Res) {
      case 0:
        //some code
      break;

      //more cases
    }
  }
 
  Game.EndDlgBranch();
}

When I click on this person, the dialogue branch starts. But when I doubleclick - the new dialogue branch starts from the beginning. And vice versa.
Title: Re: Bug: Dialogue() function inside LeftClick and LeftDoubleClick events
Post by: metamorphium on August 12, 2008, 08:19:49 PM
this has been spoke about many times. See this thread

http://forum.dead-code.org/index.php?topic=2999.0
Title: Re: Bug: Dialogue() function inside LeftClick and LeftDoubleClick events
Post by: Dionysius on August 13, 2008, 05:23:43 PM
metamorphium, your solution didn't help me. But I solve my problem by replacing Dialogue() 'function' with 'method'.