Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Blitzerland on Fri 23/01/2004 01:35:31

Title: Dialog_Request Question
Post by: Blitzerland on Fri 23/01/2004 01:35:31
When I am using the Dialog Request Function, I find myself unable to use more than nine dialog requests. Is there any way to use more?

You see, in my game there are these stores you can purchase items from. When you select a shop, you are presented with a dialog asking you what you want to buy. Not a bad idea, really. But I need to use more than 9 "run-script requests."

Like I said before, any way to use more?
Title: Re:Dialog_Request Question
Post by: Dorcan on Fri 23/01/2004 04:11:13
I don't quit understand, what does prevent you from using more dialog requests ?

I don't have any problem with having more than 9 dialog request.. for exemple, in my dialog code, I have somewhere run-script 100;

and in my global script :
function dialog_request (int xvalue) {
 ...
 if (xvalue==100){
   SetDialogOption(0,GetGlobalInt(100),1);
 }
 ...
}

strange
Title: Re:Dialog_Request Question
Post by: Ishmael on Fri 23/01/2004 09:41:20
How does it show that you can't use more then nine? As an error? A game log warning?
Title: Re:Dialog_Request Question
Post by: on Sat 24/01/2004 00:08:51
After param == 9, it doesn't work. Anything after param == 10, it just doesn't do anything. And there is no error message at all.

Wierd. Maybe I should change param to xvalue. Does it make a difference?
Title: Re:Dialog_Request Question
Post by: Scorpiorus on Sat 24/01/2004 00:40:41
It doesn't matter how the parameter is named. Can we  take look at your dialog_request function?
Title: Re:Dialog_Request Question
Post by: a-v-o on Sat 24/01/2004 10:36:08
Might be a problems with brackets { }. Maybe the later if-clauses are inside the previous if-clause like here:

if (param == 1)
{
 // do 1
}
if (param == 2)
{
// do 2
}
if (param == 3)
{
// do 3
if (param == 4)
{
// will never be executed because param is always 3 here
}
if (param == 5)
{
// will never be executed because param is always 3 here
}
}


suggestion:
put "else" in front of each if (except the first one). The excecution of the script should be a tiny bit faster and AGS should give you a compiler error at else-if-4.