Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: padi on June 23, 2007, 04:43:13 PM

Title: How to delete response
Post by: padi on June 23, 2007, 04:43:13 PM
Hi,

In a dialogue, my actor has a choice between three responses. When the player choose a response I would to delete the other responses in the response box.

My dialogue structure is :

Code: [Select]
function CamionneurDialogue()
{
  var Responses;
  var Selected;

  var Loop = true;

  while(Loop)
  {
   
    Responses[0] = "Texte 0";
    Responses[1] = "Texte 1";
    Responses[2] = "Texte 2";
    Responses[3] = "Texte 3";

   
    Game.AddResponseOnceGame(0, "réponse 0");
    Game.AddResponseOnceGame(1, "réponse 1");
    Game.AddResponseOnceGame(2, "réponse 2");
   
if(StateDigikistan_village.TalkedToBallayeur==true)
        {
  Game.AddResponse(3, "réponse 3");  
}

    Selected = Game.GetResponse();

    actor.Talk(Responses[Selected]);
   
   
    if(Selected==0)
    { ....
    }

    if(Selected==1)
    { ....
    }

    if(Selected==2)
    { ....
    }

    if(Selected==3)
    { ....
    }

  }
}

If the player selected 1, the responses 0 and 2 must to disappear of the response box. How to make ?

Thank you for your help.  :)
Title: Re: How to delete response
Post by: fireside on June 23, 2007, 05:52:31 PM
I think if you use the AddResponseOnceGame you have to use:
{
Game.StartDlgBranch("nameOfBranch");
rest of function
Game.EndDlgBranch("nameOfBranch");
}

You can find more about it in the help section of the game object.  I've been doing it that way and the responses get automatically deleted.  Very nice feature, saves a lot of variable work and makes the dialog more dynamic.