Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Ardentsideburns on Thu 25/08/2016 23:41:07

Title: can you change global variables from a dialog?
Post by: Ardentsideburns on Thu 25/08/2016 23:41:07
just out of curiosity, i tried  setting a variable from false to true inside a dialog option and when checking for it again having a if function to redirect to another part of the dialog script within the same option. It looked like the system was fine with checking functions set outside the dialog, but that particular one seemed to remain false no matter how i wrote in the option that it was true. In the end i worked around it by simply turning off the option once it was selected (wich is something should've done from the beginning) but that made me think about if what i attempted to do is even possible and if i should be careful not to try that again, if it's not.
Title: Re: can you change global variables from a dialog?
Post by: Slasher on Fri 26/08/2016 05:00:45
Variables can be changed in dialogs. Post your full dialog script and let us look.
Title: Re: can you change global variables from a dialog?
Post by: monkey0506 on Fri 26/08/2016 16:14:25
Dialog scripts use a special syntax. Any normal scripting commands (including assigning variables) must be indented, e.g., "  myVar = true;" vs "myVar = true;". Make sure the line starts with at least one space.
Title: Re: can you change global variables from a dialog?
Post by: Mandle on Sun 28/08/2016 15:55:50
I feel that global warming can only be changed via honest dialogs between nations...