Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: ClearlyBrogan on Tue 27/06/2023 23:09:04

Title: Dialog and Global Variables
Post by: ClearlyBrogan on Tue 27/06/2023 23:09:04
Hi, just wondering where I'd put a global variable change once a certain dialog option has been used.

Such as

Character: Go to the shop

and then I'd want the global variable for the shop being available to change to true. Would this be done in dialogs or elsewhere in the script?

Probably a big noob question D:
Title: Re: Dialog and Global Variables
Post by: Crimson Wizard on Tue 27/06/2023 23:44:18
Dialog scripts support all the commands that regular script supports, but they have to be indented with at least 1 space in order to be understood.
This lets to read and change global variables, and almost anything else.

This is explained in this article in the manual:
https://adventuregamestudio.github.io/ags-manual/DialogScript.html#using-regular-scripting-commands-in-dialogs
Title: Re: Dialog and Global Variables
Post by: ClearlyBrogan on Wed 05/07/2023 18:57:42
Thanks

Also, how would I add a dialog option once a variable is happened.

For example, player goes to a church but it's closed.
Now I want a dialog option to appear asking "when does the church open?"

Title: Re: Dialog and Global Variables
Post by: Crimson Wizard on Wed 05/07/2023 19:32:42
Quote from: ClearlyBrogan on Wed 05/07/2023 18:57:42Also, how would I add a dialog option once a variable is happened.

For example, player goes to a church but it's closed.
Now I want a dialog option to appear asking "when does the church open?"

It's mentioned in the same article, only couple paragraphs higher:
https://adventuregamestudio.github.io/ags-manual/DialogScript.html#dialog-commands
also there are regular script functions to do similar thing from normal script:
https://adventuregamestudio.github.io/ags-manual/Dialog.html#dialogsetoptionstate