Using global variables with dialog?

Started by Enchart, Thu 02/07/2015 10:02:48

Previous topic - Next topic

Enchart

I hope there is some simple way to make dialog options appear when certain global variables are true. I watched densmings video tutorials about dialogs, but they didn't cover this topic. I also tried to search forums but didn't find answer to my problems.

Last thing that I have tried is this

Code: ags

// Dialog script file
@S// Dialog startup entry point
  if (EMPquestion == true)
  {
  option-on 5
  }
  if (Siloquestion == true)
  {
  option-on 7
  }
  if (Billseen == true)
  {
  option-on 4
  }
return 


Option seems to be undefinied token in normal ags code. There must be some easy way to do this, but I can't find.
Thank's for help in advance


Cassiebsg

Also, you should not indent "option-on..." since that's a dialog command, not a script command.
Only indent script commands. (nod)
There are those who believe that life here began out there...

Crimson Wizard

Quote from: Cassiebsg on Thu 02/07/2015 16:15:07
Also, you should not indent "option-on..." since that's a dialog command, not a script command.

Actually, yes, you could remove indentation before these commands.
In latest AGS these commands are automatically replaced with corresponding script functions when game is compiled. So you should get same results.

Enchart

Thank you again for help.

dialog.SetOptionState is the way I got my code working.
Haven't tried with "option-on" without indentation.

SMF spam blocked by CleanTalk