Problems with And Statment

Started by MillsJROSS, Wed 17/09/2003 03:27:03

Previous topic - Next topic

MillsJROSS

I'm trying to get it so that when two Global ints are set to a number upon talking a a character the script detects this, and turns on a dialog option. But my script seems to do nothing.

if ((GetGlobalInt(5)==5) && (GetGlobalInt(4)==5)) {
  SetDialogOption(6,8,1);
}    

Am I doing somthing wrong?

-MillsJROSS

cornjob

Well, there's nothing wrong with your script per se... however there could be several problems.

Where did you put this script? Make sure it's in a place where it will get called after the global ints are set to meet the condition, but before the dialogue is started.

Also (of course) make sure your numbers are right and your global ints are really getting set correctly.

Sorry if this sounds obvious, but that's all I could think of.

MillsJROSS

Alright, I finally found the problem. See I had set a global int through a run-script comand via through dialog, and I kept checking to see that my script was set for the correct variable, it was. However, I didn't check to see if I directed the run-script to the correct script. There I found my mistake. Also I had put the script before the start diolog in the characters talk to interaction. And for some reason it wouldn't work the first time after the variables were correct, but it would work the next time.

So to fix that, I just got rid of it there, and attatched the script to the point those GlobalInts are actually changed. It works now. Thank you for your help, it was actually you that made me think "If my script is correct, there's got to be an error somewhere. Perhaps it's where I'm pointing my run-script command."

Thanks.

-MillsJROSS

SMF spam blocked by CleanTalk