Wintermute Engine > Bug reports
Problems with Game.AddResponseOnce()
Mac:
Hi guys,
I actually have problems with the use of Game.AddResponseOnce(). Responses declared as "Once" appear to only display once a game. Here's an example of a piece the doesn't work:
--- Code: ---function Dialog_Bibliothekar()
{
Game.StartDlgBranch("Dialog_Bibliothekar");
BibliothekarAufgewacht=true;
actor.Talk("Hallo!");
Bibliothekar.Talk("Hellas!");
// Start of response loop
var Select0;
var Loop0 = true;
while(Loop0)
{
if(QuizHalbzeit) Game.AddResponseOnce(0,"Haben sie ein Buch über Kriege und Schlachten?");
Game.AddResponse(1,"Einen schönen Tag noch.");
Select0 = Game.GetResponse();
if(Select0==0)
{
actor.Talk("Haben sie ein Buch über Kriege und Schlachten?");
Dialog_Bibliothekar_SchlachtenFragen();
}
if(Select0==1)
{
actor.Talk("Einen schönen Tag noch.");
Loop0 = false;
}
}
Game.EndDlgBranch("Dialog_Bibliothekar");
}
--- End code ---
The variable QuizHalbzeit is true the whole time, but response 0 is only shown one time.
Any ideas someone?
Cheers
Mac
metamorphium:
it should work. So you are saying, that upon next entry of this dialogue eg. Game.Msg(QuizHalbzeit); shows true and the option is not there?
eborr:
I have had quite a lot of trouble with the Game.AddResponce one stuff.
One thing you might want to try is to close with
Game.EndDlgBranch();
without adding any value in the parentheses, I can't explain why but this works for me.
Mac:
--- Quote ---So you are saying, that upon next entry of this dialogue eg. Game.Msg(QuizHalbzeit); shows true and the option is not there?
--- End quote ---
Yes, that's right. It behaves like '.AddResponseOnceGame' in this script.
--- Quote ---I have had quite a lot of trouble with the Game.AddResponce one stuff.
One thing you might want to try is to close with
Game.EndDlgBranch();
without adding any value in the parentheses, I can't explain why but this works for me.
--- End quote ---
I'll try it to see what happens.
Mac:
I tried eborr's advice (and a few other things) but with no success. I've cut the script down a bit:
--- Code: ---function Dialog_Bibliothekar()
{
Game.StartDlgBranch("Dialog_Bibliothekar");
BibliothekarAufgewacht=true;
actor.Talk("Hallo!");
Bibliothekar.Talk("Hellas!");
// Start of response loop
var Select0;
var Loop0 = true;
while(Loop0)
{
if(QuizHalbzeit) {
Game.Msg(QuizHalbzeit);
Game.AddResponseOnce(0,"Haben sie ein Buch über Kriege und Schlachten?");
}
Game.AddResponse(1,"Einen schönen Tag noch.");
Select0 = Game.GetResponse();
if(Select0==0)
{
actor.Talk("Haben sie ein Buch über Kriege und Schlachten?");
// Dialog_Bibliothekar_SchlachtenFragen();
}
if(Select0==1)
{
actor.Talk("Einen schönen Tag noch.");
Loop0 = false;
}
}
Game.EndDlgBranch();//Dialog_Bibliothekar");
}
--- End code ---
I still doesn't work. The game log says 'yes' when entering the section but the option is still not shown.
Navigation
[0] Message Index
[#] Next page
Go to full version