-
-
Notifications
You must be signed in to change notification settings - Fork 233
Add Locals Documentation #1019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add Locals Documentation #1019
Conversation
Fireye04
left a comment
There was a problem hiding this 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!
|
@Fireye04 , documentation updated, as per your comments 😄 |
Fireye04
left a comment
There was a problem hiding this 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 :)
|
@Fireye04 done! |
|
Awesome! LGTM on my end, now we just wait for Nathan to do a maintanence pass. Thanks! |
nathanhoad
left a comment
There was a problem hiding this 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. |
There was a problem hiding this comment.
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`). |
There was a problem hiding this comment.
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.
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
docs/Basic_Dialogue.mddocs/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 .