Passing in the NPC via extra_game_states but unable to access them in dialogue #901
Replies: 2 comments
-
Don't have a solution, just chiming in to confirm that I have the same issue. I would like to pass an object reference into the dialogue manager so that I can reference its properties during the dialogue, but this functionality either doesn't work, doesn't exist, or is only possible by referencing Globals, which is a cumbersome solution that doesn't scale well. Or, probably the most likely scenario - it does work, but neither of us understand how to do it. It would be great if the documentation had an improved explanation of how to use the "You can pass an array of nodes/objects as the extra_game_states parameter when requesting a line of dialogue which will also be checked for possible mutation methods." |
Beta Was this translation helpful? Give feedback.
-
Hi! This certainly needs better docs (Even I didn't know till I dug through the source code haha), but here's how it works. On the scripting end, you can feed subclasses and entire scripts alike into the
On the dialogue end, it breaks if you try and reference the state itself by name, however all of the functions therein are totally functional. You can simply do the following, and it works as intended:
I reckon it would be a good idea to pop open an issue to add support for referencing extra game states by name, as well as a PR to flesh out the docs therein, but hope this helps. Update: Docs PR- #941 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When launching dialogue using show_dialogue_balloon(), I pass in the NPC dialogue owner (AuntBethany) to the DialogueManager as an extra_game_state. My custom_balloon is using that to pull in information about the NPC (e.g. color-coding), which works fine.
However, within the dialogue file, I have some content like the following:
This triggers the following error within the show_error_for_missing_state_value() method within dialogue_manager.gd:
As indicated within the error itself, "AuntBethany" should be directly referencable (and she does have a dialogue_variables dictionary). But I've been banging my head against this issue all day and am no further ahead. What am I overlooking? Is this a bug with the Dialogue Manager plugin (I'm up-to-date with v3.6.3)?
Beta Was this translation helpful? Give feedback.
All reactions