Dialog and Global Variables

Started by ClearlyBrogan, Tue 27/06/2023 23:09:04

Previous topic - Next topic

ClearlyBrogan

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:

Crimson Wizard

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

ClearlyBrogan

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?"


Crimson Wizard

#3
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

SMF spam blocked by CleanTalk