Search Unity

[70% OFF - FLASH DEAL] Dialogue System for Unity - easy conversations, quests, and more!

Discussion in 'Assets and Asset Store' started by TonyLi, Oct 12, 2013.

  1. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Just let me know how I can help, and I'll do my best!

    Hi @Pedro Alaiagames - Unless your databases are very big, I recommend putting everything in one database. It's much easier to manage. You can group conversations by NPC by including the NPC name in the conversation title, separated by a forward slash. For example:
    • Gandalf/Birthday Conversation
    • Gandalf/Against Balrog
    • Legolas/Council Speech
    • Legolas/Gimli Banter
    • Legolas/Combat Barks
    In the Dialogue Editor, the conversation dropdown will show submenus for "Gandalf" and "Legolas".

    If you have multiple databases, you can merge them into a single database.

    If you must use multiple databases, make sure to use the Unique ID Tool to ensure that internal IDs are unique across the databases. You can also sync assets across databases.



    To define camera angles, assign a Camera Angles GameObject to the Dialogue Manager's Camera Angles property. If none is assigned, it will use a default prefab that defines angles such as "Closeup", "Medium", and "Wide" that are child GameObjects. Their local position defines the relative position of the camera. For example, the "Closeup" child GameObject is 1 unit back and 2 units up. When the Dialogue System applies this angle to a character, it will move the camera 1 unit away from the character and 2 units up:



    To use camera angles in conversations, use the Camera() sequencer command.

    Because camera angles are relative to the subject, you can use them for any characters. For example, let's say the conversation involves Gandalf and the Balrog. This is the dialogue entry:
    • Dialogue Text: "You shall not pass!"
    • Sequence: Camera(Wide, speaker); Camera(Closeup, Frodo, 2)
    The first Camera() command does a wide shot of the speaker (Gandalf). The second Camera() command pans to a closeup of Frodo over 2 seconds. Since Frodo is neither the speaker nor the listener, you need to specify his GameObject name instead.

    In addition to using the relative camera angles defined in the Camera Angles GameObject, you can also provide other GameObject names to the Camera() sequencer command. In this case, the Dialogue System will move the camera to the position of that GameObject.

    Here's the video tutorial:

     
    Last edited: Apr 21, 2015
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Unity Blog - Capital: Adventures in Adventure Creating

    Check out today's Unity Blog: http://blogs.unity3d.com/2015/04/21/capital-adventures-in-adventure-creating/

    It features Ash Denton's game in development, Capital:

    Capital has a great style to it, and uses Adventure Creator and the Dialogue System!
     
  3. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    Afternoon, Tony. How's it going?

    I have a question. What would be the best way to handle variables for a quest? In the video, you create a variable named "kills" and the quest tracks this. However, wouldn't it be better to keep that variable compartmentalized with the quest itself? Or is there a reason you use variable for this? I kind of feel like there will be a whole lot of variables here for my game and I'd like to keep everything organized if possible.

    What would be your recommendation for this?
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi - Instead of a variable, define a field in your quest. Here's a comparison:

    Let's say you have two quests: "Kill 5 Rats" and "Kill 10 Goblins".

    You could define two variables: Rats_Killed and Goblins_Killed. The advantages are that you can use IncrementOnDestroy (which works with variables), and all your kill counters are in one place. In code, you can use DialogueLua.GetVariable("Rats_Killed").

    ( This is what you're talking about: )
    Alternatively, you can define a "Killed" field in each quest. This is more compartmentalized. In code, you can use DialogueLua.GetQuestField("Kill 5 Rats", "Killed"). To define a field, edit your quest and expand the "All Fields" section at the bottom. Then click the "+" button to add a new field.

    If you want to add a field to all of your quests (such as "EXP" for experience point reward), you can add it to the template instead.

    If you want to use a script like IncrementOnDestroy with the quest field, just make a copy and customize it. You can find IncrementOnDestroy.cs in Scripts/Supplemental/Utility.
     
  5. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    Cool. I got this working.

    So what about a situation where I want to print how many bandits have been killed? If I'm making a general "kill quest", then the system has to know how many things have to be killed in order to print it on the character quest sheet. What I mean is... (all variables are fields on the quest)

    Quest 1: Kill 10 Goblins (Need to know it's a kill quest and the targets are goblins and 10 of them need to be killed.)
    Quest 2: Kill Bandit Leader and 5 Bandits (Need to know it's a kill quest and the targets are bandits and 1 leader.)
    Quest 3: Kill 8 Salamanders and collect 8 skulls (Need to know it's both a collect quest and a kill quest and that 8 salamanders need to be killed as well as 8 skulls collected.)

    I guess what I'm getting as is how do we gather all of this information generically in the system you have now?

    Hmmm...perhaps I'll need to figure that out. But I was more thinking along the lines of the automatic setup that I guess get information from the Entry fields.

    Oh, and one last thing. In the quest entry, how do I print the variables using lua like you did in the video. I'm using a "kills" variable in the fields section for tracking.
     
    Last edited: Apr 21, 2015
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @EDarkness - Take a look at the "Thin the Ranks" quest in the Dialogue System's Quest Example scene. It uses a special tag in the quest entry text, something like this:
    • Entry 1: "[var=Kills] of 5 Enemies Killed"
    At runtime, the Dialogue System replaces "[var=Kills]" with the value of the Kills variable (e.g., "3 of 5 Enemies Killed") in the quest log window. If you're not using the quest log window, run it through the formatted text parser:
    Code (csharp):
    1. var entry1 = QuestLog.GetQuestEntry("Thin the Ranks", 1);
    2. var text = FormattedText.Parse(entry1).text;


    If you're using a field inside the quest (instead of a variable), you'll have to use the [lua()] tag instead of the [var] tag. The [var] tag is a shortcut for the [lua(XXX)] tag that only works with variables.
    • Entry 1: "[lua( Quest['Thin_the_Ranks'].Kills )] of 5 Enemies Killed"



    The line above is still specific to the "Thin the Ranks" quest. You can get fully automatic, but it's a little more complicated. It really depends on how you plan to instantiate quests. Let's call the generic form the "template" and the specific "Kill 10 Goblins" quest the "instance". One way is to write the kill template in your dialogue database and maintain the instance data in your script. If this is what you want to do, then you can set some temporary Lua variables before grabbing text from the kill template:
    Code (csharp):
    1. DialogueLua.SetVariable("CurrentKills", currentKills);
    2. DialogueLua.SetVariable("RequiredKills", requiredKills);
    3. DialogueLua.SetVariable("Target", "Goblins");
    4. DialogueLua.SetVariable("Giver", "Farmer Bob");
    Then define your template with fields like these:
    • QuestTitle: "Kill [var=RequiredKills] [var=Target]"
    • Description: "[var=Giver] asked you to kill [var=RequiredKills] [var=Target] and come back for a reward."
    • Entry 1: "[var=CurrentKills] of [var=RequiredKills] Killed"
    Another way to handle quests is to add a new quest to the Dialogue System at runtime using QuestLog.AddQuest(). You can pull the content of the quest from your previously-written template quest. This keeps all the data in the Dialogue System instead of having to maintain it in your own scripts.

    I'm just taking some guesses here about your needs. If I'm off base, let me know.
     
  7. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    Thanks for the information on getting variables. Funny thing is I figured it out right before you responded. I kept getting "nil" and I couldn't figure out why. Come to find out it was just a syntax thing.

    Looks like I have some thinking to do if I want to have a lot of quest variety. No problem, though. Gotta get this solved because many quests will have multiple threads and being able to do more than one task and report it is a pretty serious issue. I like the idea of adding a quest to take care of each part at run-time, but it'll need some refinement.

    Also, I'm curious what is the best way to handle an NPC's dialog throughout the whole game. In my game there are a lot of variables, but I'd like to keep every NPC's dialogue tree contained, even with all of their options. Since conversation is a lot more detailed than most games, every NPC has a base amount of things they say (who they are, what they do, rumors, etc.). Then there are things that are more specialized depending on what's going on in the world. The way I'm designing things now, every NPC has their own conversation tree (example: "NPC Bob", "NPC Sarah", "NPC Jack", etc.). Instead of "Bob/Conversation 1", "Bob/Conversation 2", etc. Is it better to do this, or is it better to do it another way?

    Also, is there another way to get to my functions other than using Lua.RegisterFunction()? My functions aren't static and Lua doesn't want to play nice. Some kind of signal or event that can happen once a quest is finished would do the trick, too.
     
    Last edited: Apr 22, 2015
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @EDarkness - How about using quest entries? Look at the "Get the Coordinates" quest in the Quest Example scene:



    This quest has two stages: (1) Deliver the codes to Private Hart, and (2) Return to General Starr with the coordinates.

    The second stage (Entry 2) doesn't become active until you've completed the first stage. You have control over when each entry is active. In some quests you can do tasks in parallel; in this case, you could make multiple entries active at the same time.

    Sorry in advance for the non-answer, but "it depends." If an NPC has several different dialogue trees in different contexts, you might want to make them different conversations just for the sake of organization. (Also keep in mind that you can make links across different conversations.) Then again, you might find it easier to keep everything an NPC has to say in a single conversation so you can see it all on one canvas.

    You can put any text (not just NPC names) in front of forward slashes, as many levels as you want. For example, you might divide your conversations like this:
    • Apartment/Bob/Conversation
    • Apartment/Sarah/Conversation
    • Apartment/Sarah/Talking In Sleep
    • Apartment/Sarah/Sarah's Big Secret
    • Nightclub/Bob/Pickup Lines
    • Nightclub/Sarah/Conversation
    Or you could group them like this:
    • Bob/Apartment/Conversation
    • Bob/Nightclub/Pickup Lines
    • etc...
    Or of course you could just put all of Bob's lines in a single conversation.

    If you want to keep track of something specific to an actor, you could store it in a field in the actor's table. The example database has the fields Name, Description, and IsPlayer:



    You can add other fields at design time (in the dialogue database) or at runtime (through Lua or DialogueLua.SetActorField()):
    • Speaker: Player
    • Dialogue Text: "Sorry, Bob, I slept with your girlfriend."
    • Script: Actor["Bob"].KnowsAboutCreeping = true
      Variable["Alert"] = "Bob will remember that."
    You can also use the Chat Mapper-style relationship functions:
    • Speaker: Player
    • Dialogue Text: "Sweet dance moves, Bob!"
    • Script: IncRelationship(Actor["Bob"], Actor["Player"], "Friendship", 10)
    If the data isn't specific to an actor, you might want to use a variable instead. It's up to you, though.

    How about the SendMessage() sequencer command?
    • Speaker: Player
    • Dialogue Text: "Here are the 5 wolf skins you asked for."
    • Script: Quest["Get_5_Wolf_Skins"].State = "success"
    • Sequence: SendMessage(CompletedQuest, Get 5 Wolf Skins, Quest Manager)
    The sequence command above looks for a GameObject named "Quest Manager". Then it sends the message "CompletedQuest" with the parameter "Get 5 Wolf Skins". (Also note the lack of quotes in sequencer commands.) Give your Quest Manager GameObject a script with a void CompletedQuest(string title) method.

    You could also write your own customer sequencer command, which is really simple. There's a template in the Scripts/Templates folder.
     
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Updated Adventure Creator Support Package

    Adventure Creator 1.44 was just released today with a change to an API call that requires an updated Dialogue System support package. You can download an updated package here or on the Pixel Crushers customer download site. This updated package:
    • Works with Adventure Creator 1.44.
    • Improves the ACCam() sequencer command. If you specify an AC camera name (and optional smoothing time as the second parameter), it will switch to that AC camera, as long as you haven't configured the AC Bridge to disable the AC camera during conversations.
    • Includes an update for the ACSpeech() sequencer command.
     
    Last edited: Apr 22, 2015
  10. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    Thanks for all the information, Tony. It's been extremely helpful. I'm starting to feel pretty confident about what I'm doing and it's working out pretty well so far. Got a quest working complete with rewards and everything.

    Is it possible to put some lua code in a field? For example, if I don't want to put "[var=Kills] of 5 Enemies Killed" in the entry section. I'd like it in a field instead. I don't want the entry info for kill or collect objectives to end up below the quest text. Same for when a quest is tracked on the main screen. I really want more control over where that is and how that happens.

    Sorry for all the questions. Just trying to nail all of this down.
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @EDarkness - Sure, you can put Lua code or "formatted text" in fields.

    Formatted text is a string that can contain special markup tags such as [var], [lua], [em], etc. -- for example, used in the Dialogue Text field. To process the tags, run the string through FormattedText.Parse():
    Code (csharp):
    1. var myText = FormattedText.Parse("[var=Kills] enemies killed").text;
    Or, to parse a field:
    Code (csharp):
    1. var myText = FormattedText.Parse(DialogueLua.GetQuestField("My Quest", "SomeField").AsString).text;
    You can also put raw Lua code in a field. I mentioned earlier that another team did this. The level designers put Lua code in fields. They had fields like:
    • StartCode: timeLimit = 60; StartTimer()
    • EndCode: questsDone = questsDone + 1; GiveReward("Golden Axe")
    (They registered their own C# functions with Lua, such as StartTimer() and GiveReward().)

    When they started a quest, they'd run the StartCode field in Lua:
    Code (csharp):
    1. public void StartQuest(string title) {
    2.     QuestLog.StartQuest(title);
    3.     var startCode = DialogueLua.GetQuestField(title, "StartCode").AsString;
    4.     Lua.Run(startCode);
    5. }
     
  12. benflock

    benflock

    Joined:
    Jul 11, 2013
    Posts:
    24
    me again

    getting an error using an ngui prefab that stope my scenes running on ios:

    NullReferenceException: Object reference not set to an instance of an object
    PixelCrushers.DialogueSystem.ConversationView.FinishSubtitle ()
    PixelCrushers.DialogueSystem.ConversationView.OnConversationContinue ()
    UnityEngine.Component:SendMessage(String, SendMessageOptions)
    PixelCrushers.DialogueSystem.AbstractDialogueUI:OnContinue()
    PixelCrushers.DialogueSystem.NGUI.NGUIDialogueUI:OnContinue() (at Assets/Dialogue System/Third Party Support/NGUI/Scripts/NGUI Dialogue UI/NGUIDialogueUI.cs:129)
    EventDelegate:Execute() (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:459)
    EventDelegate:Execute(List`1) (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:602)
    UIButton:OnClick() (at Assets/NGUI/Scripts/Interaction/UIButton.cs:248)
    UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
    UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:918)
    UICamera:processTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1598)
    UICamera:processMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:1226)
    UICamera:processTouches() (at Assets/NGUI/Scripts/UI/UICamera.cs:1296)
    UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:1060)

    happens with continue buttons - but i can't work out what its complaining about...

    thanks for your help as ever

    best

    b
     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @benflock - Does this happen with all dialogue UIs, or is it specific to a single NGUI dialogue UI?
    If you set Dialogue Manager > Continue Button to Never, does it still raise the error?
    Would it be possible for you to send an example project to tony (at) pixelcrushers.com so I can trace through what's happening?
     
  14. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    Hey Tony, is there any way to send a sequencer message from a QuestTrigger script? I want to send a message to the player in order to perform a bark, but I can't figure out how to perform a sequencer command from there. Since the player's game object isn't in the scene while I'm setting up the trigger, I can't drag it in there. So calling it from a script would be a good way to get to what I want to do.

    Everything is working pretty well, so far. You've put together something that pretty powerful. I hope I can craft something cool with it. Got my second quest working and using a trigger out in the world. Next is going to be a collection quest. Heh, that should be fun.
     
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi James - You can't run sequencer commands directly from a QuestTrigger. But you can add a SequenceTrigger and set its trigger type the same as the QuestTrigger (e.g., OnUse, OnTriggerEnter, etc.). If they're on the same GameObject, both will run when the triggering event occurs.

    Alternatively, you could grab the source files and combine them into one big, new script called QuestTriggerWithSequence.cs or something like that.
     
  16. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    It's okay. I'll work it out some way. I followed your suggestion and got it working. I feel pretty confident now, and I think I'll be doing the conversations in Unity since I dig the new layout you have.

    Gonna need to think about localization now. I got this new asset that a friend of mine recommended and I haven't really messed around with yet. Probably need do it before I get into this seriously.

    Pretty good stuff so far, though. Just a lot of work to do. :)
     
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi James - You're right; it's a good idea to consider localization early in the project. But if you use the Dialogue System's localization it's not too hard to add it later also. The manual page is here: Localization.
     
  18. benflock

    benflock

    Joined:
    Jul 11, 2013
    Posts:
    24
    hi tony

    just with ngui continue buttons - i'm using the prefabs and using dialogues that come with the demo and i get the error...

    cheers

    ben
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi Ben - Thanks. I got your file in email and sent you a follow-up.
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Skill Check Example Scene

    I've been asked a couple times for a good way to perform player skill checks in conversations. The ability to register your own C# methods with Lua makes it really easy. The Pixel Crushers customer download site now has an example scene that demonstrates one way to implement skill checks in conversations. It registers a Lua function that allows conversations to call a C# method in an example PlayerSkills class. You can also download the scene right here:

    Skill Check Example
     
  21. zwolya

    zwolya

    Joined:
    Apr 24, 2015
    Posts:
    7
    Hi, complete Unity newbie here. I just got put on a project that's mostly done but has a lot of little fixes they want me to make to streamline it. After skimming through most of this topic, one of the questions I still have has to do with subtitles. As you can see in the image below, there's a line break being forced, but it should obviously be a little earlier. I couldn't find any place to manually set this. I tried to edit the custom UI too, but in making it larger or smaller, it just stretched or compressed the text, distorting it. Is there anything easy I'm missing?

    Dialogue.jpg
     
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @zwolya - Try putting the text in a smaller text element nested inside the button, for example the size of the red box below:



    What GUI system are you using? The new Unity UI, legacy Unity GUI, NGUI?
     
  23. zwolya

    zwolya

    Joined:
    Apr 24, 2015
    Posts:
    7
    I think it's NGUI...I went back and took another look at the Dialogue Manager's UI hierarchy, and the text is appearing on a deeply buried child object. That's why resizing the parent just stretched the text, but finding the correct object solved the problem. Thank you for steering me back in the right direction!
     
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Glad it's solved now. Happy to help!
     
  25. RodzGames

    RodzGames

    Joined:
    Dec 9, 2014
    Posts:
    24
    Hi! I tried making my first conversation, but I have a problem. When I have multiple choices, I click on a button, but nothing happen, it doesn't want to go to the next step. I really don't know what is wrong. Can someone help me please?

    By the way, when I play the scene "Feature Demo", there are a lot of errors popping into the console. It says "Failed to parse Letter of Name." There's also a warning saying "Can't find any built-in sequencer command named 4661645..."

    Is it normal?
     
    Last edited: Apr 26, 2015
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @Matrix456 - No, it's not normal, and unfortunately you're the second person who has just reported this issue. It appears that the Asset Store may be serving a corrupt package to some users, but not all users. I'll look into this and post back here. In the meantime, I PM'd you access information for the Pixel Crushers customer download site where you can download a good copy.

    If anyone else needs access, please PM me your Asset Store invoice number.


    EDIT: Also, if you want to try to re-download from the Asset Store, first delete the old, corrupt package from your Asset Store download cache:
    • OSX: "~/Library/Unity/Asset Store" (or "Asset Store-5.x" if you're using Unity 5)
    • Windows: [your-user-folder]\AppData\Roaming\Unity\Asset Store (or Asset Store-5.x for Unity 5)
     
    Last edited: Apr 26, 2015
  27. RodzGames

    RodzGames

    Joined:
    Dec 9, 2014
    Posts:
    24
    Ok, I downloaded it from your link, but I have the same problem.
    Here's some more detail :
    When I import it, it says that there is some obsolete API, then I click on "I Made a Backup. Go Ahead!"
    After the import, I have 30 errors saying "Binary to YAML conversion: type unsigned int is unsupported".
    When opening the scene, I have the same errors and warnings as before.

    Is it incompatible with Unity 5?
     
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    No, it's fully compatible with Unity 5.

    I just downloaded it from the Asset Store into Unity 5.0.1, and it worked. The other user who had previously downloaded a corrupt copy from the Asset Store imported from the link into Unity 5.0.1, and it also worked. And many developers have been using the Dialogue System in Unity 5 since the very first beta version of Unity 5.

    I'll export a version in Unity 5 and put it on the Pixel Crushers download site.
     
  29. RodzGames

    RodzGames

    Joined:
    Dec 9, 2014
    Posts:
    24
    Ok! I found the cause of the errors. The problem is Asset Serialization (Edit->Project Settings->Editor->Asset Serialization)

    If the mode is set to "Force Binary", it works!
    If the mode is set to "Force Text", it doesn't work...

    Is this a known issue? Can this be fixed?
     
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    I'm looking into this now. I'll post back here soon.
     
  31. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,687
    I've seen this come up in other threads. Will "mixed" work? (Just curious.)
     
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Yes, as a workaround, you can set Edit > Project Settings > Asset Serialization to Mixed and import the Dialogue System. Then change it to Force Text afterward if you want. I'm looking into a better solution, too.
     
    hopeful likes this.
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Importing in Mixed mode will have to be the workaround for the time being. I submitted a bug report with Unity and also opened a support case with the Asset Store team. I'll keep you updated.

    In the meantime, you can download version 1.4.9.3 from the Pixel Crushers customer download site, which now includes native Unity 4.x and Unity 5.x packages. (If you need access, please PM me your Asset Store invoice number.) It should be on the Asset Store in a few days.


    Version 1.4.9.3

    Core
    • Submitted to Asset Store in Unity 4.3 and Unity 5.0.1.
    • Improved: QuestLogWindow.GetNoQuestsMessage() is now virtual so you can override the return value.
    Third Party Support
    • Adventure Creator:
      • Updated for Adventure Creator 1.44.
      • Improved: AC() sequencer command can find actionlists if even multiple GameObjects have the same name.
      • Improved: ACCam() sequencer command has new camera option ACCam(cameraName, [smoothTime]).
    • PlayMaker: Added Send Sequencer Message action; fixed Every Frame checkbox for GetVariable and GetLuaField actions.
     
  34. Pedro-Alaiagames

    Pedro-Alaiagames

    Joined:
    Apr 15, 2014
    Posts:
    28
    Hi!

    Im fighting with the proper configuration of the sequencer camera in a dialogue with 2 NPCs and the Player.

    The dialogue can be trigger for any of the 2 NPC in use? or only by 1 NPC?

    I only want to show the face of the speaker in every phrase of the dialogue.
    This is the sequencer camera script that Im using in the Dialogue Magnager:

    Camera(default,speaker); required Camera(default,listener)@{{end}}

    But with this configurations I obtain random results in wich speaker is focused by the sequencer camera. In the Dialogue database... Must I create a new variable Conversant?.

    Thank you very much for you pattience with me...

    Pedro.
     
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @Pedro Alaiagames - You can put a Conversation Trigger on both NPCs. For example, say the Player has a conversation with Aragorn and Boromir.

    The main participants in the conversation are Player and Aragorn. Boromir is the third actor.

    On both Conversation Triggers, set the Conversant field to Aragorn. This way the conversation participants will be consistent regardless of which NPC triggers the conversation.

    Each dialogue entry has its own Actor and Conversant fields. The Actor is the speaker. If Aragorn is assigned as the Actor, then the sequencer keyword 'speaker' refers to Aragorn. Since the conversation was triggered with Player and Aragorn, the Dialogue System already has a reference to Aragorn's GameObject. This sequence will move the camera to Aragorn's default camera angle (e.g., closeup):
    Code (sequencer):
    1. Camera(default); Delay({{end}})
    I omitted 'speaker' in the Camera() command above because it's the default second parameter. This sequence is the same as above:
    Code (sequencer):
    1. Camera(default,speaker); Delay({{end}})
    To involve Boromir in the conversation, set the dialogue entry's Actor field to Boromir. Since Boromir is not specified in the Conversation Trigger, the Dialogue System doesn't have a reference to Boromir's GameObject. It will search the scene for a GameObject named "Boromir" and set 'speaker' to that GameObject. So you can use the same sequence:
    Code (sequencer):
    1. Camera(default); Delay({{end}})
    If Boromir's GameObject is not named "Boromir", you can specify the GameObject name. For example, say Boromir's GameObject is named "NPC_Boromir"
    Code (sequencer):
    1. Camera(default, NPC_Boromir); Delay({{end}})
    If you set the Dialogue Manager's Debug Level to Info, the sequencer will report what GameObjects it's using.
     
  36. RodzGames

    RodzGames

    Joined:
    Dec 9, 2014
    Posts:
    24
    Hi! I have a 2 questions :

    1- How can I use the keyboard/gamepad instead of the mouse? I tried setting Navigation Enabled to true in the Dialogue Panel, but it didn't work...

    2- When I start a conversation, the name that appear as the NPC is "Dialogue Manager" instead of the name of the actor. I don't know why...
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @Matrix456 - It sounds like you're using the legacy Unity GUI system. (Navigation is different for every GUI system.) You'll want to tick Navigation > Enabled on the Response Menu Panel. Full instructions with screenshots are here.

    I'm guessing that the Conversation Trigger is on the Dialogue Manager GameObject. Assign the actor GameObject to the Conversation Trigger's Conversant field. If the Conversant field isn't set, it will use the Conversation Trigger's GameObject. If you don't want to use the GameObject name, add an Override Actor Name component to the GameObject.
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Version 1.4.9.3 is now available on the Asset Store! Starting with this version, the Asset Store will download a native Unity 5 or Unity 4 package depending on what version of Unity you're using.
     
    boysenberry likes this.
  39. RodzGames

    RodzGames

    Joined:
    Dec 9, 2014
    Posts:
    24
    Ok, thanks! It works now. :)
     
  40. Uselesss

    Uselesss

    Joined:
    Feb 21, 2015
    Posts:
    3
    Hey Toni, I've been using your dialogue system for a while now and I love it.
    I've noticed some strangeness with linking a dialogue entry to an entry inside another conversation however.
    For instance the link appears to go to the first entry of the current conversation (not the target conversation) and sometimes even seems to delete it's text (I swear I've had something else odd happen once when I've done it too but I can't recall anymore), When I go through the conversation in game it leads to where it's supposed to so the link is actually working but the other stuff happening is a little alarming.

    I've used a couple of version of your dialogue system and on both unity 4 and 5 and it seems to happen on all of them. Am I doing something wrong or is this a bug?

    I've attached a picture to help show what I mean. oddness.jpg

    Cheers.
     
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @Uselesss - I'll look into this and get back to you!
     
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @Uselesss - Yes, sorry, this is a bug. I'll get a patch out ASAP.
     
  43. Uselesss

    Uselesss

    Joined:
    Feb 21, 2015
    Posts:
    3
    Cheers Toni,

    You're a legend.
     
  44. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    @Useless - Thanks for reporting the bug. Internally the dialogue database was correct, but the editor wasn't showing links correctly, so it was messing up editing. A patch is now available on the Pixel Crushers customer download site. I also just PM'ed you a direct download link.
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Dialogue System 1.4.9.3 patch 2015-04-29a

    Another developer had a need to access response menu info in a way that wasn't easily accomplished in the Dialogue System, so I updated the patch. It now contains the following:

    • Sends script message OnConversationResponseMenu(Response[] responses) to the Dialogue Manager. (See Script Messages)
    • Exposed DialogueManager.ConversationModel, ConversationView, and ConversationController.
    • Optimized the Tools.IsPrefab method, which is used to determine if a dialogue UI is a prefab or a scene object.
    • Fixed: Cross-conversation links weren’t displaying correctly in the editor.
     
  46. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    Hey @TonyLi

    I have a quick question is there a way to load a level when speaking to an NPC on the map! Example
    NPC: Where would you like to go?
    Player: To the city
    Then when the player clicks "To the city" it will load the level "City" with all the players saved data from the previous level he was just on?
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi @godofwarfare115 - Two steps:

    1. Use the LoadLevel() sequencer command:
    • Dialogue Text: "To the city"
    • Sequence: LoadLevel(City)
    2. Add a Level Manager component to the Dialogue Manager (Component > Dialogue System > Save System > Level Manager). This handles saving and loading of persistent data.
     
    RealAspireGames likes this.
  48. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    Thanks a ton! Working perfectly!
     
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Happy to help! :)
     
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Dialogue System for Unity v1.5.0 Released

    The Dialogue System for Unity v1.5.0 is available for immediate download on the Pixel Crushers customer download site. (PM me your invoice number for access.) It should be available on the Asset Store in a few days!


    Version 1.5.0

    Core
    • Added: OnConversationResponseMenu(Response[] responses) message.
    • Improved: Exposed DialogueManager.ConversationModel, ConversationView, ConversationController.
    • Improved: CSV import/export can now handle double-double-quote format used by Google Sheets.
    • Improved: Optimized prefab identification for dialogue UIs.
    • Changed: Default behavior now does not warn if actor and conversant are same when starting a conversation; to change, set DialogueManager.WarnIfActorAndConversantSame true.
    • Fixed: Removed intermittent nuisance warning message in Dialogue Manager Wizard.
    • Fixed: Cross-conversation links in editor were not showing correctly.
    Third Party Support
    • articy:draft: IsPlayer template value now overrides the converter drop-down setting.
    • ORK: Changed namespace to PixelCrushers.DialogueSystem.ORKFrameworkSupport; Added option to record return value in Lua step.
     
    Last edited: May 5, 2015