Dialog_Request Question

Started by Blitzerland, Fri 23/01/2004 01:35:31

Previous topic - Next topic

Blitzerland

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?

Dorcan

#1
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

Ishmael

How does it show that you can't use more then nine? As an error? A game log warning?
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Me again

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?

Scorpiorus

It doesn't matter how the parameter is named. Can we  take look at your dialog_request function?

a-v-o

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.

SMF spam blocked by CleanTalk