Calling dialogues and controlling paths from script
Posted: Tue Jun 25, 2019 3:37 pm
Hello Tony,
I hope you are doing well! I have a question or two if you don't mind.
I tried looking through the documentation and some threads. This thread looked pretty close:
Start Conversation by ID
I have a system to call dialogues already and it's mostly setup but now I would like to switch to your brilliant and well optimized Pixel Crusher dialogue system in for my previous system dialogue system (+8,000 line custom code gone *SOBS*).
string Dialogue1 = "Name of dialogue to call1"
string Dialogue2 = "Name of dialogue to call2"
string Dialogue3 = "Name of dialogue to call3"
string Dialogue4 = "Name of dialogue to call4"
string Dialogue5 = "Name of dialogue to call5"
string Dialogue6 = "Name of dialogue to call6"
string Dialogue7 = "Name of dialogue to call7"
string Dialogue8 = "Name of dialogue to call8"
string Dialogue9 = "Name of dialogue to call9"
string Victory = "Name of dialogue to callV"
string VictoryPost = "Name of dialogue to callVP"
string Defeat = "Name of dialogue to callD"
string DefeatPost = "Name of dialogue to callDP"
(most characters don't utilize all of the dialogue slots, most just use either 1 or 4, but some use all of them. For the characters that have only 1 dialogue I am moving over to your bark dialogue system, almost ready to implement.)
THE SMART WAY (if possible)
Now I know that is lot of variables to have dialogues saved in here as strings. I saw the system where you have a group passthrough and then control which dialogue path has priority. That seems very intelligent and well designed but I don't know how to control which dialogue/path in there has priority. It looks like you're supposed to use the conditions system or quest system but I don't think I will use that because we already have both of those systems setup and filled with content.
For example Starter Group that is passthrough to 3 dialogues
-Dialogue - Ask to battle - PATH 1
-Dialogue - Player Wins - PATH 2
-Dialogue - Player Loses and npc asks for a rematch - PATH 3
Question:
Is there a way to control the path for the dialogue through code. If I could say "Path 2 will have priority". If there was an easy way to call the Path Number that would be excellent. How do I set that in both C# and Unityscript? (I'm in Unity 5.6)
THE ALREADY SETUP WAY
I already have a system to save, store, and advance the dialogues. But I don't know how to call them by string name
This bit of code right here is super helpful but I don't know how to call the conversation/make it fire.
var title = DialogueManager.MasterDatabase.GetConversation(id).Title;
var id = DialogueManager.MasterDatabase.GetConversation("title").id;
Question:
So in the variables above. How do I call the dialogue by title (string)? Or if I can't call dialogues by title, how do I call them by ID (ints)? How do I call in both C# and Unityscript?
I would be grateful for any help. Thank you!
Warm Regards,
Jesse
I hope you are doing well! I have a question or two if you don't mind.
I tried looking through the documentation and some threads. This thread looked pretty close:
Start Conversation by ID
I have a system to call dialogues already and it's mostly setup but now I would like to switch to your brilliant and well optimized Pixel Crusher dialogue system in for my previous system dialogue system (+8,000 line custom code gone *SOBS*).
string Dialogue1 = "Name of dialogue to call1"
string Dialogue2 = "Name of dialogue to call2"
string Dialogue3 = "Name of dialogue to call3"
string Dialogue4 = "Name of dialogue to call4"
string Dialogue5 = "Name of dialogue to call5"
string Dialogue6 = "Name of dialogue to call6"
string Dialogue7 = "Name of dialogue to call7"
string Dialogue8 = "Name of dialogue to call8"
string Dialogue9 = "Name of dialogue to call9"
string Victory = "Name of dialogue to callV"
string VictoryPost = "Name of dialogue to callVP"
string Defeat = "Name of dialogue to callD"
string DefeatPost = "Name of dialogue to callDP"
(most characters don't utilize all of the dialogue slots, most just use either 1 or 4, but some use all of them. For the characters that have only 1 dialogue I am moving over to your bark dialogue system, almost ready to implement.)
THE SMART WAY (if possible)
Now I know that is lot of variables to have dialogues saved in here as strings. I saw the system where you have a group passthrough and then control which dialogue path has priority. That seems very intelligent and well designed but I don't know how to control which dialogue/path in there has priority. It looks like you're supposed to use the conditions system or quest system but I don't think I will use that because we already have both of those systems setup and filled with content.
For example Starter Group that is passthrough to 3 dialogues
-Dialogue - Ask to battle - PATH 1
-Dialogue - Player Wins - PATH 2
-Dialogue - Player Loses and npc asks for a rematch - PATH 3
Question:
Is there a way to control the path for the dialogue through code. If I could say "Path 2 will have priority". If there was an easy way to call the Path Number that would be excellent. How do I set that in both C# and Unityscript? (I'm in Unity 5.6)
THE ALREADY SETUP WAY
I already have a system to save, store, and advance the dialogues. But I don't know how to call them by string name
This bit of code right here is super helpful but I don't know how to call the conversation/make it fire.
var title = DialogueManager.MasterDatabase.GetConversation(id).Title;
var id = DialogueManager.MasterDatabase.GetConversation("title").id;
Question:
So in the variables above. How do I call the dialogue by title (string)? Or if I can't call dialogues by title, how do I call them by ID (ints)? How do I call in both C# and Unityscript?
I would be grateful for any help. Thank you!
Warm Regards,
Jesse