I have recently bought Dialogue System and am currently learning to use it. I'm impressed with all the features but I am already running into several issues, probably coming from my misunderstanding of this or that feature, even after RTFM.
The biggest issue I have for now is the fact that during the first node of the conversation (which is on the player side, waiting for an input from the player), I want to be able to show the internal name of the other participant and I can't because I can't access its data, all this because
Code: Select all
DialogueManager.instance.activeConversation
In my game (still in prototyping phase), my characters are all the same at design time, they are generated when starting the level, using scriptable objects describing the identity of each one. When one of them starts a conversation with another, it calls
Code: Select all
DialogueManager.StartConversation (conv_name, this.transform, other.transform)
However, I also need to access some internal variables of the characters directly from Lua without copying them into the variables space of the Dialogue System because they might change during the conversation and I don't want to have to preemptively expose variables that I may or may not use in a conversation (and to have to do it the other way around when the conversation ends if any of these variables has changed). To this end, I made a few functions to get the values I need directly from the objects, by name. For example,
Code: Select all
GetString ("char_1.nickname")
Of course, when writing the conversation in the first place, I do not know that a character's internal name is "char_1", that id is calculated automatically at runtime so that it is unique. I only know it is either the actor or the conversant so I need a way to dynamically replace an alias (for example "@you") with the actual id ("char_1") when the conversation takes place. In other words, I write 'Hello [lua(GetString("@you.nickname"))], how are you?' in the very first node ("@you" being the alias for the conversant in this case) and I want it to show to the player, as a choice, "Hello Kay, how are you?" (if the "char_1" character's nickname is "Kay" and Kay is the conversant). But it doesn't work because for that I need the conversation and it is null at that time.
My initial workaround was to call
Code: Select all
DialogueLua.SetVariable ("your_nickname", other_character.nickName)
Code: Select all
DialogueManager.StartConversation()
Is there something didn't get correctly and how can I manage to get access to
Code: Select all
DialogueManager.instance.activeConversation
I have a second question, less blocking this one but it would be nice to have... Right now I write
Code: Select all
[lua(GetString("@alias.internal_variable"))]
Code: Select all
[@@alias.internal_variable]
Thanks!