Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: tkitez on Sun 05/08/2007 14:05:55

Title: run-script 0 ; apparently 0 is not allowed?
Post by: tkitez on Sun 05/08/2007 14:05:55
I get a compiler error (invalid parameter) if I use 0 as the parameter for
run-script.  I have a test in my global script (in dialog_request) for values
0 through 4.  If I simply change
run-script 0  to run-script 4 the compiler is happy.  Is zero not allowed?
Title: Re: run-script 0 ; apparently 0 is not allowed?
Post by: Ubel on Sun 05/08/2007 14:10:11
If it doesn't work then it's quite obviously not allowed. "error (invalid parameter)" pretty much says it all.
Title: Re: run-script 0 ; apparently 0 is not allowed?
Post by: Ashen on Sun 05/08/2007 14:30:51
As Pablo said, the error message pretty much says it all. The example in the BFAQ starts from 1, not 0, so it's probably a known issue even if it's not explicitly stated anywhere. Other than curiousity, is there an actual problem here?
It'd be good if it was mentioned somewhere, but losing one possible value for run-script shouldn't mess up anyone's game. You can always use GlobalInts and set-globalint for 'extra' parameters:


// dialogue
set-globalint 1 3
run-script 1

//global script
function dialog_request (int xvalue) {
  if (xvalue == 1) {
    if (GetGlobalInt(1) == 1) {
      // whatever
    }
    // etc
  }
}