Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: How to delete response  (Read 1947 times)

0 Members and 1 Guest are viewing this topic.

padi

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 3
    • View Profile
How to delete response
« 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.  :)
Logged

fireside

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 211
    • View Profile
Re: How to delete response
« Reply #1 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.
« Last Edit: June 23, 2007, 05:59:17 PM by fireside »
Logged
 

Page created in 0.028 seconds with 19 queries.