Skip to content

Conversation

@shoyguer
Copy link

@shoyguer shoyguer commented Nov 20, 2025

Summary

This PR adds documentation for using local variables in dialogue sessions, making them more visible for everyone.
I hope it helps everyone in their games as well as it helped with mine.

__

Changed

  • Updated docs/Basic_Dialogue.md
  • Added a new page: docs/Local_Variables.md

__

Notes

This is a follow-up to my previous branch: #1008 which added a redundant feature.

Adding this as requested from @Fireye04 .

Copy link
Contributor

@Fireye04 Fireye04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contrib! Left a few comments on general docs structure (namely the extra file) but locals definitely needed solid documentation and the skeleton provided here is super solid.

Appreciate the PR!

@shoyguer
Copy link
Author

@Fireye04 , documentation updated, as per your comments 😄
Can you please, check it out?

Copy link
Contributor

@Fireye04 Fireye04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks a lot better! Still a bit on the verbose side, but I think it should be good to merge after some trimming, pending a few tweaks on nathan's end :)

@shoyguer
Copy link
Author

@Fireye04 done!

@Fireye04
Copy link
Contributor

Awesome! LGTM on my end, now we just wait for Nathan to do a maintanence pass. Thanks!

Copy link
Owner

@nathanhoad nathanhoad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the doc updates - just a couple of things.


### Local variables

If you need temporary variables that only exist during a dialogue conversation, you can use locals. Locals are temporary variables that only live for the current conversation. When the conversation ends or changes dialogue files, the variables are deleted.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It important to mention that locals is implemented in the example balloon (as an example of simple, ephemeral state) and not the Dialogue Manager itself.

=> END
```

Extra game states are similar to locals in that they only exist during the current conversation. The key difference is that extra game states are accessed directly by name (e.g., `level`), while variables created with `set locals.variable_name = value` must always be prefixed with `locals.` (e.g., `locals.counter`).
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't necessarily true. Extra game states would usually be something that persists outside of dialogue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants